Skip to content

OpenAI API option Tool_choice: "required" #6352

Closed Answered by stephentoub
jimmystridh asked this question in Q&A
Discussion options

You must be logged in to vote

That support was only very recently added to OpenAI. ToolCallBehavior currently has a RequireFunction method that accepts a single function:

public static ToolCallBehavior RequireFunction(OpenAIFunction function, bool autoInvoke = false)

It should be trivial to add an overload that accepts an enumerable of functions. There is also work underway to abstract all of this away in order to allow it all to be used in a service-agnostic way, and that abstraction already factors in this capability.

Replies: 2 comments 2 replies

Comment options

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

Answer selected by sophialagerkranspandey
Comment options

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

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