feat: `strict` parameter in ToolDefinition
- [x] I have looked for existing issues (including closed) about this
Feature Request
ToolDefinition does not contain a strict option
https://platform.openai.com/docs/assistants/tools/function-calling
Alternatives
The only alternative is to validate the returned JSON manually
I'm definitely in need for this feature, or at least a workaround. Is there a way to add strict to a tooldef so that the jsonschema passed to the llm is adhered to more consistently? I'm getting non-adherence to my schema in tool responses and it may be because of this
@joshua-mo-143 Any plans on supporting structured outputs?
@nikhil-pandey Looking into getting this working. The strict argument isn't consistent with all providers (and some might be default strict)!
@klntsky @Tameflame @nikhil-pandey
Hi folks, we're migrating our OpenAI integration to use the Responses API which makes it trivial to implement strict parameters on structured outputs (via the text config). Once #503 has a PR opened for it and it's been closed, that will then automatically close this issue.
(in terms of accessing the old Chat Completions API: you'll still be able to do it through a method on the adjusted CompletionModel struct)