diff --git a/src/strands/models/gemini.py b/src/strands/models/gemini.py index 6a6535999..6b55be80f 100644 --- a/src/strands/models/gemini.py +++ b/src/strands/models/gemini.py @@ -465,6 +465,10 @@ async def stream( for part in parts: if part.function_call: + if data_type is not None: + yield self._format_chunk({"chunk_type": "content_stop", "data_type": data_type}) + data_type = None + yield self._format_chunk({"chunk_type": "content_start", "data_type": "tool", "data": part}) yield self._format_chunk({"chunk_type": "content_delta", "data_type": "tool", "data": part}) yield self._format_chunk({"chunk_type": "content_stop", "data_type": "tool", "data": part})