Support JSON mode with schema forcing for providers that support it (e.g. Fireworks) #19889
dzhulgakov
announced in
Ideas
Replies: 1 comment
-
isnt this already solved? I think with_structured_output doesnt modify the prompt anymore, instead it adds the schema to the request metadata |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Checked
Feature request
with_structured_output
(https://python.langchain.com/docs/guides/structured_output) currently passes the desired schema in the prompt only and sets"response_format": {"type": "json_object"}
in the request. That's what OpenAI supports.Other providers support passing JSON schema directly to the server to guide the generation. E.g. for Fireworks.ai: https://readme.fireworks.ai/docs/structured-response-formatting#structured-response-modes
Motivation
It'd improve quality of JSON generation even further for model providers that support it.
Proposal (If applicable)
No response
Beta Was this translation helpful? Give feedback.
All reactions