Using OpenRouter LLM Class to generate structured output #30319
xxchen04120412
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've created a custom LLM class that inherits the properties of an OpenAI class (This is from multiple community posts)
However, when I try to use pydantic BaseModel to call my OpenRouter API to generate a sturctured output, it FAILS
The test code is trying to "tag" a user input and classify into one of the available labels.
By looking at the traceback, it seems that Classification is receiving an invalid json response. even though the model selected EXPLICITLY allows for structured input.
Beta Was this translation helpful? Give feedback.
All reactions