Skip to content

Function output have normal tool name without final_result_ prefix #1958

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

Conversation

BeautyyuYanli
Copy link
Contributor

Following #1785 , I want the function output behave with the same name as normal tools, i.e. hand_off_to_maths_agent instead of final_result_hand_off_to_maths_agent.

@BeautyyuYanli BeautyyuYanli force-pushed the yanli/normalize_function_output branch from 2f550bb to 582e2b9 Compare June 11, 2025 06:41
@BeautyyuYanli
Copy link
Contributor Author

@DouweM Waiting for your review :)

@DouweM
Copy link
Contributor

DouweM commented Jun 11, 2025

@BeautyyuYanli Pydantic AI already lets you specify a custom tool name by using output_type=[ToolOutput(hand_off_to_maths_agent, name="hand_off_to_maths_agent"), ...] instead of output_type=[hand_off_to_maths_agent, ...]. Can you give that a try?

If you think we should change the default behavior, I'd suggest filing an issue as it would require a bit more thought and discussion, since the final_result prefix also serves as a bit of a hint to the LLM that it's not a regular tool call, but one that will end the conversation.

I'll close this PR for now, also keeping in mind that it'll end up conflicting with #1628 which we'll be merging soon.

@DouweM DouweM closed this Jun 11, 2025
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.

2 participants