Replies: 2 comments
-
The error I receive is as follows
I've also tried setting the class to be a TypedDict as described here but still get the same issue. class Joke(TypedDict): class DebugState(TypedDict): It looks like the error may be on the openai.AsyncStream object but I'm no Python expert so am clutching at straws. This is on the error object: <openai.AsyncStream object at 0x000001745D077920> I can use a PydanticOutputParser but I'm unsure of their reliability in comparison to using with_structured_output. |
Beta Was this translation helpful? Give feedback.
-
Is this possibly a bug? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to stream the response from an OpenAI call back to the user in a FastAPI endpoint. I want the output to be a structured output however when I do this I can't stream. If I remove the with_structured_output then everything is fine. My question is, how do I stream a response if I'm using a structured output?
The code to replicate this is:
Beta Was this translation helpful? Give feedback.
All reactions