From 5a419faf8471c6eb3a379e46a6f1c596226184ea Mon Sep 17 00:00:00 2001 From: Ramiro Medina <64783088+ramedina86@users.noreply.github.com> Date: Wed, 15 May 2024 21:18:23 +0000 Subject: [PATCH] fix: Linter --- src/streamsync/ai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/streamsync/ai.py b/src/streamsync/ai.py index 478d3a19e..fbbb43149 100644 --- a/src/streamsync/ai.py +++ b/src/streamsync/ai.py @@ -49,7 +49,8 @@ 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") + dict_entry = cast(dict, entry) + message = cast(dict, dict_entry["message"]) return message raise ValueError("Failed to retrieve text from chat stream")