Skip to content
Discussion options

You must be logged in to vote

Found answer by defining the llm like this:

class Query(BaseModel):
    query: str = Field(description="The SQL query")


llm = (
        ChatMistralAI(
            model_name="mistral-large-latest",
        ).with_structured_output(Query)
        | (lambda output: output.query))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Guerric-P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant