-
I’m implementing a group chat where user_proxy should execute code when agents suggest a function call. How can I configure the state_transition function to detect these calls and switch the next speaker to user_proxy? Any advice or best practices for managing state transitions in this context would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
cc @yiranwu0 for awareness |
Beta Was this translation helpful? Give feedback.
-
After creating one user_proxy that is responsible for execution, you can just check the last message to determine whether tool_call is there, and just return the user_proxy. if "tool_calls" in messages[-1]:
return user_proxy When implementing, I think it is best if you could draw out the flow first, and think about how one agent should be transited to another. Check out https://github.com/yiranwu0/StateFlow/blob/main/InterCode/experiments/flow_bash.py#L87 Please let me know if you more comments or issues! |
Beta Was this translation helpful? Give feedback.
After creating one user_proxy that is responsible for execution, you can just check the last message to determine whether tool_call is there, and just return the user_proxy.
When implementing, I think it is best if you could draw out the flow first, and think about how one agent should be transited to another.
Check out https://github.com/yiranwu0/StateFlow/blob/main/InterCode/experiments/flow_bash.py#L87
for an example of a more complicated transition.
Please let me know if you more comments or issues!