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

'handoffs' and 'agent.as_tool' have different performances. #224

Open
huangbhan opened this issue Mar 18, 2025 · 3 comments
Open

'handoffs' and 'agent.as_tool' have different performances. #224

huangbhan opened this issue Mar 18, 2025 · 3 comments
Labels
question Question about using the SDK

Comments

@huangbhan
Copy link

hi, I created a query_agent that can invoke tools. There is also an assistants_agent that has control over the conversation.

If I use handoffs = [query_agent] in the assistants_agent, it can invoke tools well and pass the correct parameters, but this causes the assistants_agent to lose control of the conversation.

I tried using tools = [query_agent.as_tool] in the assistants_agent, but the performance of invoking tools deteriorated, and the parameters passed were not always correct.

Is this normal? How can I solve it?

@huangbhan huangbhan added the question Question about using the SDK label Mar 18, 2025
@huangbhan
Copy link
Author

Since assistants_agent might handle other sub-tasks and needs to output the results of those sub-tasks, I have to give it control of the conversation.
Maybe I can pass the output of assistants_agent to query_agent as well, and let query_agent make the final output ?

@huangbhan
Copy link
Author

Sorry, I just figured out what handoff does, it can solve this problem

@huangbhan
Copy link
Author

Although I solved this problem, I still want to know why they behave differently. When using 'query_agent.as_tool', the instructions in query_agent do not seem to take effect.

hi, I created a query_agent that can invoke tools. There is also an assistants_agent that has control over the conversation.

If I use handoffs = [query_agent] in the assistants_agent, it can invoke tools well and pass the correct parameters, but this causes the assistants_agent to lose control of the conversation.

I tried using tools = [query_agent.as_tool] in the assistants_agent, but the performance of invoking tools deteriorated, and the parameters passed were not always correct.

Is this normal? How can I solve it?

@huangbhan huangbhan reopened this Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about using the SDK
Projects
None yet
Development

No branches or pull requests

1 participant