Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Veo 2 generate_videos support in Go SDK #474

Merged
merged 1 commit into from
Mar 24, 2025
Merged
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
16 changes: 8 additions & 8 deletions google/genai/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def _GenerateVideosOperation_from_vertex(

class Operations(_api_module.BaseModule):

def _get_operation(
def _get_videos_operation(
self,
*,
operation_name: str,
Expand Down Expand Up @@ -385,7 +385,7 @@ def _get_operation(
self._api_client._verify_response(return_value)
return return_value

def _fetch_predict_operation(
def _fetch_predict_videos_operation(
self,
*,
operation_name: str,
Expand Down Expand Up @@ -481,21 +481,21 @@ def get(
fetch_operation_config = types.FetchPredictOperationConfig(
http_options=http_options
)
return self._fetch_predict_operation(
return self._fetch_predict_videos_operation(
operation_name=operation_name,
resource_name=resource_name,
config=fetch_operation_config,
)
else:
return self._get_operation(
return self._get_videos_operation(
operation_name=operation_name,
config=config,
)


class AsyncOperations(_api_module.BaseModule):

async def _get_operation(
async def _get_videos_operation(
self,
*,
operation_name: str,
Expand Down Expand Up @@ -561,7 +561,7 @@ async def _get_operation(
self._api_client._verify_response(return_value)
return return_value

async def _fetch_predict_operation(
async def _fetch_predict_videos_operation(
self,
*,
operation_name: str,
Expand Down Expand Up @@ -655,13 +655,13 @@ async def get(
fetch_operation_config = types.FetchPredictOperationConfig(
http_options=http_options
)
return await self._fetch_predict_operation(
return await self._fetch_predict_videos_operation(
operation_name=operation_name,
resource_name=resource_name,
config=fetch_operation_config,
)
else:
return await self._get_operation(
return await self._get_videos_operation(
operation_name=operation_name,
config=config,
)
2 changes: 1 addition & 1 deletion google/genai/tests/models/test_generate_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
),
),
exception_if_mldev=(
"output_gcs_uri parameter is not supported in Gemini API"
"not supported in Gemini API"
),
),
pytest_helper.TestTableItem(
Expand Down
18 changes: 2 additions & 16 deletions google/genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5433,14 +5433,7 @@ class GenerateVideosResponseDict(TypedDict, total=False):


class GenerateVideosOperation(_common.BaseModel):
"""A video generation operation.

Use the following code to refresh the operation:

```
operation = client.operations.get(operation)
```
"""
"""A video generation operation."""

name: Optional[str] = Field(
default=None,
Expand Down Expand Up @@ -5468,14 +5461,7 @@ class GenerateVideosOperation(_common.BaseModel):


class GenerateVideosOperationDict(TypedDict, total=False):
"""A video generation operation.

Use the following code to refresh the operation:

```
operation = client.operations.get(operation)
```
"""
"""A video generation operation."""

name: Optional[str]
"""The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`."""
Expand Down