google-genai 1.24.0__py3-none-any.whl → 1.26.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.
@@ -232,8 +232,18 @@ class HttpResponse:
232
232
  byte_stream: Union[Any, bytes] = None,
233
233
  session: Optional['aiohttp.ClientSession'] = None,
234
234
  ):
235
+ if isinstance(headers, dict):
236
+ self.headers = headers
237
+ elif isinstance(headers, httpx.Headers):
238
+ self.headers = {
239
+ key: ', '.join(headers.get_list(key))
240
+ for key in headers.keys()}
241
+ elif type(headers).__name__ == 'CIMultiDictProxy':
242
+ self.headers = {
243
+ key: ', '.join(headers.getall(key))
244
+ for key in headers.keys()}
245
+
235
246
  self.status_code: int = 200
236
- self.headers = headers
237
247
  self.response_stream = response_stream
238
248
  self.byte_stream = byte_stream
239
249
  self._session = session
google/genai/_common.py CHANGED
@@ -29,11 +29,13 @@ import warnings
29
29
  import pydantic
30
30
  from pydantic import alias_generators
31
31
 
32
- from . import _api_client
33
- from . import errors
34
-
35
32
  logger = logging.getLogger('google_genai._common')
36
33
 
34
+
35
+ class ExperimentalWarning(Warning):
36
+ """Warning for experimental features."""
37
+
38
+
37
39
  def set_value_by_path(data: Optional[dict[Any, Any]], keys: list[str], value: Any) -> None:
38
40
  """Examples:
39
41
 
@@ -540,7 +542,7 @@ def experimental_warning(message: str) -> Callable[[Callable[..., Any]], Callabl
540
542
  warning_done = True
541
543
  warnings.warn(
542
544
  message=message,
543
- category=errors.ExperimentalWarning,
545
+ category=ExperimentalWarning,
544
546
  stacklevel=2,
545
547
  )
546
548
  return func(*args, **kwargs)
@@ -114,7 +114,7 @@ def format_destination(
114
114
  unique_name = unique_name or _common.timestamped_unique_name()
115
115
  config.dest = f'{bigquery_source_uri}_dest_{unique_name}'
116
116
  else:
117
- raise ValueError(f'Unsupported source: {src}')
117
+ raise ValueError(f'The source {src} is not supported.')
118
118
  return config
119
119
 
120
120