-
-
Notifications
You must be signed in to change notification settings - Fork 999
Streaming with Literal["Value"] = "value" #2054
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingpythonPull requests that update python codePull requests that update python codequestionFurther information is requestedFurther information is requested
Description
I have something similar to the following:
class Person(BaseModel):
type: Literal["Person"] = "Person"
name: str
age: intWhen streaming I get:
{ "name": " Joh", "age": {} }
...
{ "name": " Johny Stevenson", "age": 31 }
{ "name": " Johny Stevenson", "age": 31, "type": "Person" }
This "type": "Person" pops up at the end of the stream, but it is known before hand.
In my case I need type for rendering the content on the frontend it should be there in the partial response regardless because it's known before hand.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpythonPull requests that update python codePull requests that update python codequestionFurther information is requestedFurther information is requested