Skip to content

Commit

Permalink
fix: Choice casting
Browse files Browse the repository at this point in the history
  • Loading branch information
ramedina86 committed May 15, 2024
1 parent 66aacc7 commit a640f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/streamsync/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _process_completion_data_chunk(choice: StreamingData) -> str:
def _process_chat_data_chunk(chat_data: Chat) -> dict:
choices = chat_data.choices
for entry in choices:
message = cast(dict, entry.get("message"))
message = cast(dict, entry).get("message")
return message
raise ValueError("Failed to retrieve text from chat stream")

Expand Down

0 comments on commit a640f6f

Please sign in to comment.