google-genai 1.20.0__py3-none-any.whl → 1.21.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/genai/_api_client.py +170 -103
- google/genai/_common.py +73 -0
- google/genai/_live_converters.py +174 -414
- google/genai/_replay_api_client.py +9 -3
- google/genai/_tokens_converters.py +81 -176
- google/genai/_transformers.py +19 -40
- google/genai/batches.py +46 -64
- google/genai/caches.py +131 -222
- google/genai/chats.py +4 -4
- google/genai/client.py +1 -1
- google/genai/files.py +88 -106
- google/genai/live.py +15 -20
- google/genai/live_music.py +4 -5
- google/genai/models.py +317 -560
- google/genai/operations.py +35 -68
- google/genai/tokens.py +11 -6
- google/genai/tunings.py +64 -113
- google/genai/types.py +132 -9
- google/genai/version.py +1 -1
- {google_genai-1.20.0.dist-info → google_genai-1.21.0.dist-info}/METADATA +45 -1
- google_genai-1.21.0.dist-info/RECORD +35 -0
- google_genai-1.20.0.dist-info/RECORD +0 -35
- {google_genai-1.20.0.dist-info → google_genai-1.21.0.dist-info}/WHEEL +0 -0
- {google_genai-1.20.0.dist-info → google_genai-1.21.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.20.0.dist-info → google_genai-1.21.0.dist-info}/top_level.txt +0 -0
@@ -425,7 +425,7 @@ class ReplayApiClient(BaseApiClient):
|
|
425
425
|
self._replay_index += 1
|
426
426
|
self._sdk_response_index = 0
|
427
427
|
errors.APIError.raise_for_response(interaction.response)
|
428
|
-
|
428
|
+
http_response = HttpResponse(
|
429
429
|
headers=interaction.response.headers,
|
430
430
|
response_stream=[
|
431
431
|
json.dumps(segment)
|
@@ -433,6 +433,9 @@ class ReplayApiClient(BaseApiClient):
|
|
433
433
|
],
|
434
434
|
byte_stream=interaction.response.byte_segments,
|
435
435
|
)
|
436
|
+
if http_response.response_stream == ['{}']:
|
437
|
+
http_response.response_stream = [""]
|
438
|
+
return http_response
|
436
439
|
|
437
440
|
def _verify_response(self, response_model: BaseModel) -> None:
|
438
441
|
if self._mode == 'api':
|
@@ -444,8 +447,11 @@ class ReplayApiClient(BaseApiClient):
|
|
444
447
|
if self._should_update_replay():
|
445
448
|
if isinstance(response_model, list):
|
446
449
|
response_model = response_model[0]
|
447
|
-
if
|
448
|
-
|
450
|
+
if (
|
451
|
+
response_model
|
452
|
+
and getattr(response_model, 'sdk_http_response', None) is not None
|
453
|
+
):
|
454
|
+
response_model.sdk_http_response.headers.pop('Date', None) # type: ignore[attr-defined]
|
449
455
|
interaction.response.sdk_response_segments.append(
|
450
456
|
response_model.model_dump(exclude_none=True)
|
451
457
|
)
|