google-genai 0.6.0__py3-none-any.whl → 0.8.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 +74 -82
- google/genai/_api_module.py +24 -0
- google/genai/_automatic_function_calling_util.py +43 -22
- google/genai/_common.py +11 -8
- google/genai/_extra_utils.py +22 -16
- google/genai/_operations.py +365 -0
- google/genai/_replay_api_client.py +7 -2
- google/genai/_test_api_client.py +1 -1
- google/genai/_transformers.py +218 -97
- google/genai/batches.py +194 -155
- google/genai/caches.py +117 -134
- google/genai/chats.py +22 -18
- google/genai/client.py +31 -37
- google/genai/files.py +154 -183
- google/genai/live.py +11 -5
- google/genai/models.py +506 -254
- google/genai/tunings.py +85 -422
- google/genai/types.py +647 -458
- google/genai/version.py +1 -1
- {google_genai-0.6.0.dist-info → google_genai-0.8.0.dist-info}/METADATA +119 -70
- google_genai-0.8.0.dist-info/RECORD +27 -0
- google_genai-0.6.0.dist-info/RECORD +0 -25
- {google_genai-0.6.0.dist-info → google_genai-0.8.0.dist-info}/LICENSE +0 -0
- {google_genai-0.6.0.dist-info → google_genai-0.8.0.dist-info}/WHEEL +0 -0
- {google_genai-0.6.0.dist-info → google_genai-0.8.0.dist-info}/top_level.txt +0 -0
google/genai/client.py
CHANGED
@@ -149,49 +149,43 @@ class Client:
|
|
149
149
|
):
|
150
150
|
"""Initializes the client.
|
151
151
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
only.
|
179
|
-
debug_config (DebugConfig):
|
180
|
-
Config settings that control network
|
181
|
-
behavior of the client. This is typically used when running test code.
|
182
|
-
http_options (Union[HttpOptions, HttpOptionsDict]):
|
183
|
-
Http options to use for the client. Response_payload can't be
|
184
|
-
set when passing to the client constructor.
|
152
|
+
Args:
|
153
|
+
vertexai (bool): Indicates whether the client should use the Vertex AI
|
154
|
+
API endpoints. Defaults to False (uses Gemini Developer API endpoints).
|
155
|
+
Applies to the Vertex AI API only.
|
156
|
+
api_key (str): The `API key
|
157
|
+
<https://ai.google.dev/gemini-api/docs/api-key>`_ to use for
|
158
|
+
authentication. Applies to the Gemini Developer API only.
|
159
|
+
credentials (google.auth.credentials.Credentials): The credentials to use
|
160
|
+
for authentication when calling the Vertex AI APIs. Credentials can be
|
161
|
+
obtained from environment variables and default credentials. For more
|
162
|
+
information, see `Set up Application Default Credentials
|
163
|
+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_.
|
164
|
+
Applies to the Vertex AI API only.
|
165
|
+
project (str): The `Google Cloud project ID
|
166
|
+
<https://cloud.google.com/vertex-ai/docs/start/cloud-environment>`_ to
|
167
|
+
use for quota. Can be obtained from environment variables (for example,
|
168
|
+
``GOOGLE_CLOUD_PROJECT``). Applies to the Vertex AI API only.
|
169
|
+
location (str): The `location
|
170
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations>`_
|
171
|
+
to send API requests to (for example, ``us-central1``). Can be obtained
|
172
|
+
from environment variables. Applies to the Vertex AI API only.
|
173
|
+
debug_config (DebugConfig): Config settings that control network behavior
|
174
|
+
of the client. This is typically used when running test code.
|
175
|
+
http_options (Union[HttpOptions, HttpOptionsDict]): Http options to use
|
176
|
+
for the client. The field deprecated_response_payload should not be set
|
177
|
+
in http_options.
|
185
178
|
"""
|
186
179
|
|
187
180
|
self._debug_config = debug_config or DebugConfig()
|
188
181
|
|
189
|
-
# Throw ValueError if
|
190
|
-
# unpredictable behavior when running multiple coroutines through
|
182
|
+
# Throw ValueError if deprecated_response_payload is set in http_options
|
183
|
+
# due to unpredictable behavior when running multiple coroutines through
|
191
184
|
# client.aio.
|
192
|
-
if http_options and '
|
185
|
+
if http_options and 'deprecated_response_payload' in http_options:
|
193
186
|
raise ValueError(
|
194
|
-
'Setting
|
187
|
+
'Setting deprecated_response_payload in http_options is not'
|
188
|
+
' supported.'
|
195
189
|
)
|
196
190
|
|
197
191
|
self._api_client = self._get_api_client(
|