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

[Feature]: ChatLiteLLMRouter to support json_schema #9043

Open
eilam-stream opened this issue Mar 7, 2025 · 1 comment
Open

[Feature]: ChatLiteLLMRouter to support json_schema #9043

eilam-stream opened this issue Mar 7, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@eilam-stream
Copy link

The Feature

Currently ChatLiteLLMRouter does not support json_schema method which is the gold standard for Structured Output using OpenAI.

Langchain's ChatOpenAI supports chat.with_structured_output(pydantic_model, method="json_schema") but if chat is ChatLiteLLMRouter the following error is received:

langchain_core/language_models/chat_models.py", line 1303, in with_structured_output
    raise ValueError(msg)
ValueError: Received unsupported arguments {'method': 'json_schema'}

Motivation, pitch

Langchain is a standard in the industry and supporting this functionality will not just improve user's reliability since Structured Output using json_mode, as opposed to json_schema, is frequently faulty and causes issues in production.

Are you a ML Ops Team?

No

Twitter / LinkedIn details

No response

@eilam-stream eilam-stream added the enhancement New feature or request label Mar 7, 2025
@krrishdholakia
Copy link
Contributor

Hi @eilam-stream litellm supports json_schema - https://docs.litellm.ai/docs/completion/json_mode#2-check-if-model-supports-json_schema.

I believe chatlitellmrouter is a community langfuse integration - we would welcome any PR to https://github.com/langchain-ai/langchain

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

No branches or pull requests

2 participants