Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]Add clarify #281

Merged
merged 11 commits into from
Jan 11, 2024
Merged

Conversation

Southpika
Copy link
Contributor

@Southpika Southpika commented Jan 10, 2024

  1. cha t_model增加human clarify接口:当用户问题填参不清晰时询问用户

image

@Southpika
Copy link
Contributor Author

在response中增加clarify,同时增加noaction返回信息
image

Copy link
Collaborator

@sijunhe sijunhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema和create_finished_response这块的改动麻烦 @Bobholamovic 看下

pass


@dataclass
class NoActionStep(AgentStep[_NullInfo, _NullResult]):
class NoActionStep(AgentStep[EndInfo, NullResult]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我又思考了一下,有一些不同看法:现在NoActionStep可能已经不是简单的sentinel了。不过,NoActionStep在定位上其实并不一定与end强绑定(只是FunctionAgent正好遇到NoActionStep终止)。为了提升自由度,建议NoActionStep_IT设置为Dict[str, Any]_RT设置为Any,允许自由配置。在FunctionAgent中可以通过NoActionStep传递end_reason信息。
NO_ACTION_STEP仍然可以提供,建议直接NoActionStep(info={}, result=None),用作哨兵。

@@ -204,20 +206,33 @@ async def _step(
new_messages,
)
else:
if output_message.clarify:
# `clarify` and [`function_call`, `plugin`(directly end)] will not appear at the same time
return NoActionStep(info=EndInfo(end_reason="CLARIFY"), result=NullResult()), new_messages
return NO_ACTION_STEP, new_messages

def _create_finished_response(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里其实不一定是创建finished response了,这个方法名字需要修改吗?

@Southpika
Copy link
Contributor Author

已修改为使用EndStep做为统一的结束信号
之后如引入不直接结束的Plugin,可以通过逻辑判断是否进入EndStep

@Bobholamovic Bobholamovic merged commit 68c305b into PaddlePaddle:develop Jan 11, 2024
4 checks passed
@Southpika Southpika deleted the clarify branch January 12, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants