-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conversation
Southpika
commented
Jan 10, 2024
•
edited
Loading
edited
- cha t_model增加human clarify接口:当用户问题填参不清晰时询问用户
There was a problem hiding this 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]): |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里其实不一定是创建finished response了,这个方法名字需要修改吗?
已修改为使用EndStep做为统一的结束信号 |