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

Add support for OpenAI structured outputs #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PhilipMathieuIDEXX
Copy link

@PhilipMathieuIDEXX PhilipMathieuIDEXX commented Dec 2, 2024

Implements a "json_schema" mode in ChatDatabricks to allow passing a JSON schema to models. Enhances existing options (function calling, JSON mode). Includes updates to test cases to reflect currently-available models and to test the new functionality.

Closes #41

@PhilipMathieuIDEXX
Copy link
Author

This approach is slightly less sophisticated than what the OpenAI integration uses (see https://github.com/langchain-ai/langchain/blob/ff675c11f6814e88aa338dc3668aa84d1ade3d19/libs/partners/openai/langchain_openai/chat_models/base.py#L1142). I personally don't think that the complexity makes sense right now (i.e., when enforced json schemas are not utilized by other Databricks models) but would be willing to implement it if desired by the project maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for OpenAI Structured Outputs
1 participant