@@ -5168,7 +5168,7 @@ def generate_content_stream(
51685168 # Yield chunks only if there's no function response parts.
51695169 for chunk in response :
51705170 if not function_map :
5171- _extra_utils .append_chunk_contents (contents , chunk )
5171+ contents = _extra_utils .append_chunk_contents (contents , chunk )
51725172 yield chunk
51735173 else :
51745174 if (
@@ -5181,7 +5181,7 @@ def generate_content_stream(
51815181 chunk , function_map
51825182 )
51835183 if not func_response_parts :
5184- _extra_utils .append_chunk_contents (contents , chunk )
5184+ contents = _extra_utils .append_chunk_contents (contents , chunk )
51855185 yield chunk
51865186
51875187 else :
@@ -5191,7 +5191,7 @@ def generate_content_stream(
51915191 chunk .automatic_function_calling_history = (
51925192 automatic_function_calling_history
51935193 )
5194- _extra_utils .append_chunk_contents (contents , chunk )
5194+ contents = _extra_utils .append_chunk_contents (contents , chunk )
51955195 yield chunk
51965196 if (
51975197 chunk is None
@@ -6938,7 +6938,7 @@ async def async_generator(model, contents, config): # type: ignore[no-untyped-d
69386938 # Yield chunks only if there's no function response parts.
69396939 async for chunk in response : # type: ignore[attr-defined]
69406940 if not function_map :
6941- _extra_utils .append_chunk_contents (contents , chunk )
6941+ contents = _extra_utils .append_chunk_contents (contents , chunk )
69426942 yield chunk
69436943 else :
69446944 if (
@@ -6953,7 +6953,7 @@ async def async_generator(model, contents, config): # type: ignore[no-untyped-d
69536953 )
69546954 )
69556955 if not func_response_parts :
6956- _extra_utils .append_chunk_contents (contents , chunk )
6956+ contents = _extra_utils .append_chunk_contents (contents , chunk )
69576957 yield chunk
69586958
69596959 else :
@@ -6964,7 +6964,7 @@ async def async_generator(model, contents, config): # type: ignore[no-untyped-d
69646964 chunk .automatic_function_calling_history = (
69656965 automatic_function_calling_history
69666966 )
6967- _extra_utils .append_chunk_contents (contents , chunk )
6967+ contents = _extra_utils .append_chunk_contents (contents , chunk )
69686968 yield chunk
69696969 if (
69706970 chunk is None
0 commit comments