google-genai 1.19.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.
@@ -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
- return HttpResponse(
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 response_model and 'http_headers' in response_model.model_fields:
448
- response_model.http_headers.pop('Date', None) # type: ignore[attr-defined]
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
  )
@@ -454,12 +460,7 @@ class ReplayApiClient(BaseApiClient):
454
460
  if isinstance(response_model, list):
455
461
  response_model = response_model[0]
456
462
  print('response_model: ', response_model.model_dump(exclude_none=True))
457
- if isinstance(response_model, GenerateVideosOperation):
458
- actual = response_model.model_dump(
459
- exclude={'result'}, exclude_none=True, mode='json'
460
- )
461
- else:
462
- actual = response_model.model_dump(exclude_none=True, mode='json')
463
+ actual = response_model.model_dump(exclude_none=True, mode='json')
463
464
  expected = interaction.response.sdk_response_segments[
464
465
  self._sdk_response_index
465
466
  ]