https://www.boundaryml.com logo
🟡 Question about BAML function and OpenAI tool_us...
# questions
s
Is it possible to require tool use if we have a baml function like this:
Copy code
def function -> string | (tool type 1, tool type 2)[]
using something like OpenAI's tool_use = [none | auto | required] interface? Didn't see any options on this so was wondering if it's something I need to pass to the model API or something
v
If you use that return type it should just work based on the model!
No additional tools are available
We are thinking of how to support dynamic tool selection!
s
Thank you for the info! A follow-up on this - are we able to pass in tool arrays to BAML's openai api calls if we set tool_choice: required in the baml client options? @User. A tools array is required if we set tool_choice to required in options. A little more context: 1. We don't want to always have the ability to use tools, we want to disable or require it sometimes. The string | (Tool_1, etc..)[] I think is just like OpenAI's auto setting 2. We don't want to have a BAML function for each combination of string, string | (Tool_1, etc..)[], or (Tool_1, etc..)[]