This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Replies: 2 comments 1 reply
-
Structured outputs are still in closed beta for us. If you want in, please email [email protected] with a long-form description of your use case and anticipated usage volume. |
Beta Was this translation helpful? Give feedback.
1 reply
-
We have used ChatPerplexity from LangChain and using with_structured_output fuctionality but somehow its not working but provided in the documentation https://python.langchain.com/api_reference/community/chat_models/langchain_community.chat_models.perplexity.ChatPerplexity.html#langchain_community.chat_models.perplexity.ChatPerplexity.with_structured_output |
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.
-
It would be great if the API support passing a JSON schema that specifies the format the response should conform to, similar to OpenAI. This would make it much easier to programmatically handle messages in API responses as we could have a stronger guarantee that the message is in a well-structured and specific format.
Right now the only way to achieve this is by crafting a very specific prompt, and even so the results are inconsistent. The responses are often wrapped in markdown code blocks and can include invalid JSON.
For example, sending this prompt to the API:
Results in a response with line breaks in the JSON, which are invalid:
Beta Was this translation helpful? Give feedback.
All reactions