sdkagent

python-genai API reference

251 public APIs from python-genai (googleapis/python-genai) — 176 classes, 26 functions, 49 methods. Signatures extracted by static analysis of the actual source.

Repository: googleapis/python-genai

KindCount
Classes176
Functions26
Methods49

API list

classgoogle.genai._adapters.McpToGenAiToolAdapter
Adapter for working with MCP tools in a GenAI client.
methodgoogle.genai._adapters.McpToGenAiToolAdapter.call_tool(function_call:FunctionCall) -> 'mcp_types.CallToolResult'
Calls a function on the MCP server.
methodgoogle.genai._adapters.McpToGenAiToolAdapter.tools() -> list[Tool]
Returns a list of Google GenAI tools.
classgoogle.genai._api_client.AsyncHttpxClient
Async httpx client.
classgoogle.genai._api_client.BaseApiClient
Client for calling HTTP APIs sending and receiving JSON.
methodgoogle.genai._api_client.BaseApiClient.aclose() -> None
Closes the API async client.
methodgoogle.genai._api_client.BaseApiClient.async_download_file(path:str, *http_options:Optional[HttpOptionsOrDict]=None) -> Union[Any, bytes]
Downloads the file data.
methodgoogle.genai._api_client.BaseApiClient.close() -> None
Closes the API client.
methodgoogle.genai._api_client.BaseApiClient.download_file(path:str, *http_options:Optional[HttpOptionsOrDict]=None) -> Union[Any, bytes]
Downloads the file data.
methodgoogle.genai._api_client.BaseApiClient.upload_file(file_path:Union[str, io.IOBase], upload_url:str, upload_size:int, *http_options:Optional[HttpOptionsOrDict]=None) -> HttpResponse
Transfers a file to the given URL.
classgoogle.genai._api_client.EphemeralTokenAPIKeyError
Error raised when the API key is invalid.
classgoogle.genai._api_client.SyncHttpxClient
Sync httpx client.
funcgoogle.genai._api_client.append_library_version_headers(headers:dict[str, str]) -> None
Appends the telemetry header to the headers dict.
funcgoogle.genai._api_client.get_timeout_in_seconds(timeout:Optional[Union[float, int]]) -> Optional[float]
Converts the timeout to seconds.
funcgoogle.genai._api_client.load_auth(*project:Union[str, None]) -> Tuple[Credentials, str]
Loads google auth credentials and project id.
funcgoogle.genai._api_client.retry_args(options:Optional[HttpRetryOptions]) -> _common.StringDict
Returns the retry args for the given http retry options.
classgoogle.genai._common.CaseInSensitiveEnum
Case insensitive enum.
classgoogle.genai._common.ExperimentalWarning
Warning for experimental features.
funcgoogle.genai._common.convert_to_dict(obj:object, convert_keys:bool=False) -> Any
Recursively converts a given object to a dictionary.
funcgoogle.genai._common.experimental_warning(message:str) -> Callable[[Callable[..., Any]], Callable[..., Any]]
Experimental warning, only warns once.
funcgoogle.genai._common.maybe_snake_to_camel(snake_str:str, convert:bool=True) -> str
Converts a snake_case string to CamelCase, if convert is True.
funcgoogle.genai._common.move_value_by_path(data:Any, paths:dict[str, str]) -> None
Moves values from source paths to destination paths.
funcgoogle.genai._common.timestamped_unique_name() -> str
Composes a timestamped unique name.
funcgoogle.genai._extra_utils.get_usage_header(config:Optional[Union[dict[str, Any], C]], config_cls:Type[C], usage:str) -> C
Returns the usage header for the config.
classgoogle.genai._gaos._hooks.types.AfterParseErrorContext
Context for `AfterParseErrorHook`.
methodgoogle.genai._gaos.agents.Agents.delete(id:str, *api_version:Optional[str]=None, *extra_headers:Optional[Mapping[str, str]]=None, *extra_query:Optional[Mapping[str, Any]]=None, *timeout:Optional[Union[float, httpx.Timeout]]=None) -> interactions.Empty
Deletes an Agent.
methodgoogle.genai._gaos.agents.Agents.get(id:str, *api_version:Optional[str]=None, *extra_headers:Optional[Mapping[str, str]]=None, *extra_query:Optional[Mapping[str, Any]]=None, *timeout:Optional[Union[float, httpx.Timeout]]=None) -> agents.Agent
Gets a specific Agent.
classgoogle.genai._gaos.errors.cancelinteractionbyid.CancelInteractionByIDClientError
Error cancelling interaction
classgoogle.genai._gaos.errors.cancelinteractionbyid.CancelInteractionByIDServerError
Error cancelling interaction
classgoogle.genai._gaos.errors.createinteraction.CreateInteractionClientError
Error creating interaction
classgoogle.genai._gaos.errors.createinteraction.CreateInteractionServerError
Error creating interaction
classgoogle.genai._gaos.errors.deleteinteraction.DeleteInteractionClientError
Error deleting interaction
classgoogle.genai._gaos.errors.deleteinteraction.DeleteInteractionServerError
Error deleting interaction
classgoogle.genai._gaos.errors.genaidefaulterror.GenAiDefaultError
The fallback error class if no more specific error class is matched.
classgoogle.genai._gaos.errors.genaierror.GenAiError
The base class for all HTTP error responses.
classgoogle.genai._gaos.errors.getinteractionbyid.GetInteractionByIDClientError
Error getting interaction
classgoogle.genai._gaos.errors.getinteractionbyid.GetInteractionByIDServerError
Error getting interaction
classgoogle.genai._gaos.google_genai.GeminiNextGenAgents
Public agents resource backed by the NextGen client.
classgoogle.genai._gaos.lib.compat_errors.APIError
General errors raised by the GenAI API.
classgoogle.genai._gaos.lib.compat_errors.GeminiNextGenAPIClientError
Root of the GenAI error hierarchy.
funcgoogle.genai._gaos.lib.compat_errors.async_wrap_sdk_call(fn:Callable[..., Awaitable[T]], *args:Any, **kwargs:Any) -> T
Async variant of `wrap_sdk_call`.
funcgoogle.genai._gaos.lib.compat_errors.is_stream(obj:Any) -> bool
True if `obj` is a live SSE `Stream` / `AsyncStream`.
funcgoogle.genai._gaos.lib.compat_errors.wrap_async_stream_errors(stream:AsyncStream[Any]) -> AsyncStream[Any]
Async variant of `wrap_stream_errors`.
classgoogle.genai._gaos.types.agents.agent.Agent
An agent definition for the CreateAgent API.
classgoogle.genai._gaos.types.agents.agent.AgentParam
An agent definition for the CreateAgent API.
classgoogle.genai._gaos.types.agents.agenttool.UnknownAgentTool
A AgentTool variant the SDK doesn't recognize.
funcgoogle.genai._gaos.types.base64fileinput.encode_base64_file_input(value:Any) -> Any
Convert PathLike or IO[bytes] inputs to a base64 string.
classgoogle.genai._gaos.types.environments.createenvironmentrequest.CreateEnvironmentRequest
Request for `CreateEnvironment`.
classgoogle.genai._gaos.types.environments.createenvironmentrequest.CreateEnvironmentRequestParam
Request for `CreateEnvironment`.
classgoogle.genai._gaos.types.environments.environment.Environment
An execution environment for an agent.
classgoogle.genai._gaos.types.environments.environment.EnvironmentTypedDict
An execution environment for an agent.
classgoogle.genai._gaos.types.environments.listenvironmentsresponse.ListEnvironmentsResponse
Response for `ListEnvironments`.
classgoogle.genai._gaos.types.environments.listenvironmentsresponse.ListEnvironmentsResponseTypedDict
Response for `ListEnvironments`.
classgoogle.genai._gaos.types.interactions.allowedtools.AllowedTools
The configuration for allowed tools.
classgoogle.genai._gaos.types.interactions.allowedtools.AllowedToolsParam
The configuration for allowed tools.
classgoogle.genai._gaos.types.interactions.annotation.UnknownAnnotation
A Annotation variant the SDK doesn't recognize.
classgoogle.genai._gaos.types.interactions.audiocontent.AudioContent
An audio content block.
classgoogle.genai._gaos.types.interactions.audiocontent.AudioContentParam
An audio content block.
classgoogle.genai._gaos.types.interactions.audioresponseformat.AudioResponseFormat
Configuration for audio output format.
classgoogle.genai._gaos.types.interactions.audioresponseformat.AudioResponseFormatParam
Configuration for audio output format.
classgoogle.genai._gaos.types.interactions.codeexecutioncallstep.CodeExecutionCallStep
Code execution call step.
classgoogle.genai._gaos.types.interactions.codeexecutioncallstep.CodeExecutionCallStepParam
Code execution call step.
classgoogle.genai._gaos.types.interactions.codeexecutionresultstep.CodeExecutionResultStep
Code execution result step.
classgoogle.genai._gaos.types.interactions.codeexecutionresultstep.CodeExecutionResultStepParam
Code execution result step.
classgoogle.genai._gaos.types.interactions.codemenderagentconfig.CodeMenderAgentConfig
Configuration for the CodeMender agent.
classgoogle.genai._gaos.types.interactions.codemenderagentconfig.CodeMenderAgentConfigParam
Configuration for the CodeMender agent.
classgoogle.genai._gaos.types.interactions.content.UnknownContent
A Content variant the SDK doesn't recognize.
classgoogle.genai._gaos.types.interactions.documentcontent.DocumentContent
A document content block.
classgoogle.genai._gaos.types.interactions.documentcontent.DocumentContentParam
A document content block.
classgoogle.genai._gaos.types.interactions.dynamicagentconfig.DynamicAgentConfig
Configuration for dynamic agents.
classgoogle.genai._gaos.types.interactions.dynamicagentconfig.DynamicAgentConfigParam
Configuration for dynamic agents.
classgoogle.genai._gaos.types.interactions.environment.Environment
Configuration for a custom environment.
classgoogle.genai._gaos.types.interactions.environment.EnvironmentParam
Configuration for a custom environment.
classgoogle.genai._gaos.types.interactions.error.Error
Error message from an interaction.
classgoogle.genai._gaos.types.interactions.error.ErrorTypedDict
Error message from an interaction.
classgoogle.genai._gaos.types.interactions.filecitation.FileCitation
A file citation annotation.
classgoogle.genai._gaos.types.interactions.filecitation.FileCitationParam
A file citation annotation.
classgoogle.genai._gaos.types.interactions.filecontent.FileContent
Content of a single file in the codebase.
classgoogle.genai._gaos.types.interactions.filecontent.FileContentParam
Content of a single file in the codebase.
classgoogle.genai._gaos.types.interactions.filesearchcallstep.FileSearchCallStep
File Search call step.
classgoogle.genai._gaos.types.interactions.filesearchcallstep.FileSearchCallStepParam
File Search call step.
classgoogle.genai._gaos.types.interactions.filesearchresult.FileSearchResult
The result of the File Search.
classgoogle.genai._gaos.types.interactions.filesearchresult.FileSearchResultTypedDict
The result of the File Search.
classgoogle.genai._gaos.types.interactions.filesearchresultstep.FileSearchResultStep
File Search result step.
classgoogle.genai._gaos.types.interactions.filesearchresultstep.FileSearchResultStepParam
File Search result step.
classgoogle.genai._gaos.types.interactions.filter_.Filter
Config for filters.
classgoogle.genai._gaos.types.interactions.filter_.FilterParam
Config for filters.
classgoogle.genai._gaos.types.interactions.function.Function
A tool that can be used by the model.
classgoogle.genai._gaos.types.interactions.function.FunctionParam
A tool that can be used by the model.
classgoogle.genai._gaos.types.interactions.functioncallstep.FunctionCallStep
A function tool call step.
classgoogle.genai._gaos.types.interactions.functioncallstep.FunctionCallStepParam
A function tool call step.
classgoogle.genai._gaos.types.interactions.functionresultstep.FunctionResultStep
Result of a function tool call.
classgoogle.genai._gaos.types.interactions.functionresultstep.FunctionResultStepParam
Result of a function tool call.
classgoogle.genai._gaos.types.interactions.googlemapscallstep.GoogleMapsCallStep
Google Maps call step.
classgoogle.genai._gaos.types.interactions.googlemapscallstep.GoogleMapsCallStepParam
Google Maps call step.
classgoogle.genai._gaos.types.interactions.googlemapsresult.GoogleMapsResult
The result of the Google Maps.
classgoogle.genai._gaos.types.interactions.googlemapsresult.GoogleMapsResultParam
The result of the Google Maps.
classgoogle.genai._gaos.types.interactions.googlemapsresultstep.GoogleMapsResultStep
Google Maps result step.
classgoogle.genai._gaos.types.interactions.googlemapsresultstep.GoogleMapsResultStepParam
Google Maps result step.
classgoogle.genai._gaos.types.interactions.googlesearchcallarguments.GoogleSearchCallArguments
The arguments to pass to Google Search.
classgoogle.genai._gaos.types.interactions.googlesearchcallstep.GoogleSearchCallStep
Google Search call step.
classgoogle.genai._gaos.types.interactions.googlesearchcallstep.GoogleSearchCallStepParam
Google Search call step.
classgoogle.genai._gaos.types.interactions.googlesearchresult.GoogleSearchResult
The result of the Google Search.
classgoogle.genai._gaos.types.interactions.googlesearchresult.GoogleSearchResultParam
The result of the Google Search.
classgoogle.genai._gaos.types.interactions.googlesearchresultstep.GoogleSearchResultStep
Google Search result step.
classgoogle.genai._gaos.types.interactions.googlesearchresultstep.GoogleSearchResultStepParam
Google Search result step.
classgoogle.genai._gaos.types.interactions.groundingtoolcount.GroundingToolCount
The number of grounding tool counts.
classgoogle.genai._gaos.types.interactions.groundingtoolcount.GroundingToolCountTypedDict
The number of grounding tool counts.
classgoogle.genai._gaos.types.interactions.hybridsearch.HybridSearch
Config for Hybrid Search.
classgoogle.genai._gaos.types.interactions.hybridsearch.HybridSearchParam
Config for Hybrid Search.
classgoogle.genai._gaos.types.interactions.imageconfig.ImageConfig
The configuration for image interaction.
classgoogle.genai._gaos.types.interactions.imageconfig.ImageConfigParam
The configuration for image interaction.
classgoogle.genai._gaos.types.interactions.imagecontent.ImageContent
An image content block.
classgoogle.genai._gaos.types.interactions.imagecontent.ImageContentParam
An image content block.
classgoogle.genai._gaos.types.interactions.imageresponseformat.ImageResponseFormat
Configuration for image output format.
classgoogle.genai._gaos.types.interactions.imageresponseformat.ImageResponseFormatParam
Configuration for image output format.
classgoogle.genai._gaos.types.interactions.interaction.Interaction
The Interaction resource.
classgoogle.genai._gaos.types.interactions.interaction.InteractionTypedDict
The Interaction resource.
classgoogle.genai._gaos.types.interactions.mcpservertoolcallstep.MCPServerToolCallStep
MCPServer tool call step.
classgoogle.genai._gaos.types.interactions.mcpservertoolcallstep.MCPServerToolCallStepParam
MCPServer tool call step.
classgoogle.genai._gaos.types.interactions.mcpservertoolresultstep.MCPServerToolResultStep
MCPServer tool result step.
classgoogle.genai._gaos.types.interactions.mcpservertoolresultstep.MCPServerToolResultStepParam
MCPServer tool result step.
classgoogle.genai._gaos.types.interactions.modeloutputstep.ModelOutputStep
Output generated by the model.
classgoogle.genai._gaos.types.interactions.modeloutputstep.ModelOutputStepParam
Output generated by the model.
classgoogle.genai._gaos.types.interactions.placecitation.PlaceCitation
A place citation annotation.
classgoogle.genai._gaos.types.interactions.placecitation.PlaceCitationParam
A place citation annotation.
classgoogle.genai._gaos.types.interactions.ragresource.RagResource
The definition of the Rag resource.
classgoogle.genai._gaos.types.interactions.ragresource.RagResourceParam
The definition of the Rag resource.
classgoogle.genai._gaos.types.interactions.ragretrievalconfig.RagRetrievalConfig
Specifies the context retrieval config.
classgoogle.genai._gaos.types.interactions.ragretrievalconfig.RagRetrievalConfigParam
Specifies the context retrieval config.
classgoogle.genai._gaos.types.interactions.ragstoreconfig.RagStoreConfig
Use to specify configuration for RAG Store.
classgoogle.genai._gaos.types.interactions.ragstoreconfig.RagStoreConfigParam
Use to specify configuration for RAG Store.
classgoogle.genai._gaos.types.interactions.ranking.Ranking
Config for Rank Service.
classgoogle.genai._gaos.types.interactions.ranking.RankingParam
Config for Rank Service.
classgoogle.genai._gaos.types.interactions.retrievalcallarguments.RetrievalCallArguments
The arguments to pass to Retrieval tools.
classgoogle.genai._gaos.types.interactions.sessionconfig.SessionConfig
The configuration of CodeMender sessions.
classgoogle.genai._gaos.types.interactions.sessionconfig.SessionConfigParam
The configuration of CodeMender sessions.
classgoogle.genai._gaos.types.interactions.source.Source
A source to be mounted into the environment.
classgoogle.genai._gaos.types.interactions.source.SourceParam
A source to be mounted into the environment.
classgoogle.genai._gaos.types.interactions.speechconfig.SpeechConfig
The configuration for speech interaction.
classgoogle.genai._gaos.types.interactions.speechconfig.SpeechConfigParam
The configuration for speech interaction.
classgoogle.genai._gaos.types.interactions.step.UnknownStep
A Step variant the SDK doesn't recognize.
classgoogle.genai._gaos.types.interactions.textcontent.TextContent
A text content block.
classgoogle.genai._gaos.types.interactions.textcontent.TextContentParam
A text content block.
classgoogle.genai._gaos.types.interactions.textresponseformat.TextResponseFormat
Configuration for text output format.
classgoogle.genai._gaos.types.interactions.textresponseformat.TextResponseFormatParam
Configuration for text output format.
classgoogle.genai._gaos.types.interactions.thoughtstep.ThoughtStep
A thought step.
classgoogle.genai._gaos.types.interactions.thoughtstep.ThoughtStepParam
A thought step.
classgoogle.genai._gaos.types.interactions.tool.UnknownTool
A Tool variant the SDK doesn't recognize.
classgoogle.genai._gaos.types.interactions.urlcitation.URLCitation
A URL citation annotation.
classgoogle.genai._gaos.types.interactions.urlcitation.URLCitationParam
A URL citation annotation.
classgoogle.genai._gaos.types.interactions.urlcontextcallstep.URLContextCallStep
URL context call step.
classgoogle.genai._gaos.types.interactions.urlcontextcallstep.URLContextCallStepParam
URL context call step.
classgoogle.genai._gaos.types.interactions.urlcontextresult.URLContextResult
The result of the URL context.
classgoogle.genai._gaos.types.interactions.urlcontextresult.URLContextResultParam
The result of the URL context.
classgoogle.genai._gaos.types.interactions.urlcontextresultstep.URLContextResultStep
URL context result step.
classgoogle.genai._gaos.types.interactions.urlcontextresultstep.URLContextResultStepParam
URL context result step.
classgoogle.genai._gaos.types.interactions.usage.Usage
Statistics on the interaction request's token usage.
classgoogle.genai._gaos.types.interactions.userinputstep.UserInputStep
Input provided by the user.
classgoogle.genai._gaos.types.interactions.userinputstep.UserInputStepParam
Input provided by the user.
classgoogle.genai._gaos.types.interactions.videoconfig.VideoConfig
Configuration options for video generation.
classgoogle.genai._gaos.types.interactions.videoconfig.VideoConfigParam
Configuration options for video generation.
classgoogle.genai._gaos.types.interactions.videocontent.VideoContent
A video content block.
classgoogle.genai._gaos.types.interactions.videocontent.VideoContentParam
A video content block.
classgoogle.genai._gaos.types.interactions.videoresponseformat.VideoResponseFormat
Configuration for video output format.
classgoogle.genai._gaos.types.interactions.videoresponseformat.VideoResponseFormatParam
Configuration for video output format.
classgoogle.genai._gaos.types.interactions.wordinfo.WordInfo
Word-level ASR annotation for transcription output.
classgoogle.genai._gaos.types.triggers.triggercreateparams.TriggerCreateParams
Parameters for creating a trigger.
classgoogle.genai._gaos.types.triggers.triggercreateparams.TriggerCreateParamsParam
Parameters for creating a trigger.
classgoogle.genai._gaos.types.triggers.triggerexecution.TriggerExecution
An execution instance of a trigger.
classgoogle.genai._gaos.types.triggers.triggerexecution.TriggerExecutionTypedDict
An execution instance of a trigger.
classgoogle.genai._gaos.types.webhooks.webhook.Webhook
A Webhook resource.
classgoogle.genai._gaos.types.webhooks.webhook.WebhookInput
A Webhook resource.
classgoogle.genai._gaos.types.webhooks.webhook.WebhookInputParam
A Webhook resource.
classgoogle.genai._gaos.types.webhooks.webhook.WebhookTypedDict
A Webhook resource.
funcgoogle.genai._gaos.utils.annotations.get_field_discriminator(field:Any) -> Optional[str]
Search for the discriminator attribute in a given field.
funcgoogle.genai._gaos.utils.datetimes.parse_duration(duration_string:str) -> timedelta
Convert an ISO 8601 duration string (e.g.
funcgoogle.genai._gaos.utils.response_helpers.raise_parse_error(hooks:Optional[Any], hook_ctx:Optional[AfterParseErrorContext], response:httpx.Response, exc:Exception) -> NoReturn
Raise the hook-substituted parse error.
classgoogle.genai._gaos.utils.retries.BackoffStrategy
Exponential backoff strategy configuration.
classgoogle.genai._gaos.utils.retries.RetryConfig
Runtime retry configuration.
funcgoogle.genai._local_tokenizer_loader.get_tokenizer_name(model_name:str) -> str
Gets the tokenizer name for the given model name.
funcgoogle.genai._local_tokenizer_loader.load_model_proto(tokenizer_name:str) -> sentencepiece_model_pb2.ModelProto
Loads model proto from the given tokenizer name.
funcgoogle.genai._mcp_utils.agent_platform_to_gemini_tool(tool:McpTool) -> types.Tool
Translates an Agent Platform tool to a Google GenAI tool.
funcgoogle.genai._mcp_utils.has_mcp_session_usage(tools:types.ToolListUnion) -> bool
Checks whether the list of tools contains any MCP sessions.
funcgoogle.genai._mcp_utils.mcp_to_gemini_tool(tool:McpTool) -> types.Tool
Translates an MCP tool to a Google GenAI tool.
funcgoogle.genai._mcp_utils.set_mcp_usage_header(headers:dict[str, str]) -> None
Sets the MCP version label in the Google API client header.
classgoogle.genai._replay_api_client.ReplayFile
Represents a recorded session.
classgoogle.genai._replay_api_client.ReplayRequest
Represents a single request in a replay.
classgoogle.genai._replay_api_client.ReplayResponse
Represents a single response in a replay.
funcgoogle.genai._replay_api_client.pop_undeterministic_headers(headers:dict[str, str]) -> None
Remove headers that are not deterministic.
funcgoogle.genai._replay_api_client.to_snake_case(name:str) -> str
Converts a string from camelCase or PascalCase to snake_case.
funcgoogle.genai._transformers.t_metrics(metrics:list[types.MetricSubclass]) -> list[dict[str, Any]]
Prepares the metric payload for the evaluation request.
methodgoogle.genai.batches.AsyncBatches.cancel(*name:str, *config:Optional[types.CancelBatchJobConfigOrDict]=None) -> None
Cancels a batch job.
methodgoogle.genai.batches.AsyncBatches.create(*model:str, *src:types.BatchJobSourceUnionDict, *config:Optional[types.CreateBatchJobConfigOrDict]=None) -> types.BatchJob
Creates a batch job asynchronously.
methodgoogle.genai.batches.AsyncBatches.delete(*name:str, *config:Optional[types.DeleteBatchJobConfigOrDict]=None) -> types.DeleteResourceJob
Deletes a batch job.
methodgoogle.genai.batches.AsyncBatches.get(*name:str, *config:Optional[types.GetBatchJobConfigOrDict]=None) -> types.BatchJob
Gets a batch job.
methodgoogle.genai.batches.AsyncBatches.list(*config:Optional[types.ListBatchJobsConfigOrDict]=None) -> AsyncPager[types.BatchJob]
Lists batch jobs asynchronously.
methodgoogle.genai.batches.Batches.cancel(*name:str, *config:Optional[types.CancelBatchJobConfigOrDict]=None) -> None
Cancels a batch job.
methodgoogle.genai.batches.Batches.create(*model:str, *src:types.BatchJobSourceUnionDict, *config:Optional[types.CreateBatchJobConfigOrDict]=None) -> types.BatchJob
Creates a batch job.
methodgoogle.genai.batches.Batches.delete(*name:str, *config:Optional[types.DeleteBatchJobConfigOrDict]=None) -> types.DeleteResourceJob
Deletes a batch job.
methodgoogle.genai.batches.Batches.get(*name:str, *config:Optional[types.GetBatchJobConfigOrDict]=None) -> types.BatchJob
Gets a batch job.
methodgoogle.genai.batches.Batches.list(*config:Optional[types.ListBatchJobsConfigOrDict]=None) -> Pager[types.BatchJob]
Lists batch jobs.
classgoogle.genai.chats.AsyncChat
Async chat session.
classgoogle.genai.chats.AsyncChats
A util class to create async chat sessions.
methodgoogle.genai.chats.AsyncChats.create(*model:str, *config:Optional[GenerateContentConfigOrDict]=None, *history:Optional[list[ContentOrDict]]=None) -> AsyncChat
Creates a new chat session.
classgoogle.genai.chats.Chat
Chat session.
classgoogle.genai.chats.Chats
A util class to create chat sessions.
methodgoogle.genai.chats.Chats.create(*model:str, *config:Optional[GenerateContentConfigOrDict]=None, *history:Optional[list[ContentOrDict]]=None) -> Chat
Creates a new chat session.
classgoogle.genai.client.AsyncClient
Client for making asynchronous (non-blocking) requests.
methodgoogle.genai.client.AsyncClient.aclose() -> None
Closes the async client explicitly.
methodgoogle.genai.client.AsyncClient.environments() -> AsyncGeminiNextGenEnvironments
Environments resource.
classgoogle.genai.client.Client
Client for making synchronous requests.
methodgoogle.genai.client.Client.close() -> None
Closes the synchronous client explicitly.
methodgoogle.genai.client.Client.vertexai() -> bool
Returns whether the client is using the Vertex AI API.
methodgoogle.genai.documents.Documents.delete(*name:str, *config:Optional[types.DeleteDocumentConfigOrDict]=None) -> None
Deletes a Document.
methodgoogle.genai.documents.Documents.get(*name:str, *config:Optional[types.GetDocumentConfigOrDict]=None) -> types.Document
Gets metadata about a Document.
methodgoogle.genai.documents.Documents.list(*parent:str, *config:Optional[types.ListDocumentsConfigOrDict]=None) -> Pager[types.Document]
Lists documents.
classgoogle.genai.errors.APIError
General errors raised by the GenAI API.
classgoogle.genai.errors.ClientError
Client error raised by the GenAI API.
classgoogle.genai.errors.ServerError
Server error raised by the GenAI API.
classgoogle.genai.errors.UnsupportedFunctionError
Raised when the function is not supported.
methodgoogle.genai.files.Files.delete(*name:str, *config:Optional[types.DeleteFileConfigOrDict]=None) -> types.DeleteFileResponse
Deletes a remotely stored file.
methodgoogle.genai.files.Files.download(*file:Union[str, types.File, types.Video, types.GeneratedVideo], *config:Optional[types.DownloadFileConfigOrDict]=None) -> bytes
Downloads a file's data from storage.
methodgoogle.genai.files.Files.get(*name:str, *config:Optional[types.GetFileConfigOrDict]=None) -> types.File
Retrieves the file information from the service.
methodgoogle.genai.files.Files.list(*config:Optional[types.ListFilesConfigOrDict]=None) -> Pager[types.File]
Lists all files from the service.
classgoogle.genai.live.AsyncLive
[Preview] AsyncLive.
methodgoogle.genai.live.AsyncLive.connect(*model:str, *config:Optional[types.LiveConnectConfigOrDict]=None) -> AsyncIterator[AsyncSession]
[Preview] Connect to the live server.
classgoogle.genai.live.AsyncSession
[Preview] AsyncSession.
methodgoogle.genai.live.AsyncSession.receive() -> AsyncIterator[types.LiveServerMessage]
Receive model responses from the server.
methodgoogle.genai.live.AsyncSession.send_tool_response(*function_responses:Union[types.FunctionResponseOrDict, Sequence[types.FunctionResponseOrDict]]) -> None
Send a tool response to the session.
classgoogle.genai.live_music.AsyncLiveMusic
[Experimental] Live music module.
methodgoogle.genai.live_music.AsyncLiveMusic.connect(*model:str) -> AsyncIterator[AsyncMusicSession]
[Experimental] Connect to the live music server.
classgoogle.genai.live_music.AsyncMusicSession
[Experimental] AsyncMusicSession.
methodgoogle.genai.live_music.AsyncMusicSession.pause() -> None
Sends a playback signal to pause the music stream.
methodgoogle.genai.live_music.AsyncMusicSession.play() -> None
Sends playback signal to start the music stream.
methodgoogle.genai.live_music.AsyncMusicSession.receive() -> AsyncIterator[types.LiveMusicServerMessage]
Receive model responses from the server.
methodgoogle.genai.live_music.AsyncMusicSession.stop() -> None
Sends a playback signal to stop the music stream.
classgoogle.genai.local_tokenizer.LocalTokenizer
[Experimental] Text Only Local Tokenizer.
methodgoogle.genai.models.AsyncModels.list(*config:Optional[types.ListModelsConfigOrDict]=None) -> AsyncPager[types.Model]
Makes an API request to list the available models.
methodgoogle.genai.models.AsyncModels.recontext_image(*model:str, *source:types.RecontextImageSourceOrDict, *config:Optional[types.RecontextImageConfigOrDict]=None) -> types.RecontextImageResponse
Recontextualizes an image.
methodgoogle.genai.models.Models.list(*config:Optional[types.ListModelsConfigOrDict]=None) -> Pager[types.Model]
Makes an API request to list the available models.
methodgoogle.genai.models.Models.recontext_image(*model:str, *source:types.RecontextImageSourceOrDict, *config:Optional[types.RecontextImageConfigOrDict]=None) -> types.RecontextImageResponse
Recontextualizes an image.
methodgoogle.genai.operations.Operations.get(operation:T, *config:Optional[types.GetOperationConfigOrDict]=None) -> T
Gets the status of a long-running operation.
classgoogle.genai.pagers.AsyncPager
AsyncPager class for iterating through paginated results.
methodgoogle.genai.pagers.AsyncPager.next_page() -> list[T]
Fetches the next page of items asynchronously.
classgoogle.genai.pagers.Pager
Pager class for iterating through paginated results.
methodgoogle.genai.pagers.Pager.next_page() -> list[T]
Fetches the next page of items.
classgoogle.genai.tokens.AsyncTokens
[Experimental] Async Auth Tokens API client.
methodgoogle.genai.tokens.AsyncTokens.create(*config:Optional[types.CreateAuthTokenConfigOrDict]=None) -> types.AuthToken
Creates an auth token asynchronously.
classgoogle.genai.tokens.Tokens
[Experimental] Auth Tokens API client.
methodgoogle.genai.tokens.Tokens.create(*config:Optional[types.CreateAuthTokenConfigOrDict]=None) -> types.AuthToken
[Experimental] Creates an auth token.

About this data

These signatures were extracted from the public source of googleapis/python-genai using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries