Gpt_4o : tool_choice value for using multiple tools

In my use case, I have multiple tools defined in gpt 4o payload. I want to use all the tools. What should be the tool_choice value in such case? Since I have multiple tools defined,I cannot run the api per tool in production, it will be cost intensive.

Welcome to the community @Shrawani_Bawage.

It totally depends on the nature of the tools you want to call. If they can be run in parallel, independent of each other’s output, tool_choice can be set to required when you want the model to call one or more tools, or auto if you want the model to make the decision based on the context.

Additionally, you can be explicit in your instructions about which set of tools should be called together and in what sequence.

More info in docs

2 Likes

Thanks for your reply! My tools are independent of each other wnd want them to run parallely. Additionally, I aant want all tool to run. Should I use tool_choice = required as well in this situation?

Yes, you should set tool_choice to required and also instruct the model to call the tools together.