google-genai 1.58.0__py3-none-any.whl → 1.59.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 +7 -2
- google/genai/_interactions/_base_client.py +134 -11
- google/genai/_interactions/_models.py +16 -1
- google/genai/_interactions/_types.py +9 -0
- google/genai/_interactions/types/image_config.py +1 -1
- google/genai/_interactions/types/image_config_param.py +1 -1
- google/genai/version.py +1 -1
- {google_genai-1.58.0.dist-info → google_genai-1.59.0.dist-info}/METADATA +1 -1
- {google_genai-1.58.0.dist-info → google_genai-1.59.0.dist-info}/RECORD +12 -12
- {google_genai-1.58.0.dist-info → google_genai-1.59.0.dist-info}/WHEEL +0 -0
- {google_genai-1.58.0.dist-info → google_genai-1.59.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.58.0.dist-info → google_genai-1.59.0.dist-info}/top_level.txt +0 -0
google/genai/_api_client.py
CHANGED
|
@@ -181,6 +181,13 @@ def join_url_path(base_url: str, path: str) -> str:
|
|
|
181
181
|
|
|
182
182
|
def load_auth(*, project: Union[str, None]) -> Tuple[Credentials, str]:
|
|
183
183
|
"""Loads google auth credentials and project id."""
|
|
184
|
+
|
|
185
|
+
## Set GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICES to false
|
|
186
|
+
## to disable bound token sharing. Tracking on
|
|
187
|
+
## https://github.com/googleapis/python-genai/issues/1956
|
|
188
|
+
os.environ['GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICES'] = (
|
|
189
|
+
'false'
|
|
190
|
+
)
|
|
184
191
|
credentials, loaded_project_id = google.auth.default( # type: ignore[no-untyped-call]
|
|
185
192
|
scopes=['https://www.googleapis.com/auth/cloud-platform'],
|
|
186
193
|
)
|
|
@@ -1946,5 +1953,3 @@ async def async_get_token_from_credentials(
|
|
|
1946
1953
|
raise RuntimeError('Could not resolve API token from the environment')
|
|
1947
1954
|
|
|
1948
1955
|
return credentials.token # type: ignore[no-any-return]
|
|
1949
|
-
|
|
1950
|
-
|
|
@@ -24,6 +24,7 @@ import asyncio
|
|
|
24
24
|
import inspect
|
|
25
25
|
import logging
|
|
26
26
|
import platform
|
|
27
|
+
import warnings
|
|
27
28
|
import email.utils
|
|
28
29
|
from types import TracebackType
|
|
29
30
|
from random import random
|
|
@@ -66,9 +67,11 @@ from ._types import (
|
|
|
66
67
|
ResponseT,
|
|
67
68
|
AnyMapping,
|
|
68
69
|
PostParser,
|
|
70
|
+
BinaryTypes,
|
|
69
71
|
RequestFiles,
|
|
70
72
|
HttpxSendArgs,
|
|
71
73
|
RequestOptions,
|
|
74
|
+
AsyncBinaryTypes,
|
|
72
75
|
HttpxRequestFiles,
|
|
73
76
|
ModelBuilderProtocol,
|
|
74
77
|
not_given,
|
|
@@ -501,8 +504,19 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
501
504
|
retries_taken: int = 0,
|
|
502
505
|
) -> httpx.Request:
|
|
503
506
|
if log.isEnabledFor(logging.DEBUG):
|
|
504
|
-
log.debug(
|
|
505
|
-
|
|
507
|
+
log.debug(
|
|
508
|
+
"Request options: %s",
|
|
509
|
+
model_dump(
|
|
510
|
+
options,
|
|
511
|
+
exclude_unset=True,
|
|
512
|
+
# Pydantic v1 can't dump every type we support in content, so we exclude it for now.
|
|
513
|
+
exclude={
|
|
514
|
+
"content",
|
|
515
|
+
}
|
|
516
|
+
if PYDANTIC_V1
|
|
517
|
+
else {},
|
|
518
|
+
),
|
|
519
|
+
)
|
|
506
520
|
kwargs: dict[str, Any] = {}
|
|
507
521
|
|
|
508
522
|
json_data = options.json_data
|
|
@@ -556,7 +570,13 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
556
570
|
is_body_allowed = options.method.lower() != "get"
|
|
557
571
|
|
|
558
572
|
if is_body_allowed:
|
|
559
|
-
if
|
|
573
|
+
if options.content is not None and json_data is not None:
|
|
574
|
+
raise TypeError("Passing both `content` and `json_data` is not supported")
|
|
575
|
+
if options.content is not None and files is not None:
|
|
576
|
+
raise TypeError("Passing both `content` and `files` is not supported")
|
|
577
|
+
if options.content is not None:
|
|
578
|
+
kwargs["content"] = options.content
|
|
579
|
+
elif isinstance(json_data, bytes):
|
|
560
580
|
kwargs["content"] = json_data
|
|
561
581
|
else:
|
|
562
582
|
kwargs["json"] = json_data if is_given(json_data) else None
|
|
@@ -1218,6 +1238,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1218
1238
|
*,
|
|
1219
1239
|
cast_to: Type[ResponseT],
|
|
1220
1240
|
body: Body | None = None,
|
|
1241
|
+
content: BinaryTypes | None = None,
|
|
1221
1242
|
options: RequestOptions = {},
|
|
1222
1243
|
files: RequestFiles | None = None,
|
|
1223
1244
|
stream: Literal[False] = False,
|
|
@@ -1230,6 +1251,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1230
1251
|
*,
|
|
1231
1252
|
cast_to: Type[ResponseT],
|
|
1232
1253
|
body: Body | None = None,
|
|
1254
|
+
content: BinaryTypes | None = None,
|
|
1233
1255
|
options: RequestOptions = {},
|
|
1234
1256
|
files: RequestFiles | None = None,
|
|
1235
1257
|
stream: Literal[True],
|
|
@@ -1243,6 +1265,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1243
1265
|
*,
|
|
1244
1266
|
cast_to: Type[ResponseT],
|
|
1245
1267
|
body: Body | None = None,
|
|
1268
|
+
content: BinaryTypes | None = None,
|
|
1246
1269
|
options: RequestOptions = {},
|
|
1247
1270
|
files: RequestFiles | None = None,
|
|
1248
1271
|
stream: bool,
|
|
@@ -1255,13 +1278,25 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1255
1278
|
*,
|
|
1256
1279
|
cast_to: Type[ResponseT],
|
|
1257
1280
|
body: Body | None = None,
|
|
1281
|
+
content: BinaryTypes | None = None,
|
|
1258
1282
|
options: RequestOptions = {},
|
|
1259
1283
|
files: RequestFiles | None = None,
|
|
1260
1284
|
stream: bool = False,
|
|
1261
1285
|
stream_cls: type[_StreamT] | None = None,
|
|
1262
1286
|
) -> ResponseT | _StreamT:
|
|
1287
|
+
if body is not None and content is not None:
|
|
1288
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1289
|
+
if files is not None and content is not None:
|
|
1290
|
+
raise TypeError("Passing both `files` and `content` is not supported")
|
|
1291
|
+
if isinstance(body, bytes):
|
|
1292
|
+
warnings.warn(
|
|
1293
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1294
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1295
|
+
DeprecationWarning,
|
|
1296
|
+
stacklevel=2,
|
|
1297
|
+
)
|
|
1263
1298
|
opts = FinalRequestOptions.construct(
|
|
1264
|
-
method="post", url=path, json_data=body, files=to_httpx_files(files), **options
|
|
1299
|
+
method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
|
|
1265
1300
|
)
|
|
1266
1301
|
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
|
|
1267
1302
|
|
|
@@ -1271,11 +1306,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1271
1306
|
*,
|
|
1272
1307
|
cast_to: Type[ResponseT],
|
|
1273
1308
|
body: Body | None = None,
|
|
1309
|
+
content: BinaryTypes | None = None,
|
|
1274
1310
|
files: RequestFiles | None = None,
|
|
1275
1311
|
options: RequestOptions = {},
|
|
1276
1312
|
) -> ResponseT:
|
|
1313
|
+
if body is not None and content is not None:
|
|
1314
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1315
|
+
if files is not None and content is not None:
|
|
1316
|
+
raise TypeError("Passing both `files` and `content` is not supported")
|
|
1317
|
+
if isinstance(body, bytes):
|
|
1318
|
+
warnings.warn(
|
|
1319
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1320
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1321
|
+
DeprecationWarning,
|
|
1322
|
+
stacklevel=2,
|
|
1323
|
+
)
|
|
1277
1324
|
opts = FinalRequestOptions.construct(
|
|
1278
|
-
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
|
|
1325
|
+
method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
|
|
1279
1326
|
)
|
|
1280
1327
|
return self.request(cast_to, opts)
|
|
1281
1328
|
|
|
@@ -1285,11 +1332,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1285
1332
|
*,
|
|
1286
1333
|
cast_to: Type[ResponseT],
|
|
1287
1334
|
body: Body | None = None,
|
|
1335
|
+
content: BinaryTypes | None = None,
|
|
1288
1336
|
files: RequestFiles | None = None,
|
|
1289
1337
|
options: RequestOptions = {},
|
|
1290
1338
|
) -> ResponseT:
|
|
1339
|
+
if body is not None and content is not None:
|
|
1340
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1341
|
+
if files is not None and content is not None:
|
|
1342
|
+
raise TypeError("Passing both `files` and `content` is not supported")
|
|
1343
|
+
if isinstance(body, bytes):
|
|
1344
|
+
warnings.warn(
|
|
1345
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1346
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1347
|
+
DeprecationWarning,
|
|
1348
|
+
stacklevel=2,
|
|
1349
|
+
)
|
|
1291
1350
|
opts = FinalRequestOptions.construct(
|
|
1292
|
-
method="put", url=path, json_data=body, files=to_httpx_files(files), **options
|
|
1351
|
+
method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
|
|
1293
1352
|
)
|
|
1294
1353
|
return self.request(cast_to, opts)
|
|
1295
1354
|
|
|
@@ -1299,9 +1358,19 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1299
1358
|
*,
|
|
1300
1359
|
cast_to: Type[ResponseT],
|
|
1301
1360
|
body: Body | None = None,
|
|
1361
|
+
content: BinaryTypes | None = None,
|
|
1302
1362
|
options: RequestOptions = {},
|
|
1303
1363
|
) -> ResponseT:
|
|
1304
|
-
|
|
1364
|
+
if body is not None and content is not None:
|
|
1365
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1366
|
+
if isinstance(body, bytes):
|
|
1367
|
+
warnings.warn(
|
|
1368
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1369
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1370
|
+
DeprecationWarning,
|
|
1371
|
+
stacklevel=2,
|
|
1372
|
+
)
|
|
1373
|
+
opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
|
|
1305
1374
|
return self.request(cast_to, opts)
|
|
1306
1375
|
|
|
1307
1376
|
def get_api_list(
|
|
@@ -1741,6 +1810,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1741
1810
|
*,
|
|
1742
1811
|
cast_to: Type[ResponseT],
|
|
1743
1812
|
body: Body | None = None,
|
|
1813
|
+
content: AsyncBinaryTypes | None = None,
|
|
1744
1814
|
files: RequestFiles | None = None,
|
|
1745
1815
|
options: RequestOptions = {},
|
|
1746
1816
|
stream: Literal[False] = False,
|
|
@@ -1753,6 +1823,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1753
1823
|
*,
|
|
1754
1824
|
cast_to: Type[ResponseT],
|
|
1755
1825
|
body: Body | None = None,
|
|
1826
|
+
content: AsyncBinaryTypes | None = None,
|
|
1756
1827
|
files: RequestFiles | None = None,
|
|
1757
1828
|
options: RequestOptions = {},
|
|
1758
1829
|
stream: Literal[True],
|
|
@@ -1766,6 +1837,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1766
1837
|
*,
|
|
1767
1838
|
cast_to: Type[ResponseT],
|
|
1768
1839
|
body: Body | None = None,
|
|
1840
|
+
content: AsyncBinaryTypes | None = None,
|
|
1769
1841
|
files: RequestFiles | None = None,
|
|
1770
1842
|
options: RequestOptions = {},
|
|
1771
1843
|
stream: bool,
|
|
@@ -1778,13 +1850,25 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1778
1850
|
*,
|
|
1779
1851
|
cast_to: Type[ResponseT],
|
|
1780
1852
|
body: Body | None = None,
|
|
1853
|
+
content: AsyncBinaryTypes | None = None,
|
|
1781
1854
|
files: RequestFiles | None = None,
|
|
1782
1855
|
options: RequestOptions = {},
|
|
1783
1856
|
stream: bool = False,
|
|
1784
1857
|
stream_cls: type[_AsyncStreamT] | None = None,
|
|
1785
1858
|
) -> ResponseT | _AsyncStreamT:
|
|
1859
|
+
if body is not None and content is not None:
|
|
1860
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1861
|
+
if files is not None and content is not None:
|
|
1862
|
+
raise TypeError("Passing both `files` and `content` is not supported")
|
|
1863
|
+
if isinstance(body, bytes):
|
|
1864
|
+
warnings.warn(
|
|
1865
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1866
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1867
|
+
DeprecationWarning,
|
|
1868
|
+
stacklevel=2,
|
|
1869
|
+
)
|
|
1786
1870
|
opts = FinalRequestOptions.construct(
|
|
1787
|
-
method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
|
|
1871
|
+
method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
|
|
1788
1872
|
)
|
|
1789
1873
|
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
|
|
1790
1874
|
|
|
@@ -1794,11 +1878,28 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1794
1878
|
*,
|
|
1795
1879
|
cast_to: Type[ResponseT],
|
|
1796
1880
|
body: Body | None = None,
|
|
1881
|
+
content: AsyncBinaryTypes | None = None,
|
|
1797
1882
|
files: RequestFiles | None = None,
|
|
1798
1883
|
options: RequestOptions = {},
|
|
1799
1884
|
) -> ResponseT:
|
|
1885
|
+
if body is not None and content is not None:
|
|
1886
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1887
|
+
if files is not None and content is not None:
|
|
1888
|
+
raise TypeError("Passing both `files` and `content` is not supported")
|
|
1889
|
+
if isinstance(body, bytes):
|
|
1890
|
+
warnings.warn(
|
|
1891
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1892
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1893
|
+
DeprecationWarning,
|
|
1894
|
+
stacklevel=2,
|
|
1895
|
+
)
|
|
1800
1896
|
opts = FinalRequestOptions.construct(
|
|
1801
|
-
method="patch",
|
|
1897
|
+
method="patch",
|
|
1898
|
+
url=path,
|
|
1899
|
+
json_data=body,
|
|
1900
|
+
content=content,
|
|
1901
|
+
files=await async_to_httpx_files(files),
|
|
1902
|
+
**options,
|
|
1802
1903
|
)
|
|
1803
1904
|
return await self.request(cast_to, opts)
|
|
1804
1905
|
|
|
@@ -1808,11 +1909,23 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1808
1909
|
*,
|
|
1809
1910
|
cast_to: Type[ResponseT],
|
|
1810
1911
|
body: Body | None = None,
|
|
1912
|
+
content: AsyncBinaryTypes | None = None,
|
|
1811
1913
|
files: RequestFiles | None = None,
|
|
1812
1914
|
options: RequestOptions = {},
|
|
1813
1915
|
) -> ResponseT:
|
|
1916
|
+
if body is not None and content is not None:
|
|
1917
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1918
|
+
if files is not None and content is not None:
|
|
1919
|
+
raise TypeError("Passing both `files` and `content` is not supported")
|
|
1920
|
+
if isinstance(body, bytes):
|
|
1921
|
+
warnings.warn(
|
|
1922
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1923
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1924
|
+
DeprecationWarning,
|
|
1925
|
+
stacklevel=2,
|
|
1926
|
+
)
|
|
1814
1927
|
opts = FinalRequestOptions.construct(
|
|
1815
|
-
method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options
|
|
1928
|
+
method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
|
|
1816
1929
|
)
|
|
1817
1930
|
return await self.request(cast_to, opts)
|
|
1818
1931
|
|
|
@@ -1822,9 +1935,19 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1822
1935
|
*,
|
|
1823
1936
|
cast_to: Type[ResponseT],
|
|
1824
1937
|
body: Body | None = None,
|
|
1938
|
+
content: AsyncBinaryTypes | None = None,
|
|
1825
1939
|
options: RequestOptions = {},
|
|
1826
1940
|
) -> ResponseT:
|
|
1827
|
-
|
|
1941
|
+
if body is not None and content is not None:
|
|
1942
|
+
raise TypeError("Passing both `body` and `content` is not supported")
|
|
1943
|
+
if isinstance(body, bytes):
|
|
1944
|
+
warnings.warn(
|
|
1945
|
+
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
|
|
1946
|
+
"Please pass raw bytes via the `content` parameter instead.",
|
|
1947
|
+
DeprecationWarning,
|
|
1948
|
+
stacklevel=2,
|
|
1949
|
+
)
|
|
1950
|
+
opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
|
|
1828
1951
|
return await self.request(cast_to, opts)
|
|
1829
1952
|
|
|
1830
1953
|
def get_api_list(
|
|
@@ -19,7 +19,20 @@ from __future__ import annotations
|
|
|
19
19
|
import os
|
|
20
20
|
import inspect
|
|
21
21
|
import weakref
|
|
22
|
-
from typing import
|
|
22
|
+
from typing import (
|
|
23
|
+
IO,
|
|
24
|
+
TYPE_CHECKING,
|
|
25
|
+
Any,
|
|
26
|
+
Type,
|
|
27
|
+
Union,
|
|
28
|
+
Generic,
|
|
29
|
+
TypeVar,
|
|
30
|
+
Callable,
|
|
31
|
+
Iterable,
|
|
32
|
+
Optional,
|
|
33
|
+
AsyncIterable,
|
|
34
|
+
cast,
|
|
35
|
+
)
|
|
23
36
|
from datetime import date, datetime
|
|
24
37
|
from typing_extensions import (
|
|
25
38
|
List,
|
|
@@ -803,6 +816,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
|
|
|
803
816
|
timeout: float | Timeout | None
|
|
804
817
|
files: HttpxRequestFiles | None
|
|
805
818
|
idempotency_key: str
|
|
819
|
+
content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None]
|
|
806
820
|
json_data: Body
|
|
807
821
|
extra_json: AnyMapping
|
|
808
822
|
follow_redirects: bool
|
|
@@ -821,6 +835,7 @@ class FinalRequestOptions(pydantic.BaseModel):
|
|
|
821
835
|
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
|
|
822
836
|
follow_redirects: Union[bool, None] = None
|
|
823
837
|
|
|
838
|
+
content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None
|
|
824
839
|
# It should be noted that we cannot use `json` here as that would override
|
|
825
840
|
# a BaseModel method in an incompatible fashion.
|
|
826
841
|
json_data: Union[Body, None] = None
|
|
@@ -28,9 +28,11 @@ from typing import (
|
|
|
28
28
|
Mapping,
|
|
29
29
|
TypeVar,
|
|
30
30
|
Callable,
|
|
31
|
+
Iterable,
|
|
31
32
|
Iterator,
|
|
32
33
|
Optional,
|
|
33
34
|
Sequence,
|
|
35
|
+
AsyncIterable,
|
|
34
36
|
)
|
|
35
37
|
from typing_extensions import (
|
|
36
38
|
Set,
|
|
@@ -71,6 +73,13 @@ if TYPE_CHECKING:
|
|
|
71
73
|
else:
|
|
72
74
|
Base64FileInput = Union[IO[bytes], PathLike]
|
|
73
75
|
FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# Used for sending raw binary data / streaming data in request bodies
|
|
79
|
+
# e.g. for file uploads without multipart encoding
|
|
80
|
+
BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]]
|
|
81
|
+
AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]]
|
|
82
|
+
|
|
74
83
|
FileTypes = Union[
|
|
75
84
|
# file (or bytes)
|
|
76
85
|
FileContent,
|
|
@@ -26,6 +26,6 @@ __all__ = ["ImageConfig"]
|
|
|
26
26
|
class ImageConfig(BaseModel):
|
|
27
27
|
"""The configuration for image interaction."""
|
|
28
28
|
|
|
29
|
-
aspect_ratio: Optional[Literal["1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", "21:9"]] = None
|
|
29
|
+
aspect_ratio: Optional[Literal["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]] = None
|
|
30
30
|
|
|
31
31
|
image_size: Optional[Literal["1K", "2K", "4K"]] = None
|
|
@@ -25,6 +25,6 @@ __all__ = ["ImageConfigParam"]
|
|
|
25
25
|
class ImageConfigParam(TypedDict, total=False):
|
|
26
26
|
"""The configuration for image interaction."""
|
|
27
27
|
|
|
28
|
-
aspect_ratio: Literal["1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", "21:9"]
|
|
28
|
+
aspect_ratio: Literal["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]
|
|
29
29
|
|
|
30
30
|
image_size: Literal["1K", "2K", "4K"]
|
google/genai/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
google/genai/__init__.py,sha256=dIAk6AHhyy3b77cVKPvDyrZzkd9ibddrHZuieCq_eaA,756
|
|
2
2
|
google/genai/_adapters.py,sha256=Kok38miNYJff2n--l0zEK_hbq0y2rWOH7k75J7SMYbQ,1744
|
|
3
|
-
google/genai/_api_client.py,sha256=
|
|
3
|
+
google/genai/_api_client.py,sha256=E2HZwHDe2QEHh_fKM7IzJ79VoMA6fWhM87cnyolIdn8,68198
|
|
4
4
|
google/genai/_api_module.py,sha256=lj8eUWx8_LBGBz-49qz6_ywWm3GYp3d8Bg5JoOHbtbI,902
|
|
5
5
|
google/genai/_automatic_function_calling_util.py,sha256=xXNkJR-pzSMkeSXMz3Jw-kMHFbTJEiRJ3wocuwtWW4I,11627
|
|
6
6
|
google/genai/_base_transformers.py,sha256=wljA6m4tLl4XLGlBC2DNOls5N9-X9tffBq0M7i8jgpw,1034
|
|
@@ -34,21 +34,21 @@ google/genai/py.typed,sha256=RsMFoLwBkAvY05t6izop4UHZtqOPLiKp3GkIEizzmQY,40
|
|
|
34
34
|
google/genai/tokens.py,sha256=4BPW0gGWFeFVk3INkuY2tfREnsrvzQDhouvRI6_F9Q8,12235
|
|
35
35
|
google/genai/tunings.py,sha256=HNC3c_9MFwXDp-hcChvmDqkFinrD4kyLkNZPFiW72Tw,75536
|
|
36
36
|
google/genai/types.py,sha256=3QImav8ZsdiDTIJ0WXD3Zdt9lGFOa3QM1b8btB3IS0Y,654139
|
|
37
|
-
google/genai/version.py,sha256=
|
|
37
|
+
google/genai/version.py,sha256=H3kn3PFLP6OtMUhb44ZpK3GoCu4DYa2iZwmtsLpWtWI,627
|
|
38
38
|
google/genai/_interactions/__init__.py,sha256=Zl5wlyZ1be3a1ENIERjj9ocpELL89RdZkHF3MnCkB3M,3571
|
|
39
|
-
google/genai/_interactions/_base_client.py,sha256=
|
|
39
|
+
google/genai/_interactions/_base_client.py,sha256=9U2GjsnrAEmFEIEWIDylGX9P-c038S9TqzcK2FKoKTw,74460
|
|
40
40
|
google/genai/_interactions/_client.py,sha256=VkBifJIA0IchcNRUUb4E8w02udzmJMedYPXYnqX1iKc,21234
|
|
41
41
|
google/genai/_interactions/_client_adapter.py,sha256=QLQa352-22JgCa72uFo0UGzZr0v-BaTZ4yUVKCQ5LIU,1349
|
|
42
42
|
google/genai/_interactions/_compat.py,sha256=1HosuxO1kuZL6GwDmAoJD5kY999gjys4ifLdhXiJ4KI,7139
|
|
43
43
|
google/genai/_interactions/_constants.py,sha256=t7rpey7f7Z65WNYx8OzR-VGkTEHaz_WCLOREzHLjFhk,1039
|
|
44
44
|
google/genai/_interactions/_exceptions.py,sha256=XvtN0Ir69uwzlI9s-2gvXZJyDa3NZ0IqsMapC9nM8Bc,3825
|
|
45
45
|
google/genai/_interactions/_files.py,sha256=K7qgCZWoSaNI4RrdY1cUnNMXNF3Usq1IgCvzqwFgfMQ,4144
|
|
46
|
-
google/genai/_interactions/_models.py,sha256=
|
|
46
|
+
google/genai/_interactions/_models.py,sha256=zfKeV3VeGCG2J8Xieu7ClHwewEpQQdvLfDUn34ebxUQ,32711
|
|
47
47
|
google/genai/_interactions/_qs.py,sha256=ZaB5ZsbJnq0L7s-Y30_7k1jAVNAgcPAh45xa2xeE1GQ,5405
|
|
48
48
|
google/genai/_interactions/_resource.py,sha256=2SnZ1mvldUzurojYs_Pg_aItzP5A9WmhjjMCh_dXnCg,1773
|
|
49
49
|
google/genai/_interactions/_response.py,sha256=rJ8tQXfKYgFxjxML63XGSQuH_Su9OQfqGtw0ann1iT4,29507
|
|
50
50
|
google/genai/_interactions/_streaming.py,sha256=bjjyV9iuZxEOP0PaQGSA-_xIeK3Yuip2qb2tTqRkJn4,11016
|
|
51
|
-
google/genai/_interactions/_types.py,sha256=
|
|
51
|
+
google/genai/_interactions/_types.py,sha256=TjWdymD1c9FJG7ddPpyxhR-imYoYr5HHPeBqum3qt-s,8191
|
|
52
52
|
google/genai/_interactions/_version.py,sha256=HYUoiFQBODx2RJNZpIxeUnGFUe8Gc9FEO6tSeZQgO-I,668
|
|
53
53
|
google/genai/_interactions/_utils/__init__.py,sha256=fNs6SzzZLqVABQ0TgZ3z1LBri3iVIdtvKo0GcTiNXJM,2882
|
|
54
54
|
google/genai/_interactions/_utils/_compat.py,sha256=NfPeqV7YsaW2h40s7NODt-uOngiMLf9KboR0W-f64gU,1794
|
|
@@ -113,8 +113,8 @@ google/genai/_interactions/types/google_search_result.py,sha256=hrnggr-PKW-JwHk4
|
|
|
113
113
|
google/genai/_interactions/types/google_search_result_content.py,sha256=nMzuWYcj2QeBFLUiCx7IaaJDuSHlSO7ccB0l9WDGodc,1375
|
|
114
114
|
google/genai/_interactions/types/google_search_result_content_param.py,sha256=gcLR7zJUbqsIeXPLLjCQa27W3JR7LnDAyo-pZ-3DvB8,1379
|
|
115
115
|
google/genai/_interactions/types/google_search_result_param.py,sha256=MXdWoqxfKxP6tPEYWvmgHzg2xjXyT4AnkD_GjHe9rhg,1104
|
|
116
|
-
google/genai/_interactions/types/image_config.py,sha256=
|
|
117
|
-
google/genai/_interactions/types/image_config_param.py,sha256=
|
|
116
|
+
google/genai/_interactions/types/image_config.py,sha256=F_AmbfveRUyqAvsoVHFJOl37kJ571GjZNaAF1VOyxrg,1050
|
|
117
|
+
google/genai/_interactions/types/image_config_param.py,sha256=95qazepHwpzpZfsWaJKlLvKp-DS-AAEdtGO6CxLpYVA,1025
|
|
118
118
|
google/genai/_interactions/types/image_content.py,sha256=iS7zvC4PeLOQfBVS18r7YQ1Eap5hrBr43HT_7HuiOl8,1258
|
|
119
119
|
google/genai/_interactions/types/image_content_param.py,sha256=Qof1jfT9Ey83hI-l63gq-OSqsj1R4kaToN8C4dZFbb8,1527
|
|
120
120
|
google/genai/_interactions/types/image_mime_type.py,sha256=JSM0MElIy62mLFjKiuheHeV0px02I-Nrh8H2yZTDU3I,884
|
|
@@ -351,8 +351,8 @@ google/genai/tests/types/test_part_type.py,sha256=a_0eE2CgE7Ju6ePmu3DrupsZZCFiyD
|
|
|
351
351
|
google/genai/tests/types/test_schema_from_json_schema.py,sha256=WiraJx5mRLW8lKHiWsyHTBYge4jVpeCYklbqGd4BkZQ,13894
|
|
352
352
|
google/genai/tests/types/test_schema_json_schema.py,sha256=zn1gjsXcHTztzmajr8YX3Yb6rWnchjgjw6Yj1NZnG-0,15536
|
|
353
353
|
google/genai/tests/types/test_types.py,sha256=Tqc_PpGo9-XH1xfkAjTCM9xngan_4w__hgpA0BkyA8g,84416
|
|
354
|
-
google_genai-1.
|
|
355
|
-
google_genai-1.
|
|
356
|
-
google_genai-1.
|
|
357
|
-
google_genai-1.
|
|
358
|
-
google_genai-1.
|
|
354
|
+
google_genai-1.59.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
355
|
+
google_genai-1.59.0.dist-info/METADATA,sha256=v31Jclwt0khI19C_kozO_-tckmdfzoEQD_IG6mruQxU,53135
|
|
356
|
+
google_genai-1.59.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
357
|
+
google_genai-1.59.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
|
|
358
|
+
google_genai-1.59.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|