- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.3k
Open
Description
Description
When assigning tools there's no method or parameter to add that forces the model to use the tool. You either have to instruct it through a system_prompt or assume it makes the decision itself to use the tool.
The OpenAI SDK has a tool_choice parameter that can be found here.
Can you add this or a similar functionality that forces the model to use a specified tool on the first API request?
Example of the tool_choice parameter:
response = client.responses.create(
      model=model,
      tools=[{"type": "web_search_preview"}],
      input=search_query,
      tool_choice="required",
  )
References
https://platform.openai.com/docs/api-reference/responses/create#responses/object-tool_choice
maltekuehl, moritzwilksch and chenlujjj
Metadata
Metadata
Assignees
Labels
Feature requestNew feature requestNew feature request