-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
core: remove unsupported keywords from pydantic schema #29611
Conversation
Resolves 29604 This modified the _rm_titles function to allow using `json_schema` method of structure output with `datetime.date` . The set of unsupported openai keywords includes the `title` key, as well as all the unsupported items listed here : https://platform.openai.com/docs/guides/structured-outputs#some-type-specific-keywords-are-not-yet-supported
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. I don't think we want to silently remove these from schemas:
- If OpenAI, Mistral, etc. begin supporting them, it will be a breaking change for LangChain to include them as well.
- I believe this change would impact all tool-calling functionality for all integrations (not just structured output and not just for Mistral / OpenAI).
I think it's preferable to raise an informative error message in the Mistral/OpenAI integrations directing users to use a different method for structured output, such as "function_calling"
.
Let me know what you think.
The Regarding the second point, this method ( What I believe could be done better than what I did :
Why I think it's better to allow this instead of simply raising an informative error : I am ready to rework this PR as something more robust, but only if it seems like there is an option that could be accepted. What would you advise on this ? |
Description
This modified the _rm_titles function to allow using
json_schema
method of structure output withdatetime.date
. The set of unsupported openai keywords includes thetitle
key, as well as all the unsupported items listed here : https://platform.openai.com/docs/guides/structured-outputs#some-type-specific-keywords-are-not-yet-supportedIssue
Resolves #29604