Skip to content

[Feature]: ChatLiteLLMRouter to support json_schema #9043

@eilam-stream

Description

@eilam-stream

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions