Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions google/genai/file_search_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ def upload_to_file_search_store(
binary mode. In other words, do not use non-blocking mode or text mode.
The given stream must be seekable, that is, it must be able to call
`seek()` on 'path'.
config: Optional parameters to set `diplay_name`, `mime_type`, and others.
config: Optional parameters to set `display_name`, `mime_type`, and
others.
"""
if self._api_client.vertexai:
raise ValueError(
Expand Down Expand Up @@ -839,7 +840,7 @@ def upload_to_file_search_store(
)
):
raise KeyError(
'Failed to upload file to file search store. Upload URL did not'
'Failed to upload file to file search store. Upload URL was not'
' returned from the upload request.'
)
elif 'x-goog-upload-url' in response.sdk_http_response.headers:
Expand Down Expand Up @@ -1432,7 +1433,7 @@ async def upload_to_file_search_store(
binary mode. In other words, do not use non-blocking mode or text mode.
The given stream must be seekable, that is, it must be able to call
`seek()` on 'path'.
config: Optional parameters to set `diplay_name`, `mime_type` and others.
config: Optional parameters to set `display_name`, `mime_type` and others.
"""
if self._api_client.vertexai:
raise ValueError(
Expand Down Expand Up @@ -1468,7 +1469,7 @@ async def upload_to_file_search_store(
)
):
raise KeyError(
'Failed to upload file to file search store. Upload URL did not'
'Failed to upload file to file search store. Upload URL was not'
' returned from the upload request.'
)
elif 'x-goog-upload-url' in response.sdk_http_response.headers:
Expand Down
12 changes: 7 additions & 5 deletions google/genai/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ def upload(
binary mode. In other words, do not use non-blocking mode or text mode.
The given stream must be seekable, that is, it must be able to call
`seek()` on 'path'.
config: Optional parameters to set `diplay_name`, `mime_type`, and `name`.
config: Optional parameters to set `display_name`, `mime_type`, and
`name`.
"""
if self._api_client.vertexai:
raise ValueError(
Expand Down Expand Up @@ -630,7 +631,7 @@ def upload(
or 'x-goog-upload-url' not in response.sdk_http_response.headers
):
raise KeyError(
'Failed to create file. Upload URL did not returned from the create'
'Failed to create file. Upload URL was not returned from the create'
' file request.'
)
upload_url = response.sdk_http_response.headers['x-goog-upload-url']
Expand Down Expand Up @@ -1207,7 +1208,8 @@ async def upload(
binary mode. In other words, do not use non-blocking mode or text mode.
The given stream must be seekable, that is, it must be able to call
`seek()` on 'path'.
config: Optional parameters to set `diplay_name`, `mime_type`, and `name`.
config: Optional parameters to set `display_name`, `mime_type`, and
`name`.
"""
if self._api_client.vertexai:
raise ValueError(
Expand Down Expand Up @@ -1251,7 +1253,7 @@ async def upload(
)
):
raise KeyError(
'Failed to create file. Upload URL did not returned from the create'
'Failed to create file. Upload URL was not returned from the create'
' file request.'
)
elif 'x-goog-upload-url' in response.sdk_http_response.headers:
Expand Down Expand Up @@ -1282,7 +1284,7 @@ async def download(
) -> bytes:
"""Downloads a file's data from the file service.

The Gemini Enterprise Agent Platform implementation of the API foes not
The Gemini Enterprise Agent Platform implementation of the API does not
include the file service.

Files created by `upload` can't be downloaded. You can tell which files are
Expand Down
20 changes: 10 additions & 10 deletions google/genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -17444,7 +17444,7 @@ class InlinedEmbedContentResponseDict(TypedDict, total=False):


class BatchJobDestination(_common.BaseModel):
"""Config for `des` parameter."""
"""Config for `dest` parameter."""

format: Optional[str] = Field(
default=None,
Expand Down Expand Up @@ -17495,7 +17495,7 @@ class BatchJobDestination(_common.BaseModel):


class BatchJobDestinationDict(TypedDict, total=False):
"""Config for `des` parameter."""
"""Config for `dest` parameter."""

format: Optional[str]
"""Storage format of the output files. Must be one of:
Expand Down Expand Up @@ -19591,9 +19591,9 @@ class LiveServerSessionResumptionUpdate(_common.BaseModel):
default=None,
description="""Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.

Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResmumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).
Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).

Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames arelikely not needed.""",
Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames are likely not needed.""",
)


Expand All @@ -19612,9 +19612,9 @@ class LiveServerSessionResumptionUpdateDict(TypedDict, total=False):
last_consumed_client_message_index: Optional[int]
"""Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.

Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResmumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).
Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).

Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames arelikely not needed."""
Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames are likely not needed."""


LiveServerSessionResumptionUpdateOrDict = Union[
Expand Down Expand Up @@ -21748,7 +21748,7 @@ class UserContent(Content):
- Create a user Content object with a string:
user_content = UserContent("Why is the sky blue?")
- Create a user Content object with a file data Part object:
user_content = UserContent(Part.from_uri(file_uril="gs://bucket/file.txt",
user_content = UserContent(Part.from_uri(file_uri="gs://bucket/file.txt",
mime_type="text/plain"))
- Create a user Content object with byte data Part object:
user_content = UserContent(Part.from_bytes(data=b"Hello, World!",
Expand Down Expand Up @@ -21778,7 +21778,7 @@ class ModelContent(Content):
- Create a model Content object with a string:
model_content = ModelContent("Why is the sky blue?")
- Create a model Content object with a file data Part object:
model_content = ModelContent(Part.from_uri(file_uril="gs://bucket/file.txt",
model_content = ModelContent(Part.from_uri(file_uri="gs://bucket/file.txt",
mime_type="text/plain"))
- Create a model Content object with byte data Part object:
model_content = ModelContent(Part.from_bytes(data=b"Hello, World!",
Expand Down Expand Up @@ -22284,7 +22284,7 @@ class LLMBasedMetricSpecDict(TypedDict, total=False):


class CustomCodeExecutionSpec(_common.BaseModel):
"""Specificies a metric that is computed by running user-defined Python functions remotely."""
"""Specifies a metric that is computed by running user-defined Python functions remotely."""

evaluation_function: Optional[str] = Field(
default=None,
Expand All @@ -22298,7 +22298,7 @@ def evaluate(instance: dict[str, Any]) -> float:


class CustomCodeExecutionSpecDict(TypedDict, total=False):
"""Specificies a metric that is computed by running user-defined Python functions remotely."""
"""Specifies a metric that is computed by running user-defined Python functions remotely."""

evaluation_function: Optional[str]
"""A string representing a user-defined function for evaluation.
Expand Down
Loading