Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
  • Loading branch information
vblagoje committed Feb 11, 2025
1 parent 427e763 commit c4e7dc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions haystack/components/generators/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ def _check_finish_reason(self, meta: Dict[str, Any]) -> None:
finish_reason=meta["finish_reason"],
)

def _convert_streaming_chunks_to_chat_message(self, chunk: Any, chunks: List[StreamingChunk]) -> ChatMessage:
def _convert_streaming_chunks_to_chat_message(
self, chunk: ChatCompletionChunk, chunks: List[StreamingChunk]
) -> ChatMessage:
"""
Connects the streaming chunks into a single ChatMessage.
Expand All @@ -348,7 +350,7 @@ def _convert_streaming_chunks_to_chat_message(self, chunk: Any, chunks: List[Str
tool_calls = []

# Process tool calls if present in any chunk
tool_call_data = {} # Track tool calls by ID
tool_call_data: Dict[str, Dict[str, str]] = {} # Track tool calls by ID
for chunk_payload in chunks:
tool_calls_meta = chunk_payload.meta.get("tool_calls")
if tool_calls_meta:
Expand Down

0 comments on commit c4e7dc7

Please sign in to comment.