Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support OpenAI's strict mode for tool calling in ChatOpenAI #536

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

davidmigloz
Copy link
Owner

@davidmigloz davidmigloz commented Aug 21, 2024

When defining your tool, set the strict parameter to true to enable strict schema adherence when generating the tool call. If set to true, the model will follow the exact schema defined in the inputJsonSchema field.

This is only supported by OpenAI provider at the moment. And they only support a subset of JSON Schema is supported when strict is enabled. Check out their docs for more info.

@davidmigloz davidmigloz self-assigned this Aug 21, 2024
@davidmigloz davidmigloz added t:enhancement New feature or request c:chat-models Chat models. p:langchain_openai langchain_openai package. labels Aug 21, 2024
@davidmigloz davidmigloz added this to the v0.8.0 milestone Aug 21, 2024
@davidmigloz davidmigloz merged commit 71623f4 into main Aug 21, 2024
1 check passed
@davidmigloz davidmigloz deleted the tool-strict branch August 21, 2024 21:15
KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this pull request Oct 1, 2024
KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:chat-models Chat models. p:langchain_openai langchain_openai package. t:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant