Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Googleapis Python genai Operations Converters

From Leeroopedia
Knowledge Sources
Domains Data_Transformation, Long_Running_Operations
Last Updated 2026-02-15 14:00 GMT

Overview

Concrete tool for converting long-running operation objects between ML Dev and Vertex AI formats.

Description

The _operations_converters module contains code-generated converter functions for operation-related types including GenerateVideosOperation, GenerateVideosResponse, GeneratedVideo, Video, GetOperationParameters, and FetchPredictOperationParameters. Each has ML Dev and Vertex AI format variants.

Usage

Internal infrastructure. Called automatically when polling long-running operations (e.g., video generation) based on the configured backend.

Code Reference

Source Location

Signature

def _GenerateVideosOperation_from_mldev(from_object: Union[dict, object], parent_object: Optional[dict] = None) -> dict[str, Any]: ...
def _GenerateVideosOperation_from_vertex(from_object: Union[dict, object], parent_object: Optional[dict] = None) -> dict[str, Any]: ...
def _GenerateVideosResponse_from_mldev(from_object: Union[dict, object], parent_object: Optional[dict] = None) -> dict[str, Any]: ...
def _Video_from_mldev(from_object: Union[dict, object], parent_object: Optional[dict] = None) -> dict[str, Any]: ...
def _GetOperationParameters_to_mldev(from_object: Union[dict, object], parent_object: Optional[dict] = None) -> dict[str, Any]: ...

Import

from google.genai import _operations_converters

I/O Contract

Inputs

Name Type Required Description
from_object dict or object Yes Source operation object to convert
parent_object dict No Parent context for nested conversion

Outputs

Name Type Description
returns dict[str, Any] Converted operation object in target API format

Usage Examples

# Internal usage - called automatically during LRO polling
from google.genai._operations_converters import _GenerateVideosOperation_from_mldev

# Convert a raw API response to SDK format
operation = _GenerateVideosOperation_from_mldev(raw_response)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment