Skip to content

Handling State Transitions to Execute Functions with 'user_proxy' #2523

Answered by yiranwu0
beepv asked this question in Q&A
Discussion options

You must be logged in to vote

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
for an example of a more complicated transition.

Please let me know if you more comments or issues!

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@beepv
Comment options

Answer selected by beepv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants