-
Notifications
You must be signed in to change notification settings - Fork 864
Open
Description
def encode(self, event: BaseEvent) -> str:
"""
Encodes an event.
"""
return self._encode_sse(event)
def _encode_sse(self, event: BaseEvent) -> str:
"""
Encodes an event into an SSE string.
"""
return f"data: {event.model_dump_json(by_alias=True, exclude_none=True)}\n\n"
yield encoder.encode({
"type": EventType.TEXT_MESSAGE_CHUNK,
"message_id": message_id,
"delta": chunk.choices[0].delta.content,
})
Handle tool call chunks
dict object has no attribute "model_dump_json"
why you yield dict??
Metadata
Metadata
Assignees
Labels
No labels