diff --git a/agentplatform/_genai/client.py b/agentplatform/_genai/client.py index d04deba6d9..0ed9ddf79e 100644 --- a/agentplatform/_genai/client.py +++ b/agentplatform/_genai/client.py @@ -39,6 +39,9 @@ ) from agentplatform._genai import prompts as prompts_module from agentplatform._genai import skills as skills_module + from agentplatform._genai import ( + model_garden as model_garden_module, + ) from agentplatform._genai import live as live_module from agentplatform._genai import rag as rag_module @@ -85,6 +88,7 @@ def __init__(self, api_client: genai_client.BaseApiClient): # type: ignore[name self._datasets: Optional[ModuleType] = None self._skills: Optional[ModuleType] = None self._rag: Optional[ModuleType] = None + self._model_garden: Optional[ModuleType] = None @property @_common.experimental_warning( @@ -179,6 +183,18 @@ def rag(self) -> "rag_module.AsyncRag": ) return self._rag.AsyncRag(self._api_client) # type: ignore[no-any-return] + @property + @_common.experimental_warning( + "The Model Garden module is experimental, and may change in future " "versions." + ) + def model_garden(self) -> "model_garden_module.AsyncModelGarden": + if self._model_garden is None: + self._model_garden = importlib.import_module( + ".model_garden", + __package__, + ) + return self._model_garden.AsyncModelGarden(self._api_client) # type: ignore[no-any-return] + async def aclose(self) -> None: """Closes the async client explicitly. @@ -284,6 +300,7 @@ def __init__( self._datasets: Optional[ModuleType] = None self._skills: Optional[ModuleType] = None self._rag: Optional[ModuleType] = None + self._model_garden: Optional[ModuleType] = None @property def evals(self) -> "evals_module.Evals": @@ -402,3 +419,15 @@ def rag(self) -> "rag_module.Rag": __package__, ) return self._rag.Rag(self._api_client) # type: ignore[no-any-return] + + @property + @_common.experimental_warning( + "The Model Garden module is experimental, and may change in future " "versions." + ) + def model_garden(self) -> "model_garden_module.ModelGarden": + if self._model_garden is None: + self._model_garden = importlib.import_module( + ".model_garden", + __package__, + ) + return self._model_garden.ModelGarden(self._api_client) # type: ignore[no-any-return] diff --git a/agentplatform/_genai/model_garden.py b/agentplatform/_genai/model_garden.py new file mode 100644 index 0000000000..4410fc4a02 --- /dev/null +++ b/agentplatform/_genai/model_garden.py @@ -0,0 +1,419 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Code generated by the Google Gen AI SDK generator DO NOT EDIT. + +import json +import logging +from typing import Any, Optional, Union +from urllib.parse import urlencode + +from google.genai import _api_module +from google.genai import _common +from google.genai._common import get_value_by_path as getv +from google.genai._common import set_value_by_path as setv + +from . import types + +logger = logging.getLogger("agentplatform_genai.modelgarden") + + +def _ListPublisherModelsConfig_to_vertex( + from_object: Union[dict[str, Any], object], + parent_object: Optional[dict[str, Any]] = None, +) -> dict[str, Any]: + to_object: dict[str, Any] = {} + + if getv(from_object, ["page_size"]) is not None: + setv(parent_object, ["_query", "pageSize"], getv(from_object, ["page_size"])) + + if getv(from_object, ["page_token"]) is not None: + setv(parent_object, ["_query", "pageToken"], getv(from_object, ["page_token"])) + + if getv(from_object, ["filter"]) is not None: + setv(parent_object, ["_query", "filter"], getv(from_object, ["filter"])) + + if getv(from_object, ["list_all_versions"]) is not None: + setv( + parent_object, + ["_query", "listAllVersions"], + getv(from_object, ["list_all_versions"]), + ) + + return to_object + + +def _ListPublisherModelsRequestParameters_to_vertex( + from_object: Union[dict[str, Any], object], + parent_object: Optional[dict[str, Any]] = None, +) -> dict[str, Any]: + to_object: dict[str, Any] = {} + if getv(from_object, ["parent"]) is not None: + setv(to_object, ["_url", "parent"], getv(from_object, ["parent"])) + + if getv(from_object, ["config"]) is not None: + _ListPublisherModelsConfig_to_vertex(getv(from_object, ["config"]), to_object) + + return to_object + + +class ModelGarden(_api_module.BaseModule): + """Model Garden module.""" + + def _list_publisher_models( + self, + *, + parent: Optional[str] = None, + config: Optional[types.ListPublisherModelsConfigOrDict] = None, + ) -> types.ListPublisherModelsResponse: + """ + Lists publisher models (internal). + """ + + parameter_model = types._ListPublisherModelsRequestParameters( + parent=parent, + config=config, + ) + + request_url_dict: Optional[dict[str, str]] + if not self._api_client.vertexai: + raise ValueError( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode." + ) + else: + request_dict = _ListPublisherModelsRequestParameters_to_vertex( + parameter_model + ) + request_url_dict = request_dict.get("_url") + if request_url_dict: + path = "{parent}/models".format_map(request_url_dict) + else: + path = "{parent}/models" + + query_params = request_dict.get("_query") + if query_params: + path = f"{path}?{urlencode(query_params)}" + # TODO: remove the hack that pops config. + request_dict.pop("config", None) + + http_options: Optional[types.HttpOptions] = None + if ( + parameter_model.config is not None + and parameter_model.config.http_options is not None + ): + http_options = parameter_model.config.http_options + + request_dict = _common.convert_to_dict(request_dict) + request_dict = _common.encode_unserializable_types(request_dict) + + response = self._api_client.request("get", path, request_dict, http_options) + + response_dict = {} if not response.body else json.loads(response.body) + + return_value = types.ListPublisherModelsResponse._from_response( + response=response_dict, + kwargs=( + { + "config": { + "response_schema": getattr( + parameter_model.config, "response_schema", None + ), + "response_json_schema": getattr( + parameter_model.config, "response_json_schema", None + ), + "include_all_fields": getattr( + parameter_model.config, "include_all_fields", None + ), + } + } + if getattr(parameter_model, "config", None) + else {} + ), + ) + + self._api_client._verify_response(return_value) + return return_value + + @staticmethod + def _build_filter_str( + model_filter: Optional[str], + include_hugging_face_models: Optional[bool], + deployable_only: bool, + ) -> str: + """Builds the filter string for listing publisher models.""" + import re + + if include_hugging_face_models: + filter_str = "is_hf_wildcard(true)" + if deployable_only: + filter_str += ( + " AND labels.VERIFIED_DEPLOYMENT_CONFIG=VERIFIED_DEPLOYMENT_SUCCEED" + ) + else: + filter_str = "is_hf_wildcard(false)" + + if model_filter: + escaped = re.escape(model_filter) + filter_str = ( + f'{filter_str} AND (model_user_id=~"(?i).*{escaped}.*"' + f' OR display_name=~"(?i).*{escaped}.*")' + ) + + return filter_str + + def list_deployable_models( + self, + config: Optional[types.ListDeployableModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists deployable models in Model Garden.""" + if config is None: + config = types.ListDeployableModelsConfig() + if isinstance(config, dict): + config = types.ListDeployableModelsConfig.model_validate(config) + + # Hugging face filter HUGGING_FACE=true/false is not supported by backend, + # so we only pass model_filter and filter HF models on client side. + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=True, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=True, + ) + + response = self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models + + def list_models( + self, + config: Optional[types.ListModelGardenModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists all models in Model Garden.""" + if config is None: + config = types.ListModelGardenModelsConfig() + if isinstance(config, dict): + config = types.ListModelGardenModelsConfig.model_validate(config) + + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=False, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=False, + ) + + response = self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models + + +class AsyncModelGarden(_api_module.BaseModule): + """Model Garden module.""" + + async def _list_publisher_models( + self, + *, + parent: Optional[str] = None, + config: Optional[types.ListPublisherModelsConfigOrDict] = None, + ) -> types.ListPublisherModelsResponse: + """ + Lists publisher models (internal). + """ + + parameter_model = types._ListPublisherModelsRequestParameters( + parent=parent, + config=config, + ) + + request_url_dict: Optional[dict[str, str]] + if not self._api_client.vertexai: + raise ValueError( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode." + ) + else: + request_dict = _ListPublisherModelsRequestParameters_to_vertex( + parameter_model + ) + request_url_dict = request_dict.get("_url") + if request_url_dict: + path = "{parent}/models".format_map(request_url_dict) + else: + path = "{parent}/models" + + query_params = request_dict.get("_query") + if query_params: + path = f"{path}?{urlencode(query_params)}" + # TODO: remove the hack that pops config. + request_dict.pop("config", None) + + http_options: Optional[types.HttpOptions] = None + if ( + parameter_model.config is not None + and parameter_model.config.http_options is not None + ): + http_options = parameter_model.config.http_options + + request_dict = _common.convert_to_dict(request_dict) + request_dict = _common.encode_unserializable_types(request_dict) + + response = await self._api_client.async_request( + "get", path, request_dict, http_options + ) + + response_dict = {} if not response.body else json.loads(response.body) + + return_value = types.ListPublisherModelsResponse._from_response( + response=response_dict, + kwargs=( + { + "config": { + "response_schema": getattr( + parameter_model.config, "response_schema", None + ), + "response_json_schema": getattr( + parameter_model.config, "response_json_schema", None + ), + "include_all_fields": getattr( + parameter_model.config, "include_all_fields", None + ), + } + } + if getattr(parameter_model, "config", None) + else {} + ), + ) + + self._api_client._verify_response(return_value) + return return_value + + @staticmethod + def _build_filter_str( + model_filter: Optional[str], + include_hugging_face_models: Optional[bool], + deployable_only: bool, + ) -> str: + """Builds the filter string for listing publisher models.""" + import re + + if include_hugging_face_models: + filter_str = "is_hf_wildcard(true)" + if deployable_only: + filter_str += ( + " AND labels.VERIFIED_DEPLOYMENT_CONFIG=VERIFIED_DEPLOYMENT_SUCCEED" + ) + else: + filter_str = "is_hf_wildcard(false)" + + if model_filter: + escaped = re.escape(model_filter) + filter_str = ( + f'{filter_str} AND (model_user_id=~"(?i).*{escaped}.*"' + f' OR display_name=~"(?i).*{escaped}.*")' + ) + + return filter_str + + async def list_deployable_models( + self, + config: Optional[types.ListDeployableModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists deployable models in Model Garden.""" + if config is None: + config = types.ListDeployableModelsConfig() + if isinstance(config, dict): + config = types.ListDeployableModelsConfig.model_validate(config) + + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=True, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=True, + ) + + response = await self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models + + async def list_models( + self, + config: Optional[types.ListModelGardenModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists all models in Model Garden.""" + if config is None: + config = types.ListModelGardenModelsConfig() + if isinstance(config, dict): + config = types.ListModelGardenModelsConfig.model_validate(config) + + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=False, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=False, + ) + + response = await self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models diff --git a/agentplatform/_genai/types/__init__.py b/agentplatform/_genai/types/__init__.py index 4b2f9b651c..8b089f1459 100644 --- a/agentplatform/_genai/types/__init__.py +++ b/agentplatform/_genai/types/__init__.py @@ -120,6 +120,7 @@ from .common import _ListDatasetVersionsRequestParameters from .common import _ListEvaluationMetricsParameters from .common import _ListMultimodalDatasetsRequestParameters +from .common import _ListPublisherModelsRequestParameters from .common import _ListRagCorporaRequestParameters from .common import _ListRagFilesRequestParameters from .common import _ListSandboxEnvironmentSnapshotsRequestParameters @@ -236,6 +237,12 @@ from .common import AttackCategoryResult from .common import AttackCategoryResultDict from .common import AttackCategoryResultOrDict +from .common import AutomaticResources +from .common import AutomaticResourcesDict +from .common import AutomaticResourcesOrDict +from .common import AutoscalingMetricSpec +from .common import AutoscalingMetricSpecDict +from .common import AutoscalingMetricSpecOrDict from .common import BatchPredictionResourceUsageAssessmentConfig from .common import BatchPredictionResourceUsageAssessmentConfigDict from .common import BatchPredictionResourceUsageAssessmentConfigOrDict @@ -377,6 +384,12 @@ from .common import DatasetVersion from .common import DatasetVersionDict from .common import DatasetVersionOrDict +from .common import DedicatedResources +from .common import DedicatedResourcesDict +from .common import DedicatedResourcesOrDict +from .common import DedicatedResourcesScaleToZeroSpec +from .common import DedicatedResourcesScaleToZeroSpecDict +from .common import DedicatedResourcesScaleToZeroSpecOrDict from .common import DefaultContainerCategory from .common import DeleteAgentEngineConfig from .common import DeleteAgentEngineConfigDict @@ -589,6 +602,9 @@ from .common import FileStatus from .common import FileStatusDict from .common import FileStatusOrDict +from .common import FlexStart +from .common import FlexStartDict +from .common import FlexStartOrDict from .common import Framework from .common import GcsDestination from .common import GcsDestinationDict @@ -778,6 +794,10 @@ from .common import KeepAliveProbeHttpGetOrDict from .common import KeepAliveProbeOrDict from .common import Language +from .common import LargeModelReference +from .common import LargeModelReferenceDict +from .common import LargeModelReferenceOrDict +from .common import LaunchStage from .common import ListAgentEngineConfig from .common import ListAgentEngineConfigDict from .common import ListAgentEngineConfigOrDict @@ -826,12 +846,18 @@ from .common import ListDatasetVersionsResponse from .common import ListDatasetVersionsResponseDict from .common import ListDatasetVersionsResponseOrDict +from .common import ListDeployableModelsConfig +from .common import ListDeployableModelsConfigDict +from .common import ListDeployableModelsConfigOrDict from .common import ListEvaluationMetricsConfig from .common import ListEvaluationMetricsConfigDict from .common import ListEvaluationMetricsConfigOrDict from .common import ListEvaluationMetricsResponse from .common import ListEvaluationMetricsResponseDict from .common import ListEvaluationMetricsResponseOrDict +from .common import ListModelGardenModelsConfig +from .common import ListModelGardenModelsConfigDict +from .common import ListModelGardenModelsConfigOrDict from .common import ListMultimodalDatasetsConfig from .common import ListMultimodalDatasetsConfigDict from .common import ListMultimodalDatasetsConfigOrDict @@ -841,6 +867,12 @@ from .common import ListPromptsConfig from .common import ListPromptsConfigDict from .common import ListPromptsConfigOrDict +from .common import ListPublisherModelsConfig +from .common import ListPublisherModelsConfigDict +from .common import ListPublisherModelsConfigOrDict +from .common import ListPublisherModelsResponse +from .common import ListPublisherModelsResponseDict +from .common import ListPublisherModelsResponseOrDict from .common import ListRagCorporaConfig from .common import ListRagCorporaConfigDict from .common import ListRagCorporaConfigOrDict @@ -1012,6 +1044,9 @@ from .common import MetricxResult from .common import MetricxResultDict from .common import MetricxResultOrDict +from .common import ModelContainerSpec +from .common import ModelContainerSpecDict +from .common import ModelContainerSpecOrDict from .common import MultimodalDataset from .common import MultimodalDatasetDict from .common import MultimodalDatasetOperation @@ -1024,6 +1059,7 @@ from .common import ObservabilityEvalCase from .common import ObservabilityEvalCaseDict from .common import ObservabilityEvalCaseOrDict +from .common import OpenSourceCategory from .common import Operator from .common import OptimizationMethod from .common import OptimizeConfig @@ -1052,7 +1088,31 @@ from .common import PointwiseMetricInstance from .common import PointwiseMetricInstanceDict from .common import PointwiseMetricInstanceOrDict +from .common import Port +from .common import PortDict +from .common import PortOrDict from .common import PostSnapshotAction +from .common import PredictSchemata +from .common import PredictSchemataDict +from .common import PredictSchemataOrDict +from .common import Probe +from .common import ProbeDict +from .common import ProbeExecAction +from .common import ProbeExecActionDict +from .common import ProbeExecActionOrDict +from .common import ProbeGrpcAction +from .common import ProbeGrpcActionDict +from .common import ProbeGrpcActionOrDict +from .common import ProbeHttpGetAction +from .common import ProbeHttpGetActionDict +from .common import ProbeHttpGetActionOrDict +from .common import ProbeHttpHeader +from .common import ProbeHttpHeaderDict +from .common import ProbeHttpHeaderOrDict +from .common import ProbeOrDict +from .common import ProbeTcpSocketAction +from .common import ProbeTcpSocketActionDict +from .common import ProbeTcpSocketActionOrDict from .common import Prompt from .common import PromptData from .common import PromptDataDict @@ -1079,6 +1139,45 @@ from .common import PscInterfaceConfig from .common import PscInterfaceConfigDict from .common import PscInterfaceConfigOrDict +from .common import PublisherModel +from .common import PublisherModelCallToAction +from .common import PublisherModelCallToActionDeploy +from .common import PublisherModelCallToActionDeployDeployMetadata +from .common import PublisherModelCallToActionDeployDeployMetadataDict +from .common import PublisherModelCallToActionDeployDeployMetadataOrDict +from .common import PublisherModelCallToActionDeployDict +from .common import PublisherModelCallToActionDeployGke +from .common import PublisherModelCallToActionDeployGkeDict +from .common import PublisherModelCallToActionDeployGkeOrDict +from .common import PublisherModelCallToActionDeployOrDict +from .common import PublisherModelCallToActionDeployVertex +from .common import PublisherModelCallToActionDeployVertexDict +from .common import PublisherModelCallToActionDeployVertexOrDict +from .common import PublisherModelCallToActionDict +from .common import PublisherModelCallToActionOpenFineTuningPipelines +from .common import PublisherModelCallToActionOpenFineTuningPipelinesDict +from .common import PublisherModelCallToActionOpenFineTuningPipelinesOrDict +from .common import PublisherModelCallToActionOpenNotebooks +from .common import PublisherModelCallToActionOpenNotebooksDict +from .common import PublisherModelCallToActionOpenNotebooksOrDict +from .common import PublisherModelCallToActionOrDict +from .common import PublisherModelCallToActionRegionalResourceReferences +from .common import PublisherModelCallToActionRegionalResourceReferencesDict +from .common import PublisherModelCallToActionRegionalResourceReferencesOrDict +from .common import PublisherModelCallToActionViewRestApi +from .common import PublisherModelCallToActionViewRestApiDict +from .common import PublisherModelCallToActionViewRestApiOrDict +from .common import PublisherModelDict +from .common import PublisherModelDocumentation +from .common import PublisherModelDocumentationDict +from .common import PublisherModelDocumentationOrDict +from .common import PublisherModelOrDict +from .common import PublisherModelParent +from .common import PublisherModelParentDict +from .common import PublisherModelParentOrDict +from .common import PublisherModelResourceReference +from .common import PublisherModelResourceReferenceDict +from .common import PublisherModelResourceReferenceOrDict from .common import PurgeAgentEngineMemoriesConfig from .common import PurgeAgentEngineMemoriesConfigDict from .common import PurgeAgentEngineMemoriesConfigOrDict @@ -1757,6 +1856,7 @@ from .common import UpdateSkillConfig from .common import UpdateSkillConfigDict from .common import UpdateSkillConfigOrDict +from .common import VersionState from .common import VertexAiSearchConfig from .common import VertexAiSearchConfigDict from .common import VertexAiSearchConfigOrDict @@ -3235,6 +3335,96 @@ "ListSkillRevisionsResponse", "ListSkillRevisionsResponseDict", "ListSkillRevisionsResponseOrDict", + "ListPublisherModelsConfig", + "ListPublisherModelsConfigDict", + "ListPublisherModelsConfigOrDict", + "PublisherModelResourceReference", + "PublisherModelResourceReferenceDict", + "PublisherModelResourceReferenceOrDict", + "PublisherModelParent", + "PublisherModelParentDict", + "PublisherModelParentOrDict", + "PredictSchemata", + "PredictSchemataDict", + "PredictSchemataOrDict", + "PublisherModelCallToActionRegionalResourceReferences", + "PublisherModelCallToActionRegionalResourceReferencesDict", + "PublisherModelCallToActionRegionalResourceReferencesOrDict", + "AutomaticResources", + "AutomaticResourcesDict", + "AutomaticResourcesOrDict", + "Port", + "PortDict", + "PortOrDict", + "ProbeExecAction", + "ProbeExecActionDict", + "ProbeExecActionOrDict", + "ProbeGrpcAction", + "ProbeGrpcActionDict", + "ProbeGrpcActionOrDict", + "ProbeHttpHeader", + "ProbeHttpHeaderDict", + "ProbeHttpHeaderOrDict", + "ProbeHttpGetAction", + "ProbeHttpGetActionDict", + "ProbeHttpGetActionOrDict", + "ProbeTcpSocketAction", + "ProbeTcpSocketActionDict", + "ProbeTcpSocketActionOrDict", + "Probe", + "ProbeDict", + "ProbeOrDict", + "ModelContainerSpec", + "ModelContainerSpecDict", + "ModelContainerSpecOrDict", + "AutoscalingMetricSpec", + "AutoscalingMetricSpecDict", + "AutoscalingMetricSpecOrDict", + "FlexStart", + "FlexStartDict", + "FlexStartOrDict", + "DedicatedResourcesScaleToZeroSpec", + "DedicatedResourcesScaleToZeroSpecDict", + "DedicatedResourcesScaleToZeroSpecOrDict", + "DedicatedResources", + "DedicatedResourcesDict", + "DedicatedResourcesOrDict", + "PublisherModelCallToActionDeployDeployMetadata", + "PublisherModelCallToActionDeployDeployMetadataDict", + "PublisherModelCallToActionDeployDeployMetadataOrDict", + "LargeModelReference", + "LargeModelReferenceDict", + "LargeModelReferenceOrDict", + "PublisherModelCallToActionDeploy", + "PublisherModelCallToActionDeployDict", + "PublisherModelCallToActionDeployOrDict", + "PublisherModelCallToActionDeployGke", + "PublisherModelCallToActionDeployGkeDict", + "PublisherModelCallToActionDeployGkeOrDict", + "PublisherModelCallToActionDeployVertex", + "PublisherModelCallToActionDeployVertexDict", + "PublisherModelCallToActionDeployVertexOrDict", + "PublisherModelCallToActionOpenFineTuningPipelines", + "PublisherModelCallToActionOpenFineTuningPipelinesDict", + "PublisherModelCallToActionOpenFineTuningPipelinesOrDict", + "PublisherModelCallToActionOpenNotebooks", + "PublisherModelCallToActionOpenNotebooksDict", + "PublisherModelCallToActionOpenNotebooksOrDict", + "PublisherModelDocumentation", + "PublisherModelDocumentationDict", + "PublisherModelDocumentationOrDict", + "PublisherModelCallToActionViewRestApi", + "PublisherModelCallToActionViewRestApiDict", + "PublisherModelCallToActionViewRestApiOrDict", + "PublisherModelCallToAction", + "PublisherModelCallToActionDict", + "PublisherModelCallToActionOrDict", + "PublisherModel", + "PublisherModelDict", + "PublisherModelOrDict", + "ListPublisherModelsResponse", + "ListPublisherModelsResponseDict", + "ListPublisherModelsResponseOrDict", "PromptOptimizerConfig", "PromptOptimizerConfigDict", "PromptOptimizerConfigOrDict", @@ -3325,6 +3515,12 @@ "AgentEngineRuntimeRevision", "AgentEngineRuntimeRevisionDict", "AgentEngineRuntimeRevisionOrDict", + "ListDeployableModelsConfig", + "ListDeployableModelsConfigDict", + "ListDeployableModelsConfigOrDict", + "ListModelGardenModelsConfig", + "ListModelGardenModelsConfigDict", + "ListModelGardenModelsConfigOrDict", "A2aTaskState", "State", "Strategy", @@ -3347,6 +3543,9 @@ "Framework", "SkillState", "SkillSource", + "LaunchStage", + "OpenSourceCategory", + "VersionState", "EvaluationItemType", "SamplingMethod", "EvaluationRunState", @@ -3502,6 +3701,7 @@ "_GetSkillOperationParameters", "_GetSkillRevisionRequestParameters", "_ListSkillRevisionsRequestParameters", + "_ListPublisherModelsRequestParameters", "evals", "agent_engines", "prompts", diff --git a/agentplatform/_genai/types/common.py b/agentplatform/_genai/types/common.py index e04cec58fb..a27fcd2e59 100644 --- a/agentplatform/_genai/types/common.py +++ b/agentplatform/_genai/types/common.py @@ -431,6 +431,51 @@ class SkillSource(_common.CaseInSensitiveEnum): """The skill is a system skill.""" +class LaunchStage(_common.CaseInSensitiveEnum): + """Indicates the launch stage of the model.""" + + LAUNCH_STAGE_UNSPECIFIED = "LAUNCH_STAGE_UNSPECIFIED" + """The model launch stage is unspecified.""" + EXPERIMENTAL = "EXPERIMENTAL" + """Used to indicate the PublisherModel is at Experimental launch stage, available to a small set of customers.""" + PRIVATE_PREVIEW = "PRIVATE_PREVIEW" + """Used to indicate the PublisherModel is at Private Preview launch stage, only available to a small set of customers, although a larger set of customers than an Experimental launch. Previews are the first launch stage used to get feedback from customers.""" + PUBLIC_PREVIEW = "PUBLIC_PREVIEW" + """Used to indicate the PublisherModel is at Public Preview launch stage, available to all customers, although not supported for production workloads.""" + GA = "GA" + """Used to indicate the PublisherModel is at GA launch stage, available to all customers and ready for production workload.""" + + +class OpenSourceCategory(_common.CaseInSensitiveEnum): + """Indicates the open source category of the publisher model.""" + + OPEN_SOURCE_CATEGORY_UNSPECIFIED = "OPEN_SOURCE_CATEGORY_UNSPECIFIED" + """The open source category is unspecified, which should not be used.""" + PROPRIETARY = "PROPRIETARY" + """Used to indicate the PublisherModel is not open sourced.""" + GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = "GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT" + """Used to indicate the PublisherModel is a Google-owned open source model w/ Google checkpoint.""" + THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = ( + "THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT" + ) + """Used to indicate the PublisherModel is a 3p-owned open source model w/ Google checkpoint.""" + GOOGLE_OWNED_OSS = "GOOGLE_OWNED_OSS" + """Used to indicate the PublisherModel is a Google-owned pure open source model.""" + THIRD_PARTY_OWNED_OSS = "THIRD_PARTY_OWNED_OSS" + """Used to indicate the PublisherModel is a 3p-owned pure open source model.""" + + +class VersionState(_common.CaseInSensitiveEnum): + """Indicates the state of the model version.""" + + VERSION_STATE_UNSPECIFIED = "VERSION_STATE_UNSPECIFIED" + """The version state is unspecified.""" + VERSION_STATE_STABLE = "VERSION_STATE_STABLE" + """Used to indicate the version is stable.""" + VERSION_STATE_UNSTABLE = "VERSION_STATE_UNSTABLE" + """Used to indicate the version is unstable.""" + + class EvaluationItemType(_common.CaseInSensitiveEnum): """The type of the EvaluationItem.""" @@ -22315,317 +22360,1584 @@ class ListSkillRevisionsResponseDict(TypedDict, total=False): ] -class PromptOptimizerConfig(_common.BaseModel): - """VAPO Prompt Optimizer Config.""" +class ListPublisherModelsConfig(_common.BaseModel): + """Config for listing publisher models.""" - config_path: Optional[str] = Field( - default=None, - description="""The gcs path to the config file, e.g. gs://bucket/config.json.""", - ) - service_account: Optional[str] = Field( - default=None, - description="""The service account to use for the custom job. Cannot be provided at the same time as service_account_project_number.""", - ) - service_account_project_number: Optional[Union[int, str]] = Field( - default=None, - description="""The project number used to construct the default service account:{service_account_project_number}-compute@developer.gserviceaccount.comCannot be provided at the same time as "service_account".""", + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Whether to wait for the job tocomplete. Ignored for async jobs.""", + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, description="""Filter string for publisher models.""" ) - optimizer_job_display_name: Optional[str] = Field( - default=None, - description="""The display name of the optimization job. If not provided, a display name in the format of "vapo-optimizer-{timestamp}" will be used.""", + list_all_versions: Optional[bool] = Field( + default=None, description="""Whether to list all versions.""" ) -class PromptOptimizerConfigDict(TypedDict, total=False): - """VAPO Prompt Optimizer Config.""" +class ListPublisherModelsConfigDict(TypedDict, total=False): + """Config for listing publisher models.""" - config_path: Optional[str] - """The gcs path to the config file, e.g. gs://bucket/config.json.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - service_account: Optional[str] - """The service account to use for the custom job. Cannot be provided at the same time as service_account_project_number.""" + page_size: Optional[int] + """""" - service_account_project_number: Optional[Union[int, str]] - """The project number used to construct the default service account:{service_account_project_number}-compute@developer.gserviceaccount.comCannot be provided at the same time as "service_account".""" + page_token: Optional[str] + """""" - wait_for_completion: Optional[bool] - """Whether to wait for the job tocomplete. Ignored for async jobs.""" + filter: Optional[str] + """Filter string for publisher models.""" - optimizer_job_display_name: Optional[str] - """The display name of the optimization job. If not provided, a display name in the format of "vapo-optimizer-{timestamp}" will be used.""" + list_all_versions: Optional[bool] + """Whether to list all versions.""" -PromptOptimizerConfigOrDict = Union[PromptOptimizerConfig, PromptOptimizerConfigDict] +ListPublisherModelsConfigOrDict = Union[ + ListPublisherModelsConfig, ListPublisherModelsConfigDict +] -class OptimizeResponse(_common.BaseModel): - """Response for the optimize_prompt method.""" +class _ListPublisherModelsRequestParameters(_common.BaseModel): + """Parameters for listing publisher models.""" - raw_text_response: Optional[str] = Field(default=None, description="""""") - parsed_response: Optional["ParsedResponseUnion"] = Field( + parent: Optional[str] = Field(default=None, description="""""") + config: Optional[ListPublisherModelsConfig] = Field( default=None, description="""""" ) -class OptimizeResponseDict(TypedDict, total=False): - """Response for the optimize_prompt method.""" +class _ListPublisherModelsRequestParametersDict(TypedDict, total=False): + """Parameters for listing publisher models.""" - raw_text_response: Optional[str] + parent: Optional[str] """""" - parsed_response: Optional["ParsedResponseUnionDict"] + config: Optional[ListPublisherModelsConfigDict] """""" -OptimizeResponseOrDict = Union[OptimizeResponse, OptimizeResponseDict] +_ListPublisherModelsRequestParametersOrDict = Union[ + _ListPublisherModelsRequestParameters, _ListPublisherModelsRequestParametersDict +] -class ContentMapContents(_common.BaseModel): - """Map of placeholder in metric prompt template to contents of model input.""" +class PublisherModelResourceReference(_common.BaseModel): + """Reference to a resource.""" - contents: Optional[list[genai_types.Content]] = Field( - default=None, description="""Contents of the model input.""" + description: Optional[str] = Field( + default=None, description="""Description of the resource.""" + ) + resource_name: Optional[str] = Field( + default=None, description="""The resource name of the Google Cloud resource.""" + ) + uri: Optional[str] = Field(default=None, description="""The URI of the resource.""") + use_case: Optional[str] = Field( + default=None, description="""Use case (CUJ) of the resource.""" ) -class ContentMapContentsDict(TypedDict, total=False): - """Map of placeholder in metric prompt template to contents of model input.""" +class PublisherModelResourceReferenceDict(TypedDict, total=False): + """Reference to a resource.""" - contents: Optional[list[genai_types.ContentDict]] - """Contents of the model input.""" + description: Optional[str] + """Description of the resource.""" + resource_name: Optional[str] + """The resource name of the Google Cloud resource.""" -ContentMapContentsOrDict = Union[ContentMapContents, ContentMapContentsDict] + uri: Optional[str] + """The URI of the resource.""" + use_case: Optional[str] + """Use case (CUJ) of the resource.""" -class EvaluateMethodConfig(_common.BaseModel): - """Optional parameters for the evaluate method.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - dataset_schema: Optional[Literal["GEMINI", "FLATTEN", "OPENAI"]] = Field( +PublisherModelResourceReferenceOrDict = Union[ + PublisherModelResourceReference, PublisherModelResourceReferenceDict +] + + +class PublisherModelParent(_common.BaseModel): + """The information about the parent of a model.""" + + display_name: Optional[str] = Field( default=None, - description="""The schema to use for the dataset. - If not specified, the dataset schema will be inferred from the first - example in the dataset.""", + description="""Required. The display name of the parent. E.g., LaMDA, T5, Vision API, Natural Language API.""", ) - dest: Optional[str] = Field( - default=None, description="""The destination path for the evaluation results.""" - ) - evaluation_service_qps: Optional[float] = Field( + reference: Optional[PublisherModelResourceReference] = Field( default=None, - description="""The rate limit (queries per second) for calls to the - evaluation service. Defaults to 10. Increase this value if your - project has a higher EvaluateInstances API quota.""", + description="""Optional. The Google Cloud resource name or the URI reference.""", ) -class EvaluateMethodConfigDict(TypedDict, total=False): - """Optional parameters for the evaluate method.""" +class PublisherModelParentDict(TypedDict, total=False): + """The information about the parent of a model.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + display_name: Optional[str] + """Required. The display name of the parent. E.g., LaMDA, T5, Vision API, Natural Language API.""" - dataset_schema: Optional[Literal["GEMINI", "FLATTEN", "OPENAI"]] - """The schema to use for the dataset. - If not specified, the dataset schema will be inferred from the first - example in the dataset.""" + reference: Optional[PublisherModelResourceReferenceDict] + """Optional. The Google Cloud resource name or the URI reference.""" - dest: Optional[str] - """The destination path for the evaluation results.""" - evaluation_service_qps: Optional[float] - """The rate limit (queries per second) for calls to the - evaluation service. Defaults to 10. Increase this value if your - project has a higher EvaluateInstances API quota.""" +PublisherModelParentOrDict = Union[PublisherModelParent, PublisherModelParentDict] -EvaluateMethodConfigOrDict = Union[EvaluateMethodConfig, EvaluateMethodConfigDict] +class PredictSchemata(_common.BaseModel): + """Contains the schemata used in Model's predictions and explanations via PredictionService.Predict, PredictionService.Explain and BatchPredictionJob.""" + instance_schema_uri: Optional[str] = Field( + default=None, + description="""Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single instance, which are used in PredictRequest.instances, ExplainRequest.instances and BatchPredictionJob.input_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""", + ) + parameters_schema_uri: Optional[str] = Field( + default=None, + description="""Immutable. Points to a YAML file stored on Google Cloud Storage describing the parameters of prediction and explanation via PredictRequest.parameters, ExplainRequest.parameters and BatchPredictionJob.model_parameters. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI, if no parameters are supported, then it is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""", + ) + prediction_schema_uri: Optional[str] = Field( + default=None, + description="""Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single prediction produced by this Model, which are returned via PredictResponse.predictions, ExplainResponse.explanations, and BatchPredictionJob.output_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""", + ) -class EvaluateDatasetConfig(_common.BaseModel): - """Config for evaluate instances.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) +class PredictSchemataDict(TypedDict, total=False): + """Contains the schemata used in Model's predictions and explanations via PredictionService.Predict, PredictionService.Explain and BatchPredictionJob.""" + instance_schema_uri: Optional[str] + """Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single instance, which are used in PredictRequest.instances, ExplainRequest.instances and BatchPredictionJob.input_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""" -class EvaluateDatasetConfigDict(TypedDict, total=False): - """Config for evaluate instances.""" + parameters_schema_uri: Optional[str] + """Immutable. Points to a YAML file stored on Google Cloud Storage describing the parameters of prediction and explanation via PredictRequest.parameters, ExplainRequest.parameters and BatchPredictionJob.model_parameters. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI, if no parameters are supported, then it is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + prediction_schema_uri: Optional[str] + """Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single prediction produced by this Model, which are returned via PredictResponse.predictions, ExplainResponse.explanations, and BatchPredictionJob.output_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""" -EvaluateDatasetConfigOrDict = Union[EvaluateDatasetConfig, EvaluateDatasetConfigDict] +PredictSchemataOrDict = Union[PredictSchemata, PredictSchemataDict] -class EvaluateDatasetOperation(_common.BaseModel): +class PublisherModelCallToActionRegionalResourceReferences(_common.BaseModel): + """The regional resource name or the URI. Key is region, e.g., us-central1, europe-west2, global, etc..""" - name: Optional[str] = Field( + colab_notebook_disabled: Optional[bool] = Field( default=None, - description="""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}`.""", + description="""Optional. For notebook resource. When set to true, the Colab Enterprise link will be disabled in the "open notebook" dialog in UI.""", ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + references: Optional[dict[str, PublisherModelResourceReference]] = Field( + default=None, description="""Required.""" ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + resource_description: Optional[str] = Field( + default=None, description="""Optional. Description of the resource.""" ) - error: Optional[dict[str, Any]] = Field( + resource_title: Optional[str] = Field( + default=None, description="""Optional. Title of the resource.""" + ) + resource_use_case: Optional[str] = Field( + default=None, description="""Optional. Use case (CUJ) of the resource.""" + ) + supports_workbench: Optional[bool] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Optional. For notebook resource, whether the notebook supports Workbench.""", ) - response: Optional[EvaluationDataset] = Field(default=None, description="""""") + title: Optional[str] = Field(default=None, description="""Required. """) -class EvaluateDatasetOperationDict(TypedDict, total=False): +class PublisherModelCallToActionRegionalResourceReferencesDict(TypedDict, total=False): + """The regional resource name or the URI. Key is region, e.g., us-central1, europe-west2, global, etc..""" - 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}`.""" + colab_notebook_disabled: Optional[bool] + """Optional. For notebook resource. When set to true, the Colab Enterprise link will be disabled in the "open notebook" dialog in UI.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + references: Optional[dict[str, PublisherModelResourceReferenceDict]] + """Required.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + resource_description: Optional[str] + """Optional. Description of the resource.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + resource_title: Optional[str] + """Optional. Title of the resource.""" - response: Optional[EvaluationDatasetDict] - """""" + resource_use_case: Optional[str] + """Optional. Use case (CUJ) of the resource.""" + supports_workbench: Optional[bool] + """Optional. For notebook resource, whether the notebook supports Workbench.""" -EvaluateDatasetOperationOrDict = Union[ - EvaluateDatasetOperation, EvaluateDatasetOperationDict + title: Optional[str] + """Required. """ + + +PublisherModelCallToActionRegionalResourceReferencesOrDict = Union[ + PublisherModelCallToActionRegionalResourceReferences, + PublisherModelCallToActionRegionalResourceReferencesDict, ] -class EvaluateDatasetRequestParameters(_common.BaseModel): - """Parameters for batch dataset evaluation.""" +class AutomaticResources(_common.BaseModel): + """A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration. Each Model supporting these resources documents its specific guidelines.""" - dataset: Optional[EvaluationDataset] = Field(default=None, description="""""") - metrics: Optional[list[Metric]] = Field(default=None, description="""""") - output_config: Optional[genai_types.OutputConfig] = Field( - default=None, description="""""" + max_replica_count: Optional[int] = Field( + default=None, + description="""Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, a no upper bound for scaling under heavy traffic will be assume, though Vertex AI may be unable to scale beyond certain replica number.""", ) - autorater_config: Optional[genai_types.AutoraterConfig] = Field( + min_replica_count: Optional[int] = Field( default=None, - description="""Autorater config used for evaluation. Not applicable for predefined metrics (PredefinedMetricSpec); the server uses its own model configuration for predefined metrics and this field is ignored.""", + description="""Immutable. The minimum number of replicas that will be always deployed on. If traffic against it increases, it may dynamically be deployed onto more replicas up to max_replica_count, and as traffic decreases, some of these extra replicas may be freed. If the requested value is too large, the deployment will error.""", ) - config: Optional[EvaluateDatasetConfig] = Field(default=None, description="""""") -class EvaluateDatasetRequestParametersDict(TypedDict, total=False): - """Parameters for batch dataset evaluation.""" +class AutomaticResourcesDict(TypedDict, total=False): + """A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration. Each Model supporting these resources documents its specific guidelines.""" - dataset: Optional[EvaluationDatasetDict] - """""" + max_replica_count: Optional[int] + """Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, a no upper bound for scaling under heavy traffic will be assume, though Vertex AI may be unable to scale beyond certain replica number.""" - metrics: Optional[list[MetricDict]] - """""" + min_replica_count: Optional[int] + """Immutable. The minimum number of replicas that will be always deployed on. If traffic against it increases, it may dynamically be deployed onto more replicas up to max_replica_count, and as traffic decreases, some of these extra replicas may be freed. If the requested value is too large, the deployment will error.""" - output_config: Optional[genai_types.OutputConfigDict] - """""" - autorater_config: Optional[genai_types.AutoraterConfigDict] - """Autorater config used for evaluation. Not applicable for predefined metrics (PredefinedMetricSpec); the server uses its own model configuration for predefined metrics and this field is ignored.""" +AutomaticResourcesOrDict = Union[AutomaticResources, AutomaticResourcesDict] - config: Optional[EvaluateDatasetConfigDict] - """""" +class Port(_common.BaseModel): + """Represents a network port in a container.""" -EvaluateDatasetRequestParametersOrDict = Union[ - EvaluateDatasetRequestParameters, EvaluateDatasetRequestParametersDict -] + container_port: Optional[int] = Field( + default=None, + description="""The number of the port to expose on the pod's IP address. Must be a valid port number, between 1 and 65535 inclusive.""", + ) -class ObservabilityEvalCase(_common.BaseModel): - """A single evaluation case instance for data stored in GCP Observability.""" +class PortDict(TypedDict, total=False): + """Represents a network port in a container.""" - input_src: Optional[str] = Field( - default=None, - description="""String containing the GCS reference to the GenAI input content.""", - ) - output_src: Optional[str] = Field( - default=None, - description="""String containing the GCS reference to the GenAI response content.""", - ) - system_instruction_src: Optional[str] = Field( - default=None, - description="""An optional string containing the GCS reference to the GenAI system instruction.""", - ) - api_client: Optional[Any] = Field( - default=None, description="""The underlying API client.""" - ) + container_port: Optional[int] + """The number of the port to expose on the pod's IP address. Must be a valid port number, between 1 and 65535 inclusive.""" -class ObservabilityEvalCaseDict(TypedDict, total=False): - """A single evaluation case instance for data stored in GCP Observability.""" +PortOrDict = Union[Port, PortDict] - input_src: Optional[str] - """String containing the GCS reference to the GenAI input content.""" - output_src: Optional[str] - """String containing the GCS reference to the GenAI response content.""" +class ProbeExecAction(_common.BaseModel): + """ExecAction specifies a command to execute.""" - system_instruction_src: Optional[str] - """An optional string containing the GCS reference to the GenAI system instruction.""" + command: Optional[list[str]] = Field( + default=None, + description="""Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.""", + ) - api_client: Optional[Any] - """The underlying API client.""" +class ProbeExecActionDict(TypedDict, total=False): + """ExecAction specifies a command to execute.""" -ObservabilityEvalCaseOrDict = Union[ObservabilityEvalCase, ObservabilityEvalCaseDict] + command: Optional[list[str]] + """Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.""" -class RubricGroup(_common.BaseModel): - """A group of rubrics. +ProbeExecActionOrDict = Union[ProbeExecAction, ProbeExecActionDict] - Used for grouping rubrics based on a metric or a version. - """ - group_id: Optional[str] = Field( - default=None, description="""Unique identifier for the group.""" - ) - display_name: Optional[str] = Field( +class ProbeGrpcAction(_common.BaseModel): + """GrpcAction checks the health of a container using a gRPC service.""" + + port: Optional[int] = Field( default=None, - description="""Human-readable name for the group. This should be unique - within a given context if used for display or selection. - Example: "Instruction Following V1", "Content Quality - Summarization - Task".""", + description="""Port number of the gRPC service. Number must be in the range 1 to 65535.""", ) - rubrics: Optional[list[evals_types.Rubric]] = Field( - default=None, description="""Rubrics that are part of this group.""" + service: Optional[str] = Field( + default=None, + description="""Service is the name of the service to place in the gRPC HealthCheckRequest. See https://github.com/grpc/grpc/blob/master/doc/health-checking.md. If this is not specified, the default behavior is defined by gRPC.""", ) -class RubricGroupDict(TypedDict, total=False): - """A group of rubrics. +class ProbeGrpcActionDict(TypedDict, total=False): + """GrpcAction checks the health of a container using a gRPC service.""" - Used for grouping rubrics based on a metric or a version. - """ + port: Optional[int] + """Port number of the gRPC service. Number must be in the range 1 to 65535.""" - group_id: Optional[str] - """Unique identifier for the group.""" + service: Optional[str] + """Service is the name of the service to place in the gRPC HealthCheckRequest. See https://github.com/grpc/grpc/blob/master/doc/health-checking.md. If this is not specified, the default behavior is defined by gRPC.""" - display_name: Optional[str] - """Human-readable name for the group. This should be unique - within a given context if used for display or selection. - Example: "Instruction Following V1", "Content Quality - Summarization - Task".""" - rubrics: Optional[list[evals_types.Rubric]] - """Rubrics that are part of this group.""" +ProbeGrpcActionOrDict = Union[ProbeGrpcAction, ProbeGrpcActionDict] + + +class ProbeHttpHeader(_common.BaseModel): + """HttpHeader describes a custom header to be used in HTTP probes""" + + name: Optional[str] = Field( + default=None, + description="""The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.""", + ) + value: Optional[str] = Field(default=None, description="""The header field value""") + + +class ProbeHttpHeaderDict(TypedDict, total=False): + """HttpHeader describes a custom header to be used in HTTP probes""" + + name: Optional[str] + """The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.""" + + value: Optional[str] + """The header field value""" + + +ProbeHttpHeaderOrDict = Union[ProbeHttpHeader, ProbeHttpHeaderDict] + + +class ProbeHttpGetAction(_common.BaseModel): + """HttpGetAction describes an action based on HTTP Get requests.""" + + host: Optional[str] = Field( + default=None, + description="""Host name to connect to, defaults to the model serving container's IP. You probably want to set "Host" in httpHeaders instead.""", + ) + http_headers: Optional[list[ProbeHttpHeader]] = Field( + default=None, + description="""Custom headers to set in the request. HTTP allows repeated headers.""", + ) + path: Optional[str] = Field( + default=None, description="""Path to access on the HTTP server.""" + ) + port: Optional[int] = Field( + default=None, + description="""Number of the port to access on the container. Number must be in the range 1 to 65535.""", + ) + scheme: Optional[str] = Field( + default=None, + description="""Scheme to use for connecting to the host. Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS".""", + ) + + +class ProbeHttpGetActionDict(TypedDict, total=False): + """HttpGetAction describes an action based on HTTP Get requests.""" + + host: Optional[str] + """Host name to connect to, defaults to the model serving container's IP. You probably want to set "Host" in httpHeaders instead.""" + + http_headers: Optional[list[ProbeHttpHeaderDict]] + """Custom headers to set in the request. HTTP allows repeated headers.""" + + path: Optional[str] + """Path to access on the HTTP server.""" + + port: Optional[int] + """Number of the port to access on the container. Number must be in the range 1 to 65535.""" + + scheme: Optional[str] + """Scheme to use for connecting to the host. Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS".""" + + +ProbeHttpGetActionOrDict = Union[ProbeHttpGetAction, ProbeHttpGetActionDict] + + +class ProbeTcpSocketAction(_common.BaseModel): + """TcpSocketAction probes the health of a container by opening a TCP socket connection.""" + + host: Optional[str] = Field( + default=None, + description="""Optional: Host name to connect to, defaults to the model serving container's IP.""", + ) + port: Optional[int] = Field( + default=None, + description="""Number of the port to access on the container. Number must be in the range 1 to 65535.""", + ) + + +class ProbeTcpSocketActionDict(TypedDict, total=False): + """TcpSocketAction probes the health of a container by opening a TCP socket connection.""" + + host: Optional[str] + """Optional: Host name to connect to, defaults to the model serving container's IP.""" + + port: Optional[int] + """Number of the port to access on the container. Number must be in the range 1 to 65535.""" + + +ProbeTcpSocketActionOrDict = Union[ProbeTcpSocketAction, ProbeTcpSocketActionDict] + + +class Probe(_common.BaseModel): + """Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.""" + + exec: Optional[ProbeExecAction] = Field( + default=None, + description="""ExecAction probes the health of a container by executing a command.""", + ) + failure_threshold: Optional[int] = Field( + default=None, + description="""Number of consecutive failures before the probe is considered failed. Defaults to 3. Minimum value is 1. Maps to Kubernetes probe argument 'failureThreshold'.""", + ) + grpc: Optional[ProbeGrpcAction] = Field( + default=None, + description="""GrpcAction probes the health of a container by sending a gRPC request.""", + ) + http_get: Optional[ProbeHttpGetAction] = Field( + default=None, + description="""HttpGetAction probes the health of a container by sending an HTTP GET request.""", + ) + initial_delay_seconds: Optional[int] = Field( + default=None, + description="""Number of seconds to wait before starting the probe. Defaults to 0. Minimum value is 0. Maps to Kubernetes probe argument 'initialDelaySeconds'.""", + ) + period_seconds: Optional[int] = Field( + default=None, + description="""How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Must be less than timeout_seconds. Maps to Kubernetes probe argument 'periodSeconds'.""", + ) + success_threshold: Optional[int] = Field( + default=None, + description="""Number of consecutive successes before the probe is considered successful. Defaults to 1. Minimum value is 1. Maps to Kubernetes probe argument 'successThreshold'.""", + ) + tcp_socket: Optional[ProbeTcpSocketAction] = Field( + default=None, + description="""TcpSocketAction probes the health of a container by opening a TCP socket connection.""", + ) + timeout_seconds: Optional[int] = Field( + default=None, + description="""Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Must be greater or equal to period_seconds. Maps to Kubernetes probe argument 'timeoutSeconds'.""", + ) + + +class ProbeDict(TypedDict, total=False): + """Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.""" + + exec: Optional[ProbeExecActionDict] + """ExecAction probes the health of a container by executing a command.""" + + failure_threshold: Optional[int] + """Number of consecutive failures before the probe is considered failed. Defaults to 3. Minimum value is 1. Maps to Kubernetes probe argument 'failureThreshold'.""" + + grpc: Optional[ProbeGrpcActionDict] + """GrpcAction probes the health of a container by sending a gRPC request.""" + + http_get: Optional[ProbeHttpGetActionDict] + """HttpGetAction probes the health of a container by sending an HTTP GET request.""" + + initial_delay_seconds: Optional[int] + """Number of seconds to wait before starting the probe. Defaults to 0. Minimum value is 0. Maps to Kubernetes probe argument 'initialDelaySeconds'.""" + + period_seconds: Optional[int] + """How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Must be less than timeout_seconds. Maps to Kubernetes probe argument 'periodSeconds'.""" + + success_threshold: Optional[int] + """Number of consecutive successes before the probe is considered successful. Defaults to 1. Minimum value is 1. Maps to Kubernetes probe argument 'successThreshold'.""" + + tcp_socket: Optional[ProbeTcpSocketActionDict] + """TcpSocketAction probes the health of a container by opening a TCP socket connection.""" + + timeout_seconds: Optional[int] + """Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Must be greater or equal to period_seconds. Maps to Kubernetes probe argument 'timeoutSeconds'.""" + + +ProbeOrDict = Union[Probe, ProbeDict] + + +class ModelContainerSpec(_common.BaseModel): + """Specification of a container for serving predictions. Some fields in this message correspond to fields in the [Kubernetes Container v1 core specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + args: Optional[list[str]] = Field( + default=None, + description="""Immutable. Specifies arguments for the command that runs when the container starts. This overrides the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify this field as an array of executable and arguments, similar to a Docker `CMD`'s "default parameters" form. If you don't specify this field but do specify the command field, then the command from the `command` field runs without any additional arguments. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). If you don't specify this field and don't specify the `command` field, then the container's [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and `CMD` determine what runs based on their default behavior. See the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `args` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", + ) + command: Optional[list[str]] = Field( + default=None, + description="""Immutable. Specifies the command that runs when the container starts. This overrides the container's [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). Specify this field as an array of executable and arguments, similar to a Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. If you do not specify this field, then the container's `ENTRYPOINT` runs, in conjunction with the args field or the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), if either exists. If this field is not specified and the container does not have an `ENTRYPOINT`, then refer to the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). If you specify this field, then you can also specify the `args` field to provide additional arguments for this command. However, if you specify this field, then the container's `CMD` is ignored. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `command` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", + ) + deployment_timeout: Optional[str] = Field( + default=None, + description="""Immutable. Deployment timeout. Limit for deployment timeout is 2 hours.""", + ) + env: Optional[list[EnvVar]] = Field( + default=None, + description="""Immutable. List of environment variables to set in the container. After the container starts running, code running in the container can read these environment variables. Additionally, the command and args fields can reference these variables. Later entries in this list can also reference earlier entries. For example, the following example sets the variable `VAR_2` to have the value `foo bar`: ```json [ { "name": "VAR_1", "value": "foo" }, { "name": "VAR_2", "value": "$(VAR_1) bar" } ] ``` If you switch the order of the variables in the example, then the expansion does not occur. This field corresponds to the `env` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", + ) + grpc_ports: Optional[list[Port]] = Field( + default=None, + description="""Immutable. List of ports to expose from the container. Vertex AI sends gRPC prediction requests that it receives to the first port on this list. Vertex AI also sends liveness and health checks to this port. If you do not specify this field, gRPC requests to the container will be disabled. Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers v1 core API.""", + ) + health_probe: Optional[Probe] = Field( + default=None, + description="""Immutable. Specification for Kubernetes readiness probe.""", + ) + health_route: Optional[str] = Field( + default=None, + description="""Immutable. HTTP path on the container to send health checks to. Vertex AI intermittently sends GET requests to this path on the container's IP address and port to check that the container is healthy. Read more about [health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). For example, if you set this field to `/bar`, then Vertex AI intermittently sends a GET request to the `/bar` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/ DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""", + ) + image_uri: Optional[str] = Field( + default=None, + description="""Required. Immutable. URI of the Docker image to be used as the custom container for serving predictions. This URI must identify an image in Artifact Registry or Container Registry. Learn more about the [container publishing requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), including permissions requirements for the Vertex AI Service Agent. The container image is ingested upon ModelService.UploadModel, stored internally, and this original path is afterwards not used. To learn about the requirements for the Docker image itself, see [Custom container requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). You can use the URI to one of Vertex AI's [pre-built container images for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) in this field.""", + ) + invoke_route_prefix: Optional[str] = Field( + default=None, + description="""Immutable. Invoke route prefix for the custom container. "/*" is the only supported value right now. By setting this field, any non-root route on this model will be accessible with invoke http call eg: "/invoke/foo/bar", however the [PredictionService.Invoke] RPC is not supported yet. Only one of `predict_route` or `invoke_route_prefix` can be set, and we default to using `predict_route` if this field is not set. If this field is set, the Model can only be deployed to dedicated endpoint.""", + ) + liveness_probe: Optional[Probe] = Field( + default=None, + description="""Immutable. Specification for Kubernetes liveness probe.""", + ) + ports: Optional[list[Port]] = Field( + default=None, + description="""Immutable. List of ports to expose from the container. Vertex AI sends any prediction requests that it receives to the first port on this list. Vertex AI also sends [liveness and health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) to this port. If you do not specify this field, it defaults to following value: ```json [ { "containerPort": 8080 } ] ``` Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", + ) + predict_route: Optional[str] = Field( + default=None, + description="""Immutable. HTTP path on the container to send prediction requests to. Vertex AI forwards requests sent using projects.locations.endpoints.predict to this path on the container's IP address and port. Vertex AI then returns the container's response in the API response. For example, if you set this field to `/foo`, then when Vertex AI receives a prediction request, it forwards the request body in a POST request to the `/foo` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""", + ) + shared_memory_size_mb: Optional[int] = Field( + default=None, + description="""Immutable. The amount of the VM memory to reserve as the shared memory for the model in megabytes.""", + ) + startup_probe: Optional[Probe] = Field( + default=None, + description="""Immutable. Specification for Kubernetes startup probe.""", + ) + + +class ModelContainerSpecDict(TypedDict, total=False): + """Specification of a container for serving predictions. Some fields in this message correspond to fields in the [Kubernetes Container v1 core specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + args: Optional[list[str]] + """Immutable. Specifies arguments for the command that runs when the container starts. This overrides the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify this field as an array of executable and arguments, similar to a Docker `CMD`'s "default parameters" form. If you don't specify this field but do specify the command field, then the command from the `command` field runs without any additional arguments. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). If you don't specify this field and don't specify the `command` field, then the container's [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and `CMD` determine what runs based on their default behavior. See the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `args` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + command: Optional[list[str]] + """Immutable. Specifies the command that runs when the container starts. This overrides the container's [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). Specify this field as an array of executable and arguments, similar to a Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. If you do not specify this field, then the container's `ENTRYPOINT` runs, in conjunction with the args field or the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), if either exists. If this field is not specified and the container does not have an `ENTRYPOINT`, then refer to the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). If you specify this field, then you can also specify the `args` field to provide additional arguments for this command. However, if you specify this field, then the container's `CMD` is ignored. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `command` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + deployment_timeout: Optional[str] + """Immutable. Deployment timeout. Limit for deployment timeout is 2 hours.""" + + env: Optional[list[EnvVarDict]] + """Immutable. List of environment variables to set in the container. After the container starts running, code running in the container can read these environment variables. Additionally, the command and args fields can reference these variables. Later entries in this list can also reference earlier entries. For example, the following example sets the variable `VAR_2` to have the value `foo bar`: ```json [ { "name": "VAR_1", "value": "foo" }, { "name": "VAR_2", "value": "$(VAR_1) bar" } ] ``` If you switch the order of the variables in the example, then the expansion does not occur. This field corresponds to the `env` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + grpc_ports: Optional[list[PortDict]] + """Immutable. List of ports to expose from the container. Vertex AI sends gRPC prediction requests that it receives to the first port on this list. Vertex AI also sends liveness and health checks to this port. If you do not specify this field, gRPC requests to the container will be disabled. Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers v1 core API.""" + + health_probe: Optional[ProbeDict] + """Immutable. Specification for Kubernetes readiness probe.""" + + health_route: Optional[str] + """Immutable. HTTP path on the container to send health checks to. Vertex AI intermittently sends GET requests to this path on the container's IP address and port to check that the container is healthy. Read more about [health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). For example, if you set this field to `/bar`, then Vertex AI intermittently sends a GET request to the `/bar` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/ DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""" + + image_uri: Optional[str] + """Required. Immutable. URI of the Docker image to be used as the custom container for serving predictions. This URI must identify an image in Artifact Registry or Container Registry. Learn more about the [container publishing requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), including permissions requirements for the Vertex AI Service Agent. The container image is ingested upon ModelService.UploadModel, stored internally, and this original path is afterwards not used. To learn about the requirements for the Docker image itself, see [Custom container requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). You can use the URI to one of Vertex AI's [pre-built container images for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) in this field.""" + + invoke_route_prefix: Optional[str] + """Immutable. Invoke route prefix for the custom container. "/*" is the only supported value right now. By setting this field, any non-root route on this model will be accessible with invoke http call eg: "/invoke/foo/bar", however the [PredictionService.Invoke] RPC is not supported yet. Only one of `predict_route` or `invoke_route_prefix` can be set, and we default to using `predict_route` if this field is not set. If this field is set, the Model can only be deployed to dedicated endpoint.""" + + liveness_probe: Optional[ProbeDict] + """Immutable. Specification for Kubernetes liveness probe.""" + + ports: Optional[list[PortDict]] + """Immutable. List of ports to expose from the container. Vertex AI sends any prediction requests that it receives to the first port on this list. Vertex AI also sends [liveness and health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) to this port. If you do not specify this field, it defaults to following value: ```json [ { "containerPort": 8080 } ] ``` Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + predict_route: Optional[str] + """Immutable. HTTP path on the container to send prediction requests to. Vertex AI forwards requests sent using projects.locations.endpoints.predict to this path on the container's IP address and port. Vertex AI then returns the container's response in the API response. For example, if you set this field to `/foo`, then when Vertex AI receives a prediction request, it forwards the request body in a POST request to the `/foo` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""" + + shared_memory_size_mb: Optional[int] + """Immutable. The amount of the VM memory to reserve as the shared memory for the model in megabytes.""" + + startup_probe: Optional[ProbeDict] + """Immutable. Specification for Kubernetes startup probe.""" + + +ModelContainerSpecOrDict = Union[ModelContainerSpec, ModelContainerSpecDict] + + +class AutoscalingMetricSpec(_common.BaseModel): + """The metric specification that defines the target resource utilization (CPU utilization, accelerator's duty cycle, and so on) for calculating the desired replica count.""" + + metric_name: Optional[str] = Field( + default=None, + description="""Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count` * `pubsub.googleapis.com/subscription/num_undelivered_messages` * `prometheus.googleapis.com/vertex_dcgm_fi_dev_gpu_util` * `prometheus.googleapis.com/vertex_vllm_gpu_cache_usage_perc` * `prometheus.googleapis.com/vertex_vllm_num_requests_waiting`""", + ) + monitored_resource_labels: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info""", + ) + target: Optional[int] = Field( + default=None, + description="""The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.""", + ) + + +class AutoscalingMetricSpecDict(TypedDict, total=False): + """The metric specification that defines the target resource utilization (CPU utilization, accelerator's duty cycle, and so on) for calculating the desired replica count.""" + + metric_name: Optional[str] + """Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count` * `pubsub.googleapis.com/subscription/num_undelivered_messages` * `prometheus.googleapis.com/vertex_dcgm_fi_dev_gpu_util` * `prometheus.googleapis.com/vertex_vllm_gpu_cache_usage_perc` * `prometheus.googleapis.com/vertex_vllm_num_requests_waiting`""" + + monitored_resource_labels: Optional[dict[str, str]] + """Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info""" + + target: Optional[int] + """The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.""" + + +AutoscalingMetricSpecOrDict = Union[AutoscalingMetricSpec, AutoscalingMetricSpecDict] + + +class FlexStart(_common.BaseModel): + """FlexStart is used to schedule the deployment workload on DWS resource. It contains the max duration of the deployment.""" + + max_runtime_duration: Optional[str] = Field( + default=None, + description="""The max duration of the deployment is max_runtime_duration. The deployment will be terminated after the duration. The max_runtime_duration can be set up to 7 days.""", + ) + + +class FlexStartDict(TypedDict, total=False): + """FlexStart is used to schedule the deployment workload on DWS resource. It contains the max duration of the deployment.""" + + max_runtime_duration: Optional[str] + """The max duration of the deployment is max_runtime_duration. The deployment will be terminated after the duration. The max_runtime_duration can be set up to 7 days.""" + + +FlexStartOrDict = Union[FlexStart, FlexStartDict] + + +class DedicatedResourcesScaleToZeroSpec(_common.BaseModel): + """Specification for scale-to-zero feature.""" + + idle_scaledown_period: Optional[str] = Field( + default=None, + description="""Optional. Duration of no traffic before scaling to zero. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""", + ) + min_scaleup_period: Optional[str] = Field( + default=None, + description="""Optional. Minimum duration that a deployment will be scaled up before traffic is evaluated for potential scale-down. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""", + ) + + +class DedicatedResourcesScaleToZeroSpecDict(TypedDict, total=False): + """Specification for scale-to-zero feature.""" + + idle_scaledown_period: Optional[str] + """Optional. Duration of no traffic before scaling to zero. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""" + + min_scaleup_period: Optional[str] + """Optional. Minimum duration that a deployment will be scaled up before traffic is evaluated for potential scale-down. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""" + + +DedicatedResourcesScaleToZeroSpecOrDict = Union[ + DedicatedResourcesScaleToZeroSpec, DedicatedResourcesScaleToZeroSpecDict +] + + +class DedicatedResources(_common.BaseModel): + """A description of resources that are dedicated to a DeployedModel or DeployedIndex, and that need a higher degree of manual configuration.""" + + autoscaling_metric_specs: Optional[list[AutoscalingMetricSpec]] = Field( + default=None, + description="""Immutable. The metric specifications that overrides a resource utilization metric (CPU utilization, accelerator's duty cycle, and so on) target value (default to 60 if not set). At most one entry is allowed per metric. If machine_spec.accelerator_count is above 0, the autoscaling will be based on both CPU utilization and accelerator's duty cycle metrics and scale up when either metrics exceeds its target value while scale down if both metrics are under their target value. The default target value is 60 for both metrics. If machine_spec.accelerator_count is 0, the autoscaling will be based on CPU utilization metric only with default target value 60 if not explicitly set. For example, in the case of Online Prediction, if you want to override target CPU utilization to 80, you should set autoscaling_metric_specs.metric_name to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and autoscaling_metric_specs.target to `80`.""", + ) + flex_start: Optional[FlexStart] = Field( + default=None, + description="""Optional. Immutable. If set, use DWS resource to schedule the deployment workload. reference: (https://cloud.google.com/blog/products/compute/introducing-dynamic-workload-scheduler)""", + ) + initial_replica_count: Optional[int] = Field( + default=None, + description="""Immutable. Number of initial replicas being deployed on when scaling the workload up from zero or when creating the workload in case min_replica_count = 0. When min_replica_count > 0 (meaning that the scale-to-zero feature is not enabled), initial_replica_count should not be set. When min_replica_count = 0 (meaning that the scale-to-zero feature is enabled), initial_replica_count should be larger than zero, but no greater than max_replica_count.""", + ) + machine_spec: Optional[MachineSpec] = Field( + default=None, + description="""Required. Immutable. The specification of a single machine being used.""", + ) + max_replica_count: Optional[int] = Field( + default=None, + description="""Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, will use min_replica_count as the default value. The value of this field impacts the charge against Vertex CPU and GPU quotas. Specifically, you will be charged for (max_replica_count * number of cores in the selected machine type) and (max_replica_count * number of GPUs per replica in the selected machine type).""", + ) + min_replica_count: Optional[int] = Field( + default=None, + description="""Required. Immutable. The minimum number of machine replicas that will be always deployed on. This value must be greater than or equal to 1. If traffic increases, it may dynamically be deployed onto more replicas, and as traffic decreases, some of these extra replicas may be freed.""", + ) + required_replica_count: Optional[int] = Field( + default=None, + description="""Optional. Number of required available replicas for the deployment to succeed. This field is only needed when partial deployment/mutation is desired. If set, the deploy/mutate operation will succeed once available_replica_count reaches required_replica_count, and the rest of the replicas will be retried. If not set, the default required_replica_count will be min_replica_count.""", + ) + scale_to_zero_spec: Optional[DedicatedResourcesScaleToZeroSpec] = Field( + default=None, + description="""Optional. Specification for scale-to-zero feature.""", + ) + spot: Optional[bool] = Field( + default=None, + description="""Optional. If true, schedule the deployment workload on [spot VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).""", + ) + + +class DedicatedResourcesDict(TypedDict, total=False): + """A description of resources that are dedicated to a DeployedModel or DeployedIndex, and that need a higher degree of manual configuration.""" + + autoscaling_metric_specs: Optional[list[AutoscalingMetricSpecDict]] + """Immutable. The metric specifications that overrides a resource utilization metric (CPU utilization, accelerator's duty cycle, and so on) target value (default to 60 if not set). At most one entry is allowed per metric. If machine_spec.accelerator_count is above 0, the autoscaling will be based on both CPU utilization and accelerator's duty cycle metrics and scale up when either metrics exceeds its target value while scale down if both metrics are under their target value. The default target value is 60 for both metrics. If machine_spec.accelerator_count is 0, the autoscaling will be based on CPU utilization metric only with default target value 60 if not explicitly set. For example, in the case of Online Prediction, if you want to override target CPU utilization to 80, you should set autoscaling_metric_specs.metric_name to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and autoscaling_metric_specs.target to `80`.""" + + flex_start: Optional[FlexStartDict] + """Optional. Immutable. If set, use DWS resource to schedule the deployment workload. reference: (https://cloud.google.com/blog/products/compute/introducing-dynamic-workload-scheduler)""" + + initial_replica_count: Optional[int] + """Immutable. Number of initial replicas being deployed on when scaling the workload up from zero or when creating the workload in case min_replica_count = 0. When min_replica_count > 0 (meaning that the scale-to-zero feature is not enabled), initial_replica_count should not be set. When min_replica_count = 0 (meaning that the scale-to-zero feature is enabled), initial_replica_count should be larger than zero, but no greater than max_replica_count.""" + + machine_spec: Optional[MachineSpecDict] + """Required. Immutable. The specification of a single machine being used.""" + + max_replica_count: Optional[int] + """Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, will use min_replica_count as the default value. The value of this field impacts the charge against Vertex CPU and GPU quotas. Specifically, you will be charged for (max_replica_count * number of cores in the selected machine type) and (max_replica_count * number of GPUs per replica in the selected machine type).""" + + min_replica_count: Optional[int] + """Required. Immutable. The minimum number of machine replicas that will be always deployed on. This value must be greater than or equal to 1. If traffic increases, it may dynamically be deployed onto more replicas, and as traffic decreases, some of these extra replicas may be freed.""" + + required_replica_count: Optional[int] + """Optional. Number of required available replicas for the deployment to succeed. This field is only needed when partial deployment/mutation is desired. If set, the deploy/mutate operation will succeed once available_replica_count reaches required_replica_count, and the rest of the replicas will be retried. If not set, the default required_replica_count will be min_replica_count.""" + + scale_to_zero_spec: Optional[DedicatedResourcesScaleToZeroSpecDict] + """Optional. Specification for scale-to-zero feature.""" + + spot: Optional[bool] + """Optional. If true, schedule the deployment workload on [spot VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).""" + + +DedicatedResourcesOrDict = Union[DedicatedResources, DedicatedResourcesDict] + + +class PublisherModelCallToActionDeployDeployMetadata(_common.BaseModel): + """Metadata information about the deployment for managing deployment config.""" + + labels: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. Labels for the deployment config. For managing deployment config like verifying, source of deployment config, etc.""", + ) + sample_request: Optional[str] = Field( + default=None, description="""Optional. Sample request for deployed endpoint.""" + ) + + +class PublisherModelCallToActionDeployDeployMetadataDict(TypedDict, total=False): + """Metadata information about the deployment for managing deployment config.""" + + labels: Optional[dict[str, str]] + """Optional. Labels for the deployment config. For managing deployment config like verifying, source of deployment config, etc.""" + + sample_request: Optional[str] + """Optional. Sample request for deployed endpoint.""" + + +PublisherModelCallToActionDeployDeployMetadataOrDict = Union[ + PublisherModelCallToActionDeployDeployMetadata, + PublisherModelCallToActionDeployDeployMetadataDict, +] + + +class LargeModelReference(_common.BaseModel): + """Contains information about the Large Model.""" + + name: Optional[str] = Field( + default=None, + description="""Required. The unique name of the large Foundation or pre-built model. Like "chat-bison", "text-bison". Or model name with version ID, like "chat-bison@001", "text-bison@005", etc.""", + ) + + +class LargeModelReferenceDict(TypedDict, total=False): + """Contains information about the Large Model.""" + + name: Optional[str] + """Required. The unique name of the large Foundation or pre-built model. Like "chat-bison", "text-bison". Or model name with version ID, like "chat-bison@001", "text-bison@005", etc.""" + + +LargeModelReferenceOrDict = Union[LargeModelReference, LargeModelReferenceDict] + + +class PublisherModelCallToActionDeploy(_common.BaseModel): + """Model metadata that is needed for UploadModel or DeployModel/CreateEndpoint requests.""" + + artifact_uri: Optional[str] = Field( + default=None, + description="""Optional. The path to the directory containing the Model artifact and any of its supporting files.""", + ) + automatic_resources: Optional[AutomaticResources] = Field( + default=None, + description="""A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration.""", + ) + container_spec: Optional[ModelContainerSpec] = Field( + default=None, + description="""Optional. The specification of the container that is to be used when deploying this Model in Vertex AI. Not present for Large Models.""", + ) + dedicated_resources: Optional[DedicatedResources] = Field( + default=None, + description="""A description of resources that are dedicated to the DeployedModel, and that need a higher degree of manual configuration.""", + ) + deploy_metadata: Optional[PublisherModelCallToActionDeployDeployMetadata] = Field( + default=None, + description="""Optional. Metadata information about this deployment config.""", + ) + deploy_task_name: Optional[str] = Field( + default=None, + description="""Optional. The name of the deploy task (e.g., "text to image generation").""", + ) + large_model_reference: Optional[LargeModelReference] = Field( + default=None, + description="""Optional. Large model reference. When this is set, model_artifact_spec is not needed.""", + ) + model_display_name: Optional[str] = Field( + default=None, description="""Optional. Default model display name.""" + ) + public_artifact_uri: Optional[str] = Field( + default=None, + description="""Optional. The signed URI for ephemeral Cloud Storage access to model artifact.""", + ) + shared_resources: Optional[str] = Field( + default=None, + description="""The resource name of the shared DeploymentResourcePool to deploy on. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`""", + ) + title: Optional[str] = Field( + default=None, + description="""Required. The title of the regional resource reference.""", + ) + + +class PublisherModelCallToActionDeployDict(TypedDict, total=False): + """Model metadata that is needed for UploadModel or DeployModel/CreateEndpoint requests.""" + + artifact_uri: Optional[str] + """Optional. The path to the directory containing the Model artifact and any of its supporting files.""" + + automatic_resources: Optional[AutomaticResourcesDict] + """A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration.""" + + container_spec: Optional[ModelContainerSpecDict] + """Optional. The specification of the container that is to be used when deploying this Model in Vertex AI. Not present for Large Models.""" + + dedicated_resources: Optional[DedicatedResourcesDict] + """A description of resources that are dedicated to the DeployedModel, and that need a higher degree of manual configuration.""" + + deploy_metadata: Optional[PublisherModelCallToActionDeployDeployMetadataDict] + """Optional. Metadata information about this deployment config.""" + + deploy_task_name: Optional[str] + """Optional. The name of the deploy task (e.g., "text to image generation").""" + + large_model_reference: Optional[LargeModelReferenceDict] + """Optional. Large model reference. When this is set, model_artifact_spec is not needed.""" + + model_display_name: Optional[str] + """Optional. Default model display name.""" + + public_artifact_uri: Optional[str] + """Optional. The signed URI for ephemeral Cloud Storage access to model artifact.""" + + shared_resources: Optional[str] + """The resource name of the shared DeploymentResourcePool to deploy on. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`""" + + title: Optional[str] + """Required. The title of the regional resource reference.""" + + +PublisherModelCallToActionDeployOrDict = Union[ + PublisherModelCallToActionDeploy, PublisherModelCallToActionDeployDict +] + + +class PublisherModelCallToActionDeployGke(_common.BaseModel): + """Configurations for PublisherModel GKE deployment""" + + gke_yaml_configs: Optional[list[str]] = Field( + default=None, + description="""Optional. GKE deployment configuration in yaml format.""", + ) + + +class PublisherModelCallToActionDeployGkeDict(TypedDict, total=False): + """Configurations for PublisherModel GKE deployment""" + + gke_yaml_configs: Optional[list[str]] + """Optional. GKE deployment configuration in yaml format.""" + + +PublisherModelCallToActionDeployGkeOrDict = Union[ + PublisherModelCallToActionDeployGke, PublisherModelCallToActionDeployGkeDict +] + + +class PublisherModelCallToActionDeployVertex(_common.BaseModel): + """Multiple setups to deploy the PublisherModel.""" + + multi_deploy_vertex: Optional[list[PublisherModelCallToActionDeploy]] = Field( + default=None, description="""Optional. One click deployment configurations.""" + ) + + +class PublisherModelCallToActionDeployVertexDict(TypedDict, total=False): + """Multiple setups to deploy the PublisherModel.""" + + multi_deploy_vertex: Optional[list[PublisherModelCallToActionDeployDict]] + """Optional. One click deployment configurations.""" + + +PublisherModelCallToActionDeployVertexOrDict = Union[ + PublisherModelCallToActionDeployVertex, PublisherModelCallToActionDeployVertexDict +] + + +class PublisherModelCallToActionOpenFineTuningPipelines(_common.BaseModel): + """Open fine tuning pipelines.""" + + fine_tuning_pipelines: Optional[ + list[PublisherModelCallToActionRegionalResourceReferences] + ] = Field( + default=None, + description="""Required. Regional resource references to fine tuning pipelines.""", + ) + + +class PublisherModelCallToActionOpenFineTuningPipelinesDict(TypedDict, total=False): + """Open fine tuning pipelines.""" + + fine_tuning_pipelines: Optional[ + list[PublisherModelCallToActionRegionalResourceReferencesDict] + ] + """Required. Regional resource references to fine tuning pipelines.""" + + +PublisherModelCallToActionOpenFineTuningPipelinesOrDict = Union[ + PublisherModelCallToActionOpenFineTuningPipelines, + PublisherModelCallToActionOpenFineTuningPipelinesDict, +] + + +class PublisherModelCallToActionOpenNotebooks(_common.BaseModel): + """Open notebooks.""" + + notebooks: Optional[list[PublisherModelCallToActionRegionalResourceReferences]] = ( + Field( + default=None, + description="""Required. Regional resource references to notebooks.""", + ) + ) + + +class PublisherModelCallToActionOpenNotebooksDict(TypedDict, total=False): + """Open notebooks.""" + + notebooks: Optional[list[PublisherModelCallToActionRegionalResourceReferencesDict]] + """Required. Regional resource references to notebooks.""" + + +PublisherModelCallToActionOpenNotebooksOrDict = Union[ + PublisherModelCallToActionOpenNotebooks, PublisherModelCallToActionOpenNotebooksDict +] + + +class PublisherModelDocumentation(_common.BaseModel): + """A named piece of documentation.""" + + content: Optional[str] = Field( + default=None, + description="""Required. Content of this piece of document (in Markdown format).""", + ) + title: Optional[str] = Field( + default=None, + description="""Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA, NODE.JS, etc..""", + ) + + +class PublisherModelDocumentationDict(TypedDict, total=False): + """A named piece of documentation.""" + + content: Optional[str] + """Required. Content of this piece of document (in Markdown format).""" + + title: Optional[str] + """Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA, NODE.JS, etc..""" + + +PublisherModelDocumentationOrDict = Union[ + PublisherModelDocumentation, PublisherModelDocumentationDict +] + + +class PublisherModelCallToActionViewRestApi(_common.BaseModel): + """Rest API docs.""" + + documentations: Optional[list[PublisherModelDocumentation]] = Field( + default=None, description="""Required.""" + ) + title: Optional[str] = Field( + default=None, description="""Required. The title of the view rest API.""" + ) + + +class PublisherModelCallToActionViewRestApiDict(TypedDict, total=False): + """Rest API docs.""" + + documentations: Optional[list[PublisherModelDocumentationDict]] + """Required.""" + + title: Optional[str] + """Required. The title of the view rest API.""" + + +PublisherModelCallToActionViewRestApiOrDict = Union[ + PublisherModelCallToActionViewRestApi, PublisherModelCallToActionViewRestApiDict +] + + +class PublisherModelCallToAction(_common.BaseModel): + """Actions could take on this Publisher Model.""" + + create_application: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Create application using the PublisherModel.""", + ) + deploy: Optional[PublisherModelCallToActionDeploy] = Field( + default=None, + description="""Optional. Deploy the PublisherModel to Vertex Endpoint.""", + ) + deploy_gke: Optional[PublisherModelCallToActionDeployGke] = Field( + default=None, + description="""Optional. Deploy PublisherModel to Google Kubernetes Engine.""", + ) + multi_deploy_vertex: Optional[PublisherModelCallToActionDeployVertex] = Field( + default=None, + description="""Optional. Multiple setups to deploy the PublisherModel to Vertex Endpoint.""", + ) + open_evaluation_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Open evaluation pipeline of the PublisherModel.""", + ) + open_fine_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Open fine-tuning pipeline of the PublisherModel.""", + ) + open_fine_tuning_pipelines: Optional[ + PublisherModelCallToActionOpenFineTuningPipelines + ] = Field( + default=None, + description="""Optional. Open fine-tuning pipelines of the PublisherModel.""", + ) + open_generation_ai_studio: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field(default=None, description="""Optional. Open in Generation AI Studio.""") + open_genie: Optional[PublisherModelCallToActionRegionalResourceReferences] = Field( + default=None, description="""Optional. Open Genie / Playground.""" + ) + open_notebook: Optional[PublisherModelCallToActionRegionalResourceReferences] = ( + Field( + default=None, + description="""Optional. Open notebook of the PublisherModel.""", + ) + ) + open_notebooks: Optional[PublisherModelCallToActionOpenNotebooks] = Field( + default=None, description="""Optional. Open notebooks of the PublisherModel.""" + ) + open_prompt_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Open prompt-tuning pipeline of the PublisherModel.""", + ) + request_access: Optional[PublisherModelCallToActionRegionalResourceReferences] = ( + Field(default=None, description="""Optional. Request for access.""") + ) + view_rest_api: Optional[PublisherModelCallToActionViewRestApi] = Field( + default=None, description="""Optional. To view Rest API docs.""" + ) + + +class PublisherModelCallToActionDict(TypedDict, total=False): + """Actions could take on this Publisher Model.""" + + create_application: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Create application using the PublisherModel.""" + + deploy: Optional[PublisherModelCallToActionDeployDict] + """Optional. Deploy the PublisherModel to Vertex Endpoint.""" + + deploy_gke: Optional[PublisherModelCallToActionDeployGkeDict] + """Optional. Deploy PublisherModel to Google Kubernetes Engine.""" + + multi_deploy_vertex: Optional[PublisherModelCallToActionDeployVertexDict] + """Optional. Multiple setups to deploy the PublisherModel to Vertex Endpoint.""" + + open_evaluation_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open evaluation pipeline of the PublisherModel.""" + + open_fine_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open fine-tuning pipeline of the PublisherModel.""" + + open_fine_tuning_pipelines: Optional[ + PublisherModelCallToActionOpenFineTuningPipelinesDict + ] + """Optional. Open fine-tuning pipelines of the PublisherModel.""" + + open_generation_ai_studio: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open in Generation AI Studio.""" + + open_genie: Optional[PublisherModelCallToActionRegionalResourceReferencesDict] + """Optional. Open Genie / Playground.""" + + open_notebook: Optional[PublisherModelCallToActionRegionalResourceReferencesDict] + """Optional. Open notebook of the PublisherModel.""" + + open_notebooks: Optional[PublisherModelCallToActionOpenNotebooksDict] + """Optional. Open notebooks of the PublisherModel.""" + + open_prompt_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open prompt-tuning pipeline of the PublisherModel.""" + + request_access: Optional[PublisherModelCallToActionRegionalResourceReferencesDict] + """Optional. Request for access.""" + + view_rest_api: Optional[PublisherModelCallToActionViewRestApiDict] + """Optional. To view Rest API docs.""" + + +PublisherModelCallToActionOrDict = Union[ + PublisherModelCallToAction, PublisherModelCallToActionDict +] + + +class PublisherModel(_common.BaseModel): + """Publisher model from Model Garden.""" + + frameworks: Optional[list[str]] = Field( + default=None, + description="""Optional. Additional information about the model's Frameworks.""", + ) + launch_stage: Optional[LaunchStage] = Field( + default=None, + description="""Optional. Indicates the launch stage of the model.""", + ) + name: Optional[str] = Field( + default=None, + description="""Output only. Identifier. The resource name of the PublisherModel.""", + ) + open_source_category: Optional[OpenSourceCategory] = Field( + default=None, + description="""Required. Indicates the open source category of the publisher model.""", + ) + parent: Optional[PublisherModelParent] = Field( + default=None, + description="""Optional. The parent that this model was customized from. E.g., Vision API, Natural Language API, LaMDA, T5, etc. Foundation models don't have parents.""", + ) + predict_schemata: Optional[PredictSchemata] = Field( + default=None, + description="""Optional. The schemata that describes formats of the PublisherModel's predictions and explanations as given and returned via PredictionService.Predict.""", + ) + publisher_model_template: Optional[str] = Field( + default=None, + description="""Optional. Output only. Immutable. Used to indicate this model has a publisher model and provide the template of the publisher model resource name.""", + ) + supported_actions: Optional[PublisherModelCallToAction] = Field( + default=None, description="""Optional. Supported call-to-action options.""" + ) + version_id: Optional[str] = Field( + default=None, + description="""Output only. Immutable. The version ID of the PublisherModel. A new version is committed when a new model version is uploaded under an existing model id. It is an auto-incrementing decimal number in string representation.""", + ) + version_state: Optional[VersionState] = Field( + default=None, + description="""Optional. Indicates the state of the model version.""", + ) + + +class PublisherModelDict(TypedDict, total=False): + """Publisher model from Model Garden.""" + + frameworks: Optional[list[str]] + """Optional. Additional information about the model's Frameworks.""" + + launch_stage: Optional[LaunchStage] + """Optional. Indicates the launch stage of the model.""" + + name: Optional[str] + """Output only. Identifier. The resource name of the PublisherModel.""" + + open_source_category: Optional[OpenSourceCategory] + """Required. Indicates the open source category of the publisher model.""" + + parent: Optional[PublisherModelParentDict] + """Optional. The parent that this model was customized from. E.g., Vision API, Natural Language API, LaMDA, T5, etc. Foundation models don't have parents.""" + + predict_schemata: Optional[PredictSchemataDict] + """Optional. The schemata that describes formats of the PublisherModel's predictions and explanations as given and returned via PredictionService.Predict.""" + + publisher_model_template: Optional[str] + """Optional. Output only. Immutable. Used to indicate this model has a publisher model and provide the template of the publisher model resource name.""" + + supported_actions: Optional[PublisherModelCallToActionDict] + """Optional. Supported call-to-action options.""" + + version_id: Optional[str] + """Output only. Immutable. The version ID of the PublisherModel. A new version is committed when a new model version is uploaded under an existing model id. It is an auto-incrementing decimal number in string representation.""" + + version_state: Optional[VersionState] + """Optional. Indicates the state of the model version.""" + + +PublisherModelOrDict = Union[PublisherModel, PublisherModelDict] + + +class ListPublisherModelsResponse(_common.BaseModel): + """Response for listing publisher models.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field( + default=None, + description="""A token to retrieve next page of results. Pass to ListPublisherModels.page_token to obtain that page.""", + ) + publisher_models: Optional[list[PublisherModel]] = Field( + default=None, description="""List of PublisherModels in the requested page.""" + ) + + +class ListPublisherModelsResponseDict(TypedDict, total=False): + """Response for listing publisher models.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """A token to retrieve next page of results. Pass to ListPublisherModels.page_token to obtain that page.""" + + publisher_models: Optional[list[PublisherModelDict]] + """List of PublisherModels in the requested page.""" + + +ListPublisherModelsResponseOrDict = Union[ + ListPublisherModelsResponse, ListPublisherModelsResponseDict +] + + +class PromptOptimizerConfig(_common.BaseModel): + """VAPO Prompt Optimizer Config.""" + + config_path: Optional[str] = Field( + default=None, + description="""The gcs path to the config file, e.g. gs://bucket/config.json.""", + ) + service_account: Optional[str] = Field( + default=None, + description="""The service account to use for the custom job. Cannot be provided at the same time as service_account_project_number.""", + ) + service_account_project_number: Optional[Union[int, str]] = Field( + default=None, + description="""The project number used to construct the default service account:{service_account_project_number}-compute@developer.gserviceaccount.comCannot be provided at the same time as "service_account".""", + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Whether to wait for the job tocomplete. Ignored for async jobs.""", + ) + optimizer_job_display_name: Optional[str] = Field( + default=None, + description="""The display name of the optimization job. If not provided, a display name in the format of "vapo-optimizer-{timestamp}" will be used.""", + ) + + +class PromptOptimizerConfigDict(TypedDict, total=False): + """VAPO Prompt Optimizer Config.""" + + config_path: Optional[str] + """The gcs path to the config file, e.g. gs://bucket/config.json.""" + + service_account: Optional[str] + """The service account to use for the custom job. Cannot be provided at the same time as service_account_project_number.""" + + service_account_project_number: Optional[Union[int, str]] + """The project number used to construct the default service account:{service_account_project_number}-compute@developer.gserviceaccount.comCannot be provided at the same time as "service_account".""" + + wait_for_completion: Optional[bool] + """Whether to wait for the job tocomplete. Ignored for async jobs.""" + + optimizer_job_display_name: Optional[str] + """The display name of the optimization job. If not provided, a display name in the format of "vapo-optimizer-{timestamp}" will be used.""" + + +PromptOptimizerConfigOrDict = Union[PromptOptimizerConfig, PromptOptimizerConfigDict] + + +class OptimizeResponse(_common.BaseModel): + """Response for the optimize_prompt method.""" + + raw_text_response: Optional[str] = Field(default=None, description="""""") + parsed_response: Optional["ParsedResponseUnion"] = Field( + default=None, description="""""" + ) + + +class OptimizeResponseDict(TypedDict, total=False): + """Response for the optimize_prompt method.""" + + raw_text_response: Optional[str] + """""" + + parsed_response: Optional["ParsedResponseUnionDict"] + """""" + + +OptimizeResponseOrDict = Union[OptimizeResponse, OptimizeResponseDict] + + +class ContentMapContents(_common.BaseModel): + """Map of placeholder in metric prompt template to contents of model input.""" + + contents: Optional[list[genai_types.Content]] = Field( + default=None, description="""Contents of the model input.""" + ) + + +class ContentMapContentsDict(TypedDict, total=False): + """Map of placeholder in metric prompt template to contents of model input.""" + + contents: Optional[list[genai_types.ContentDict]] + """Contents of the model input.""" + + +ContentMapContentsOrDict = Union[ContentMapContents, ContentMapContentsDict] + + +class EvaluateMethodConfig(_common.BaseModel): + """Optional parameters for the evaluate method.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + dataset_schema: Optional[Literal["GEMINI", "FLATTEN", "OPENAI"]] = Field( + default=None, + description="""The schema to use for the dataset. + If not specified, the dataset schema will be inferred from the first + example in the dataset.""", + ) + dest: Optional[str] = Field( + default=None, description="""The destination path for the evaluation results.""" + ) + evaluation_service_qps: Optional[float] = Field( + default=None, + description="""The rate limit (queries per second) for calls to the + evaluation service. Defaults to 10. Increase this value if your + project has a higher EvaluateInstances API quota.""", + ) + + +class EvaluateMethodConfigDict(TypedDict, total=False): + """Optional parameters for the evaluate method.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + dataset_schema: Optional[Literal["GEMINI", "FLATTEN", "OPENAI"]] + """The schema to use for the dataset. + If not specified, the dataset schema will be inferred from the first + example in the dataset.""" + + dest: Optional[str] + """The destination path for the evaluation results.""" + + evaluation_service_qps: Optional[float] + """The rate limit (queries per second) for calls to the + evaluation service. Defaults to 10. Increase this value if your + project has a higher EvaluateInstances API quota.""" + + +EvaluateMethodConfigOrDict = Union[EvaluateMethodConfig, EvaluateMethodConfigDict] + + +class EvaluateDatasetConfig(_common.BaseModel): + """Config for evaluate instances.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class EvaluateDatasetConfigDict(TypedDict, total=False): + """Config for evaluate instances.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +EvaluateDatasetConfigOrDict = Union[EvaluateDatasetConfig, EvaluateDatasetConfigDict] + + +class EvaluateDatasetOperation(_common.BaseModel): + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[EvaluationDataset] = Field(default=None, description="""""") + + +class EvaluateDatasetOperationDict(TypedDict, total=False): + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + response: Optional[EvaluationDatasetDict] + """""" + + +EvaluateDatasetOperationOrDict = Union[ + EvaluateDatasetOperation, EvaluateDatasetOperationDict +] + + +class EvaluateDatasetRequestParameters(_common.BaseModel): + """Parameters for batch dataset evaluation.""" + + dataset: Optional[EvaluationDataset] = Field(default=None, description="""""") + metrics: Optional[list[Metric]] = Field(default=None, description="""""") + output_config: Optional[genai_types.OutputConfig] = Field( + default=None, description="""""" + ) + autorater_config: Optional[genai_types.AutoraterConfig] = Field( + default=None, + description="""Autorater config used for evaluation. Not applicable for predefined metrics (PredefinedMetricSpec); the server uses its own model configuration for predefined metrics and this field is ignored.""", + ) + config: Optional[EvaluateDatasetConfig] = Field(default=None, description="""""") + + +class EvaluateDatasetRequestParametersDict(TypedDict, total=False): + """Parameters for batch dataset evaluation.""" + + dataset: Optional[EvaluationDatasetDict] + """""" + + metrics: Optional[list[MetricDict]] + """""" + + output_config: Optional[genai_types.OutputConfigDict] + """""" + + autorater_config: Optional[genai_types.AutoraterConfigDict] + """Autorater config used for evaluation. Not applicable for predefined metrics (PredefinedMetricSpec); the server uses its own model configuration for predefined metrics and this field is ignored.""" + + config: Optional[EvaluateDatasetConfigDict] + """""" + + +EvaluateDatasetRequestParametersOrDict = Union[ + EvaluateDatasetRequestParameters, EvaluateDatasetRequestParametersDict +] + + +class ObservabilityEvalCase(_common.BaseModel): + """A single evaluation case instance for data stored in GCP Observability.""" + + input_src: Optional[str] = Field( + default=None, + description="""String containing the GCS reference to the GenAI input content.""", + ) + output_src: Optional[str] = Field( + default=None, + description="""String containing the GCS reference to the GenAI response content.""", + ) + system_instruction_src: Optional[str] = Field( + default=None, + description="""An optional string containing the GCS reference to the GenAI system instruction.""", + ) + api_client: Optional[Any] = Field( + default=None, description="""The underlying API client.""" + ) + + +class ObservabilityEvalCaseDict(TypedDict, total=False): + """A single evaluation case instance for data stored in GCP Observability.""" + + input_src: Optional[str] + """String containing the GCS reference to the GenAI input content.""" + + output_src: Optional[str] + """String containing the GCS reference to the GenAI response content.""" + + system_instruction_src: Optional[str] + """An optional string containing the GCS reference to the GenAI system instruction.""" + + api_client: Optional[Any] + """The underlying API client.""" + + +ObservabilityEvalCaseOrDict = Union[ObservabilityEvalCase, ObservabilityEvalCaseDict] + + +class RubricGroup(_common.BaseModel): + """A group of rubrics. + + Used for grouping rubrics based on a metric or a version. + """ + + group_id: Optional[str] = Field( + default=None, description="""Unique identifier for the group.""" + ) + display_name: Optional[str] = Field( + default=None, + description="""Human-readable name for the group. This should be unique + within a given context if used for display or selection. + Example: "Instruction Following V1", "Content Quality - Summarization + Task".""", + ) + rubrics: Optional[list[evals_types.Rubric]] = Field( + default=None, description="""Rubrics that are part of this group.""" + ) + + +class RubricGroupDict(TypedDict, total=False): + """A group of rubrics. + + Used for grouping rubrics based on a metric or a version. + """ + + group_id: Optional[str] + """Unique identifier for the group.""" + + display_name: Optional[str] + """Human-readable name for the group. This should be unique + within a given context if used for display or selection. + Example: "Instruction Following V1", "Content Quality - Summarization + Task".""" + + rubrics: Optional[list[evals_types.Rubric]] + """Rubrics that are part of this group.""" RubricGroupOrDict = Union[RubricGroup, RubricGroupDict] @@ -24242,3 +25554,55 @@ class AgentEngineRuntimeRevisionDict(TypedDict, total=False): AgentEngineRuntimeRevisionOrDict = Union[ AgentEngineRuntimeRevision, AgentEngineRuntimeRevisionDict ] + + +class ListDeployableModelsConfig(_common.BaseModel): + """Config for listing deployable models.""" + + include_hugging_face_models: Optional[bool] = Field( + default=None, description="""Whether to list Hugging Face models.""" + ) + model_filter: Optional[str] = Field( + default=None, description="""Optional. A string to filter the models by.""" + ) + + +class ListDeployableModelsConfigDict(TypedDict, total=False): + """Config for listing deployable models.""" + + include_hugging_face_models: Optional[bool] + """Whether to list Hugging Face models.""" + + model_filter: Optional[str] + """Optional. A string to filter the models by.""" + + +ListDeployableModelsConfigOrDict = Union[ + ListDeployableModelsConfig, ListDeployableModelsConfigDict +] + + +class ListModelGardenModelsConfig(_common.BaseModel): + """Config for listing Model Garden models.""" + + include_hugging_face_models: Optional[bool] = Field( + default=None, description="""Whether to list Hugging Face models.""" + ) + model_filter: Optional[str] = Field( + default=None, description="""Optional. A string to filter the models by.""" + ) + + +class ListModelGardenModelsConfigDict(TypedDict, total=False): + """Config for listing Model Garden models.""" + + include_hugging_face_models: Optional[bool] + """Whether to list Hugging Face models.""" + + model_filter: Optional[str] + """Optional. A string to filter the models by.""" + + +ListModelGardenModelsConfigOrDict = Union[ + ListModelGardenModelsConfig, ListModelGardenModelsConfigDict +] diff --git a/tests/unit/agentplatform/genai/replays/conftest.py b/tests/unit/agentplatform/genai/replays/conftest.py index b3adc265cd..1e63b63864 100644 --- a/tests/unit/agentplatform/genai/replays/conftest.py +++ b/tests/unit/agentplatform/genai/replays/conftest.py @@ -272,10 +272,15 @@ def client(use_vertex, replays_prefix, http_options, request): if http_options.headers is None: http_options.headers = {} + project = os.environ.get("GOOGLE_CLOUD_PROJECT") + location = os.environ.get("GOOGLE_CLOUD_LOCATION") + replay_client = _replay_api_client.ReplayApiClient( mode=mode, replay_id=replay_id, vertexai=use_vertex, + project=project, + location=location, http_options=http_options, ) diff --git a/tests/unit/agentplatform/genai/replays/test_model_garden.py b/tests/unit/agentplatform/genai/replays/test_model_garden.py new file mode 100644 index 0000000000..767f2f70de --- /dev/null +++ b/tests/unit/agentplatform/genai/replays/test_model_garden.py @@ -0,0 +1,65 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# pylint: disable=protected-access,bad-continuation,missing-function-docstring + +from agentplatform._genai import types +from tests.unit.agentplatform.genai.replays import pytest_helper +import pytest + + +def test_list_deployable_models(client): + """Tests listing deployable models in Model Garden.""" + models = client.model_garden.list_deployable_models( + config=types.ListDeployableModelsConfig(include_hugging_face_models=False) + ) + assert len(models) > 0 + assert models[0].name is not None + + +def test_list_models(client): + """Tests listing all baseline models in Model Garden.""" + models = client.model_garden.list_models( + config=types.ListModelGardenModelsConfig(include_hugging_face_models=False) + ) + assert len(models) > 0 + assert models[0].name is not None + + +pytestmark = pytest_helper.setup( + file=__file__, + globals_for_file=globals(), +) + +pytest_plugins = ("pytest_asyncio",) + + +@pytest.mark.asyncio +async def test_list_deployable_models_async(client): + """Tests listing deployable models asynchronously.""" + models = await client.aio.model_garden.list_deployable_models( + config=types.ListDeployableModelsConfig(include_hugging_face_models=False) + ) + assert len(models) > 0 + assert models[0].name is not None + + +@pytest.mark.asyncio +async def test_list_models_async(client): + """Tests listing all baseline models asynchronously.""" + models = await client.aio.model_garden.list_models( + config=types.ListModelGardenModelsConfig(include_hugging_face_models=False) + ) + assert len(models) > 0 + assert models[0].name is not None diff --git a/tests/unit/agentplatform/genai/test_model_garden.py b/tests/unit/agentplatform/genai/test_model_garden.py new file mode 100644 index 0000000000..533fa2bd64 --- /dev/null +++ b/tests/unit/agentplatform/genai/test_model_garden.py @@ -0,0 +1,55 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# pylint: disable=protected-access,bad-continuation,missing-function-docstring + +from unittest import mock +from agentplatform._genai import model_garden +from agentplatform._genai import types +from google.genai import client +import pytest + +_TEST_PROJECT = "test-project" +_TEST_LOCATION = "us-central1" + + +@pytest.fixture +def mock_client(): + mock_api_client = mock.Mock(spec=client.Client) + mock_api_client.project = _TEST_PROJECT + mock_api_client.location = _TEST_LOCATION + mock_api_client.vertexai = True + + return model_garden.ModelGarden(mock_api_client) + + +def test_list_deployable_models_mocked(mock_client): + dummy_response = types.ListPublisherModelsResponse( + publisher_models=[ + types.PublisherModel(name="publishers/google/models/gemma-2b"), + types.PublisherModel(name="publishers/hf-google/models/gemma-2b"), + ] + ) + + with mock.patch.object( + mock_client, "_list_publisher_models", return_value=dummy_response + ) as mock_list: + models = mock_client.list_deployable_models( + config=types.ListDeployableModelsConfig(include_hugging_face_models=False) + ) + + mock_list.assert_called_once() + # Check that client-side Hugging Face filtering worked + assert len(models) == 1 + assert models[0].name == "publishers/google/models/gemma-2b" diff --git a/vertexai/_genai/client.py b/vertexai/_genai/client.py index 18b91a4413..c1f8d2e263 100644 --- a/vertexai/_genai/client.py +++ b/vertexai/_genai/client.py @@ -39,6 +39,9 @@ ) from vertexai._genai import prompts as prompts_module from vertexai._genai import skills as skills_module + from vertexai._genai import ( + model_garden as model_garden_module, + ) from vertexai._genai import live as live_module @@ -83,6 +86,7 @@ def __init__(self, api_client: genai_client.BaseApiClient): # type: ignore[name self._prompts: Optional[ModuleType] = None self._datasets: Optional[ModuleType] = None self._skills: Optional[ModuleType] = None + self._model_garden: Optional[ModuleType] = None @property @_common.experimental_warning( @@ -164,6 +168,18 @@ def skills(self) -> "skills_module.AsyncSkills": ) return self._skills.AsyncSkills(self._api_client) # type: ignore[no-any-return] + @property + @_common.experimental_warning( + "The Model Garden module is experimental, and may change in future " "versions." + ) + def model_garden(self) -> "model_garden_module.AsyncModelGarden": + if self._model_garden is None: + self._model_garden = importlib.import_module( + ".model_garden", + __package__, + ) + return self._model_garden.AsyncModelGarden(self._api_client) # type: ignore[no-any-return] + async def aclose(self) -> None: """Closes the async client explicitly. @@ -268,6 +284,7 @@ def __init__( self._prompts: Optional[ModuleType] = None self._datasets: Optional[ModuleType] = None self._skills: Optional[ModuleType] = None + self._model_garden: Optional[ModuleType] = None @property def evals(self) -> "evals_module.Evals": @@ -373,3 +390,15 @@ def skills(self) -> "skills_module.Skills": __package__, ) return self._skills.Skills(self._api_client) # type: ignore[no-any-return] + + @property + @_common.experimental_warning( + "The Model Garden module is experimental, and may change in future " "versions." + ) + def model_garden(self) -> "model_garden_module.ModelGarden": + if self._model_garden is None: + self._model_garden = importlib.import_module( + ".model_garden", + __package__, + ) + return self._model_garden.ModelGarden(self._api_client) # type: ignore[no-any-return] diff --git a/vertexai/_genai/model_garden.py b/vertexai/_genai/model_garden.py new file mode 100644 index 0000000000..4410fc4a02 --- /dev/null +++ b/vertexai/_genai/model_garden.py @@ -0,0 +1,419 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Code generated by the Google Gen AI SDK generator DO NOT EDIT. + +import json +import logging +from typing import Any, Optional, Union +from urllib.parse import urlencode + +from google.genai import _api_module +from google.genai import _common +from google.genai._common import get_value_by_path as getv +from google.genai._common import set_value_by_path as setv + +from . import types + +logger = logging.getLogger("agentplatform_genai.modelgarden") + + +def _ListPublisherModelsConfig_to_vertex( + from_object: Union[dict[str, Any], object], + parent_object: Optional[dict[str, Any]] = None, +) -> dict[str, Any]: + to_object: dict[str, Any] = {} + + if getv(from_object, ["page_size"]) is not None: + setv(parent_object, ["_query", "pageSize"], getv(from_object, ["page_size"])) + + if getv(from_object, ["page_token"]) is not None: + setv(parent_object, ["_query", "pageToken"], getv(from_object, ["page_token"])) + + if getv(from_object, ["filter"]) is not None: + setv(parent_object, ["_query", "filter"], getv(from_object, ["filter"])) + + if getv(from_object, ["list_all_versions"]) is not None: + setv( + parent_object, + ["_query", "listAllVersions"], + getv(from_object, ["list_all_versions"]), + ) + + return to_object + + +def _ListPublisherModelsRequestParameters_to_vertex( + from_object: Union[dict[str, Any], object], + parent_object: Optional[dict[str, Any]] = None, +) -> dict[str, Any]: + to_object: dict[str, Any] = {} + if getv(from_object, ["parent"]) is not None: + setv(to_object, ["_url", "parent"], getv(from_object, ["parent"])) + + if getv(from_object, ["config"]) is not None: + _ListPublisherModelsConfig_to_vertex(getv(from_object, ["config"]), to_object) + + return to_object + + +class ModelGarden(_api_module.BaseModule): + """Model Garden module.""" + + def _list_publisher_models( + self, + *, + parent: Optional[str] = None, + config: Optional[types.ListPublisherModelsConfigOrDict] = None, + ) -> types.ListPublisherModelsResponse: + """ + Lists publisher models (internal). + """ + + parameter_model = types._ListPublisherModelsRequestParameters( + parent=parent, + config=config, + ) + + request_url_dict: Optional[dict[str, str]] + if not self._api_client.vertexai: + raise ValueError( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode." + ) + else: + request_dict = _ListPublisherModelsRequestParameters_to_vertex( + parameter_model + ) + request_url_dict = request_dict.get("_url") + if request_url_dict: + path = "{parent}/models".format_map(request_url_dict) + else: + path = "{parent}/models" + + query_params = request_dict.get("_query") + if query_params: + path = f"{path}?{urlencode(query_params)}" + # TODO: remove the hack that pops config. + request_dict.pop("config", None) + + http_options: Optional[types.HttpOptions] = None + if ( + parameter_model.config is not None + and parameter_model.config.http_options is not None + ): + http_options = parameter_model.config.http_options + + request_dict = _common.convert_to_dict(request_dict) + request_dict = _common.encode_unserializable_types(request_dict) + + response = self._api_client.request("get", path, request_dict, http_options) + + response_dict = {} if not response.body else json.loads(response.body) + + return_value = types.ListPublisherModelsResponse._from_response( + response=response_dict, + kwargs=( + { + "config": { + "response_schema": getattr( + parameter_model.config, "response_schema", None + ), + "response_json_schema": getattr( + parameter_model.config, "response_json_schema", None + ), + "include_all_fields": getattr( + parameter_model.config, "include_all_fields", None + ), + } + } + if getattr(parameter_model, "config", None) + else {} + ), + ) + + self._api_client._verify_response(return_value) + return return_value + + @staticmethod + def _build_filter_str( + model_filter: Optional[str], + include_hugging_face_models: Optional[bool], + deployable_only: bool, + ) -> str: + """Builds the filter string for listing publisher models.""" + import re + + if include_hugging_face_models: + filter_str = "is_hf_wildcard(true)" + if deployable_only: + filter_str += ( + " AND labels.VERIFIED_DEPLOYMENT_CONFIG=VERIFIED_DEPLOYMENT_SUCCEED" + ) + else: + filter_str = "is_hf_wildcard(false)" + + if model_filter: + escaped = re.escape(model_filter) + filter_str = ( + f'{filter_str} AND (model_user_id=~"(?i).*{escaped}.*"' + f' OR display_name=~"(?i).*{escaped}.*")' + ) + + return filter_str + + def list_deployable_models( + self, + config: Optional[types.ListDeployableModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists deployable models in Model Garden.""" + if config is None: + config = types.ListDeployableModelsConfig() + if isinstance(config, dict): + config = types.ListDeployableModelsConfig.model_validate(config) + + # Hugging face filter HUGGING_FACE=true/false is not supported by backend, + # so we only pass model_filter and filter HF models on client side. + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=True, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=True, + ) + + response = self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models + + def list_models( + self, + config: Optional[types.ListModelGardenModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists all models in Model Garden.""" + if config is None: + config = types.ListModelGardenModelsConfig() + if isinstance(config, dict): + config = types.ListModelGardenModelsConfig.model_validate(config) + + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=False, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=False, + ) + + response = self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models + + +class AsyncModelGarden(_api_module.BaseModule): + """Model Garden module.""" + + async def _list_publisher_models( + self, + *, + parent: Optional[str] = None, + config: Optional[types.ListPublisherModelsConfigOrDict] = None, + ) -> types.ListPublisherModelsResponse: + """ + Lists publisher models (internal). + """ + + parameter_model = types._ListPublisherModelsRequestParameters( + parent=parent, + config=config, + ) + + request_url_dict: Optional[dict[str, str]] + if not self._api_client.vertexai: + raise ValueError( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode." + ) + else: + request_dict = _ListPublisherModelsRequestParameters_to_vertex( + parameter_model + ) + request_url_dict = request_dict.get("_url") + if request_url_dict: + path = "{parent}/models".format_map(request_url_dict) + else: + path = "{parent}/models" + + query_params = request_dict.get("_query") + if query_params: + path = f"{path}?{urlencode(query_params)}" + # TODO: remove the hack that pops config. + request_dict.pop("config", None) + + http_options: Optional[types.HttpOptions] = None + if ( + parameter_model.config is not None + and parameter_model.config.http_options is not None + ): + http_options = parameter_model.config.http_options + + request_dict = _common.convert_to_dict(request_dict) + request_dict = _common.encode_unserializable_types(request_dict) + + response = await self._api_client.async_request( + "get", path, request_dict, http_options + ) + + response_dict = {} if not response.body else json.loads(response.body) + + return_value = types.ListPublisherModelsResponse._from_response( + response=response_dict, + kwargs=( + { + "config": { + "response_schema": getattr( + parameter_model.config, "response_schema", None + ), + "response_json_schema": getattr( + parameter_model.config, "response_json_schema", None + ), + "include_all_fields": getattr( + parameter_model.config, "include_all_fields", None + ), + } + } + if getattr(parameter_model, "config", None) + else {} + ), + ) + + self._api_client._verify_response(return_value) + return return_value + + @staticmethod + def _build_filter_str( + model_filter: Optional[str], + include_hugging_face_models: Optional[bool], + deployable_only: bool, + ) -> str: + """Builds the filter string for listing publisher models.""" + import re + + if include_hugging_face_models: + filter_str = "is_hf_wildcard(true)" + if deployable_only: + filter_str += ( + " AND labels.VERIFIED_DEPLOYMENT_CONFIG=VERIFIED_DEPLOYMENT_SUCCEED" + ) + else: + filter_str = "is_hf_wildcard(false)" + + if model_filter: + escaped = re.escape(model_filter) + filter_str = ( + f'{filter_str} AND (model_user_id=~"(?i).*{escaped}.*"' + f' OR display_name=~"(?i).*{escaped}.*")' + ) + + return filter_str + + async def list_deployable_models( + self, + config: Optional[types.ListDeployableModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists deployable models in Model Garden.""" + if config is None: + config = types.ListDeployableModelsConfig() + if isinstance(config, dict): + config = types.ListDeployableModelsConfig.model_validate(config) + + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=True, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=True, + ) + + response = await self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models + + async def list_models( + self, + config: Optional[types.ListModelGardenModelsConfigOrDict] = None, + ) -> list[types.PublisherModel]: + """Lists all models in Model Garden.""" + if config is None: + config = types.ListModelGardenModelsConfig() + if isinstance(config, dict): + config = types.ListModelGardenModelsConfig.model_validate(config) + + filter_str = self._build_filter_str( + config.model_filter, + config.include_hugging_face_models, + deployable_only=False, + ) + + api_config = types.ListPublisherModelsConfig( + filter=filter_str, + list_all_versions=False, + ) + + response = await self._list_publisher_models( + parent="publishers/*", + config=api_config, + ) + models = response.publisher_models or [] + + if not config.include_hugging_face_models: + models = [ + m for m in models if m.name and not m.name.startswith("publishers/hf-") + ] + + return models diff --git a/vertexai/_genai/types/__init__.py b/vertexai/_genai/types/__init__.py index bd2836756e..2b07beaf5b 100644 --- a/vertexai/_genai/types/__init__.py +++ b/vertexai/_genai/types/__init__.py @@ -24,6 +24,7 @@ from . import prompts from .common import _AppendAgentEngineSessionEventRequestParameters from .common import _AppendAgentEngineTaskEventRequestParameters +from .common import _AskContextsRequestParameters from .common import _AssembleDatasetParameters from .common import _AssessDatasetParameters from .common import _CancelQueryJobAgentEngineRequestParameters @@ -40,6 +41,7 @@ from .common import _CreateEvaluationRunParameters from .common import _CreateEvaluationSetParameters from .common import _CreateMultimodalDatasetParameters +from .common import _CreateRagCorpusRequestParameters from .common import _CreateSandboxEnvironmentSnapshotRequestParameters from .common import _CreateSandboxEnvironmentTemplateRequestParameters from .common import _CreateSkillRequestParameters @@ -55,6 +57,8 @@ from .common import _DeleteEvaluationMetricParameters from .common import _DeleteMultimodalDatasetRequestParameters from .common import _DeletePromptVersionRequestParameters +from .common import _DeleteRagCorpusRequestParameters +from .common import _DeleteRagFileRequestParameters from .common import _DeleteSandboxEnvironmentSnapshotRequestParameters from .common import _DeleteSandboxEnvironmentTemplateRequestParameters from .common import _DeleteSkillRequestParameters @@ -77,6 +81,7 @@ from .common import _GetAgentEngineSessionOperationParameters from .common import _GetAgentEngineSessionRequestParameters from .common import _GetAgentEngineTaskRequestParameters +from .common import _GetCorpusOperationParameters from .common import _GetCustomJobParameters from .common import _GetCustomJobParameters from .common import _GetDatasetOperationParameters @@ -89,6 +94,10 @@ from .common import _GetEvaluationSetParameters from .common import _GetMultimodalDatasetOperationParameters from .common import _GetMultimodalDatasetParameters +from .common import _GetRagConfigOperationParameters +from .common import _GetRagConfigRequestParameters +from .common import _GetRagCorpusRequestParameters +from .common import _GetRagFileRequestParameters from .common import _GetSandboxEnvironmentSnapshotRequestParameters from .common import _GetSandboxEnvironmentTemplateOperationParameters from .common import _GetSandboxEnvironmentTemplateRequestParameters @@ -109,6 +118,9 @@ from .common import _ListDatasetVersionsRequestParameters from .common import _ListEvaluationMetricsParameters from .common import _ListMultimodalDatasetsRequestParameters +from .common import _ListPublisherModelsRequestParameters +from .common import _ListRagCorporaRequestParameters +from .common import _ListRagFilesRequestParameters from .common import _ListSandboxEnvironmentSnapshotsRequestParameters from .common import _ListSandboxEnvironmentTemplatesRequestParameters from .common import _ListSkillRevisionsRequestParameters @@ -121,6 +133,7 @@ from .common import _RestoreVersionRequestParameters from .common import _RetrieveAgentEngineMemoriesRequestParameters from .common import _RetrieveMemoryProfilesRequestParameters +from .common import _RetrieveRagContextsRequestParameters from .common import _RetrieveSkillsRequestParameters from .common import _RollbackAgentEngineMemoryRequestParameters from .common import _RunQueryJobAgentEngineConfig @@ -132,6 +145,8 @@ from .common import _UpdateAgentEngineSessionRequestParameters from .common import _UpdateDatasetParameters from .common import _UpdateMultimodalDatasetParameters +from .common import _UpdateRagConfigRequestParameters +from .common import _UpdateRagCorpusRequestParameters from .common import _UpdateSkillRequestParameters from .common import A2aTask from .common import A2aTaskDict @@ -184,6 +199,12 @@ from .common import AnalysisConfig from .common import AnalysisConfigDict from .common import AnalysisConfigOrDict +from .common import ApiAuth +from .common import ApiAuthApiKeyConfig +from .common import ApiAuthApiKeyConfigDict +from .common import ApiAuthApiKeyConfigOrDict +from .common import ApiAuthDict +from .common import ApiAuthOrDict from .common import AppendAgentEngineSessionEventConfig from .common import AppendAgentEngineSessionEventConfigDict from .common import AppendAgentEngineSessionEventConfigOrDict @@ -196,6 +217,12 @@ from .common import AppendAgentEngineTaskEventResponse from .common import AppendAgentEngineTaskEventResponseDict from .common import AppendAgentEngineTaskEventResponseOrDict +from .common import AskContextsConfig +from .common import AskContextsConfigDict +from .common import AskContextsConfigOrDict +from .common import AskContextsResponse +from .common import AskContextsResponseDict +from .common import AskContextsResponseOrDict from .common import AssembleDataset from .common import AssembleDatasetConfig from .common import AssembleDatasetConfigDict @@ -208,6 +235,12 @@ from .common import AttackCategoryResult from .common import AttackCategoryResultDict from .common import AttackCategoryResultOrDict +from .common import AutomaticResources +from .common import AutomaticResourcesDict +from .common import AutomaticResourcesOrDict +from .common import AutoscalingMetricSpec +from .common import AutoscalingMetricSpecDict +from .common import AutoscalingMetricSpecOrDict from .common import BatchPredictionResourceUsageAssessmentConfig from .common import BatchPredictionResourceUsageAssessmentConfigDict from .common import BatchPredictionResourceUsageAssessmentConfigOrDict @@ -268,6 +301,12 @@ from .common import ContentMapContentsOrDict from .common import ContentMapDict from .common import ContentMapOrDict +from .common import CorpusOperation +from .common import CorpusOperationDict +from .common import CorpusOperationOrDict +from .common import CorpusStatus +from .common import CorpusStatusDict +from .common import CorpusStatusOrDict from .common import CreateAgentEngineConfig from .common import CreateAgentEngineConfigDict from .common import CreateAgentEngineConfigOrDict @@ -310,6 +349,12 @@ from .common import CreatePromptVersionConfig from .common import CreatePromptVersionConfigDict from .common import CreatePromptVersionConfigOrDict +from .common import CreateRagCorpusConfig +from .common import CreateRagCorpusConfigDict +from .common import CreateRagCorpusConfigOrDict +from .common import CreateRagCorpusOperation +from .common import CreateRagCorpusOperationDict +from .common import CreateRagCorpusOperationOrDict from .common import CreateSandboxEnvironmentTemplateConfig from .common import CreateSandboxEnvironmentTemplateConfigDict from .common import CreateSandboxEnvironmentTemplateConfigOrDict @@ -334,6 +379,12 @@ from .common import DatasetVersion from .common import DatasetVersionDict from .common import DatasetVersionOrDict +from .common import DedicatedResources +from .common import DedicatedResourcesDict +from .common import DedicatedResourcesOrDict +from .common import DedicatedResourcesScaleToZeroSpec +from .common import DedicatedResourcesScaleToZeroSpecDict +from .common import DedicatedResourcesScaleToZeroSpecOrDict from .common import DefaultContainerCategory from .common import DeleteAgentEngineConfig from .common import DeleteAgentEngineConfigDict @@ -383,6 +434,18 @@ from .common import DeletePromptVersionOperation from .common import DeletePromptVersionOperationDict from .common import DeletePromptVersionOperationOrDict +from .common import DeleteRagCorpusConfig +from .common import DeleteRagCorpusConfigDict +from .common import DeleteRagCorpusConfigOrDict +from .common import DeleteRagCorpusOperation +from .common import DeleteRagCorpusOperationDict +from .common import DeleteRagCorpusOperationOrDict +from .common import DeleteRagFileConfig +from .common import DeleteRagFileConfigDict +from .common import DeleteRagFileConfigOrDict +from .common import DeleteRagFileOperation +from .common import DeleteRagFileOperationDict +from .common import DeleteRagFileOperationOrDict from .common import DeleteSandboxEnvironmentSnapshotConfig from .common import DeleteSandboxEnvironmentSnapshotConfigDict from .common import DeleteSandboxEnvironmentSnapshotConfigOrDict @@ -401,12 +464,18 @@ from .common import DeleteSkillOperation from .common import DeleteSkillOperationDict from .common import DeleteSkillOperationOrDict +from .common import DirectUploadSource +from .common import DirectUploadSourceDict +from .common import DirectUploadSourceOrDict from .common import DiskSpec from .common import DiskSpecDict from .common import DiskSpecOrDict from .common import DnsPeeringConfig from .common import DnsPeeringConfigDict from .common import DnsPeeringConfigOrDict +from .common import EncryptionSpec +from .common import EncryptionSpecDict +from .common import EncryptionSpecOrDict from .common import EnvVar from .common import EnvVarDict from .common import EnvVarOrDict @@ -525,7 +594,16 @@ from .common import FailedRubric from .common import FailedRubricDict from .common import FailedRubricOrDict +from .common import FileStatus +from .common import FileStatusDict +from .common import FileStatusOrDict +from .common import FlexStart +from .common import FlexStartDict +from .common import FlexStartOrDict from .common import Framework +from .common import GcsSource +from .common import GcsSourceDict +from .common import GcsSourceOrDict from .common import GeminiExample from .common import GeminiExampleDict from .common import GeminiExampleOrDict @@ -602,6 +680,9 @@ from .common import GetAgentEngineTaskConfig from .common import GetAgentEngineTaskConfigDict from .common import GetAgentEngineTaskConfigOrDict +from .common import GetCorpusOperationConfig +from .common import GetCorpusOperationConfigDict +from .common import GetCorpusOperationConfigOrDict from .common import GetDatasetOperationConfig from .common import GetDatasetOperationConfigDict from .common import GetDatasetOperationConfigOrDict @@ -626,6 +707,18 @@ from .common import GetPromptConfig from .common import GetPromptConfigDict from .common import GetPromptConfigOrDict +from .common import GetRagConfig +from .common import GetRagConfigDict +from .common import GetRagConfigOperationConfig +from .common import GetRagConfigOperationConfigDict +from .common import GetRagConfigOperationConfigOrDict +from .common import GetRagConfigOrDict +from .common import GetRagCorpusConfig +from .common import GetRagCorpusConfigDict +from .common import GetRagCorpusConfigOrDict +from .common import GetRagFileConfig +from .common import GetRagFileConfigDict +from .common import GetRagFileConfigOrDict from .common import GetSandboxEnvironmentSnapshotConfig from .common import GetSandboxEnvironmentSnapshotConfigDict from .common import GetSandboxEnvironmentSnapshotConfigOrDict @@ -641,6 +734,12 @@ from .common import GetSkillRevisionConfig from .common import GetSkillRevisionConfigDict from .common import GetSkillRevisionConfigOrDict +from .common import GoogleDriveSource +from .common import GoogleDriveSourceDict +from .common import GoogleDriveSourceOrDict +from .common import GoogleDriveSourceResourceId +from .common import GoogleDriveSourceResourceIdDict +from .common import GoogleDriveSourceResourceIdOrDict from .common import IdentityType from .common import Importance from .common import IngestEventsConfig @@ -655,6 +754,12 @@ from .common import IntermediateExtractedMemory from .common import IntermediateExtractedMemoryDict from .common import IntermediateExtractedMemoryOrDict +from .common import JiraSource +from .common import JiraSourceDict +from .common import JiraSourceJiraQueries +from .common import JiraSourceJiraQueriesDict +from .common import JiraSourceJiraQueriesOrDict +from .common import JiraSourceOrDict from .common import JobState from .common import KeepAliveProbe from .common import KeepAliveProbeDict @@ -663,6 +768,10 @@ from .common import KeepAliveProbeHttpGetOrDict from .common import KeepAliveProbeOrDict from .common import Language +from .common import LargeModelReference +from .common import LargeModelReferenceDict +from .common import LargeModelReferenceOrDict +from .common import LaunchStage from .common import ListAgentEngineConfig from .common import ListAgentEngineConfigDict from .common import ListAgentEngineConfigOrDict @@ -711,12 +820,18 @@ from .common import ListDatasetVersionsResponse from .common import ListDatasetVersionsResponseDict from .common import ListDatasetVersionsResponseOrDict +from .common import ListDeployableModelsConfig +from .common import ListDeployableModelsConfigDict +from .common import ListDeployableModelsConfigOrDict from .common import ListEvaluationMetricsConfig from .common import ListEvaluationMetricsConfigDict from .common import ListEvaluationMetricsConfigOrDict from .common import ListEvaluationMetricsResponse from .common import ListEvaluationMetricsResponseDict from .common import ListEvaluationMetricsResponseOrDict +from .common import ListModelGardenModelsConfig +from .common import ListModelGardenModelsConfigDict +from .common import ListModelGardenModelsConfigOrDict from .common import ListMultimodalDatasetsConfig from .common import ListMultimodalDatasetsConfigDict from .common import ListMultimodalDatasetsConfigOrDict @@ -726,6 +841,24 @@ from .common import ListPromptsConfig from .common import ListPromptsConfigDict from .common import ListPromptsConfigOrDict +from .common import ListPublisherModelsConfig +from .common import ListPublisherModelsConfigDict +from .common import ListPublisherModelsConfigOrDict +from .common import ListPublisherModelsResponse +from .common import ListPublisherModelsResponseDict +from .common import ListPublisherModelsResponseOrDict +from .common import ListRagCorporaConfig +from .common import ListRagCorporaConfigDict +from .common import ListRagCorporaConfigOrDict +from .common import ListRagCorporaResponse +from .common import ListRagCorporaResponseDict +from .common import ListRagCorporaResponseOrDict +from .common import ListRagFilesConfig +from .common import ListRagFilesConfigDict +from .common import ListRagFilesConfigOrDict +from .common import ListRagFilesResponse +from .common import ListRagFilesResponseDict +from .common import ListRagFilesResponseOrDict from .common import ListReasoningEnginesMemoriesResponse from .common import ListReasoningEnginesMemoriesResponseDict from .common import ListReasoningEnginesMemoriesResponseOrDict @@ -885,6 +1018,9 @@ from .common import MetricxResult from .common import MetricxResultDict from .common import MetricxResultOrDict +from .common import ModelContainerSpec +from .common import ModelContainerSpecDict +from .common import ModelContainerSpecOrDict from .common import MultimodalDataset from .common import MultimodalDatasetDict from .common import MultimodalDatasetOperation @@ -897,6 +1033,7 @@ from .common import ObservabilityEvalCase from .common import ObservabilityEvalCaseDict from .common import ObservabilityEvalCaseOrDict +from .common import OpenSourceCategory from .common import Operator from .common import OptimizationMethod from .common import OptimizeConfig @@ -925,7 +1062,31 @@ from .common import PointwiseMetricInstance from .common import PointwiseMetricInstanceDict from .common import PointwiseMetricInstanceOrDict +from .common import Port +from .common import PortDict +from .common import PortOrDict from .common import PostSnapshotAction +from .common import PredictSchemata +from .common import PredictSchemataDict +from .common import PredictSchemataOrDict +from .common import Probe +from .common import ProbeDict +from .common import ProbeExecAction +from .common import ProbeExecActionDict +from .common import ProbeExecActionOrDict +from .common import ProbeGrpcAction +from .common import ProbeGrpcActionDict +from .common import ProbeGrpcActionOrDict +from .common import ProbeHttpGetAction +from .common import ProbeHttpGetActionDict +from .common import ProbeHttpGetActionOrDict +from .common import ProbeHttpHeader +from .common import ProbeHttpHeaderDict +from .common import ProbeHttpHeaderOrDict +from .common import ProbeOrDict +from .common import ProbeTcpSocketAction +from .common import ProbeTcpSocketActionDict +from .common import ProbeTcpSocketActionOrDict from .common import Prompt from .common import PromptData from .common import PromptDataDict @@ -952,6 +1113,45 @@ from .common import PscInterfaceConfig from .common import PscInterfaceConfigDict from .common import PscInterfaceConfigOrDict +from .common import PublisherModel +from .common import PublisherModelCallToAction +from .common import PublisherModelCallToActionDeploy +from .common import PublisherModelCallToActionDeployDeployMetadata +from .common import PublisherModelCallToActionDeployDeployMetadataDict +from .common import PublisherModelCallToActionDeployDeployMetadataOrDict +from .common import PublisherModelCallToActionDeployDict +from .common import PublisherModelCallToActionDeployGke +from .common import PublisherModelCallToActionDeployGkeDict +from .common import PublisherModelCallToActionDeployGkeOrDict +from .common import PublisherModelCallToActionDeployOrDict +from .common import PublisherModelCallToActionDeployVertex +from .common import PublisherModelCallToActionDeployVertexDict +from .common import PublisherModelCallToActionDeployVertexOrDict +from .common import PublisherModelCallToActionDict +from .common import PublisherModelCallToActionOpenFineTuningPipelines +from .common import PublisherModelCallToActionOpenFineTuningPipelinesDict +from .common import PublisherModelCallToActionOpenFineTuningPipelinesOrDict +from .common import PublisherModelCallToActionOpenNotebooks +from .common import PublisherModelCallToActionOpenNotebooksDict +from .common import PublisherModelCallToActionOpenNotebooksOrDict +from .common import PublisherModelCallToActionOrDict +from .common import PublisherModelCallToActionRegionalResourceReferences +from .common import PublisherModelCallToActionRegionalResourceReferencesDict +from .common import PublisherModelCallToActionRegionalResourceReferencesOrDict +from .common import PublisherModelCallToActionViewRestApi +from .common import PublisherModelCallToActionViewRestApiDict +from .common import PublisherModelCallToActionViewRestApiOrDict +from .common import PublisherModelDict +from .common import PublisherModelDocumentation +from .common import PublisherModelDocumentationDict +from .common import PublisherModelDocumentationOrDict +from .common import PublisherModelOrDict +from .common import PublisherModelParent +from .common import PublisherModelParentDict +from .common import PublisherModelParentOrDict +from .common import PublisherModelResourceReference +from .common import PublisherModelResourceReferenceDict +from .common import PublisherModelResourceReferenceOrDict from .common import PurgeAgentEngineMemoriesConfig from .common import PurgeAgentEngineMemoriesConfigDict from .common import PurgeAgentEngineMemoriesConfigOrDict @@ -970,6 +1170,130 @@ from .common import QueryReasoningEngineResponse from .common import QueryReasoningEngineResponseDict from .common import QueryReasoningEngineResponseOrDict +from .common import RagChunk +from .common import RagChunkDict +from .common import RagChunkOrDict +from .common import RagChunkPageSpan +from .common import RagChunkPageSpanDict +from .common import RagChunkPageSpanOrDict +from .common import RagContexts +from .common import RagContextsContext +from .common import RagContextsContextDict +from .common import RagContextsContextOrDict +from .common import RagContextsDict +from .common import RagContextsOrDict +from .common import RagCorpus +from .common import RagCorpusCorpusTypeConfig +from .common import RagCorpusCorpusTypeConfigDict +from .common import RagCorpusCorpusTypeConfigDocumentCorpus +from .common import RagCorpusCorpusTypeConfigDocumentCorpusDict +from .common import RagCorpusCorpusTypeConfigDocumentCorpusOrDict +from .common import RagCorpusCorpusTypeConfigMemoryCorpus +from .common import RagCorpusCorpusTypeConfigMemoryCorpusDict +from .common import RagCorpusCorpusTypeConfigMemoryCorpusOrDict +from .common import RagCorpusCorpusTypeConfigOrDict +from .common import RagCorpusDict +from .common import RagCorpusOrDict +from .common import RagEmbeddingModelConfig +from .common import RagEmbeddingModelConfigDict +from .common import RagEmbeddingModelConfigHybridSearchConfig +from .common import RagEmbeddingModelConfigHybridSearchConfigDict +from .common import RagEmbeddingModelConfigHybridSearchConfigOrDict +from .common import RagEmbeddingModelConfigOrDict +from .common import RagEmbeddingModelConfigSparseEmbeddingConfig +from .common import RagEmbeddingModelConfigSparseEmbeddingConfigBm25 +from .common import RagEmbeddingModelConfigSparseEmbeddingConfigBm25Dict +from .common import RagEmbeddingModelConfigSparseEmbeddingConfigBm25OrDict +from .common import RagEmbeddingModelConfigSparseEmbeddingConfigDict +from .common import RagEmbeddingModelConfigSparseEmbeddingConfigOrDict +from .common import RagEmbeddingModelConfigVertexPredictionEndpoint +from .common import RagEmbeddingModelConfigVertexPredictionEndpointDict +from .common import RagEmbeddingModelConfigVertexPredictionEndpointOrDict +from .common import RagEngineConfig +from .common import RagEngineConfigDict +from .common import RagEngineConfigOperation +from .common import RagEngineConfigOperationDict +from .common import RagEngineConfigOperationOrDict +from .common import RagEngineConfigOrDict +from .common import RagFile +from .common import RagFileDict +from .common import RagFileOrDict +from .common import RagFileParsingConfigLlmParser +from .common import RagFileParsingConfigLlmParserDict +from .common import RagFileParsingConfigLlmParserOrDict +from .common import RagFileType +from .common import RagManagedDbConfig +from .common import RagManagedDbConfigBasic +from .common import RagManagedDbConfigBasicDict +from .common import RagManagedDbConfigBasicOrDict +from .common import RagManagedDbConfigDict +from .common import RagManagedDbConfigEnterprise +from .common import RagManagedDbConfigEnterpriseDict +from .common import RagManagedDbConfigEnterpriseOrDict +from .common import RagManagedDbConfigOrDict +from .common import RagManagedDbConfigScaled +from .common import RagManagedDbConfigScaledDict +from .common import RagManagedDbConfigScaledOrDict +from .common import RagManagedDbConfigServerless +from .common import RagManagedDbConfigServerlessDict +from .common import RagManagedDbConfigServerlessOrDict +from .common import RagManagedDbConfigSpanner +from .common import RagManagedDbConfigSpannerDict +from .common import RagManagedDbConfigSpannerOrDict +from .common import RagManagedDbConfigUnprovisioned +from .common import RagManagedDbConfigUnprovisionedDict +from .common import RagManagedDbConfigUnprovisionedOrDict +from .common import RagQuery +from .common import RagQueryDict +from .common import RagQueryOrDict +from .common import RagQueryRanking +from .common import RagQueryRankingDict +from .common import RagQueryRankingOrDict +from .common import RagRetrievalConfig +from .common import RagRetrievalConfigDict +from .common import RagRetrievalConfigFilter +from .common import RagRetrievalConfigFilterDict +from .common import RagRetrievalConfigFilterOrDict +from .common import RagRetrievalConfigHybridSearch +from .common import RagRetrievalConfigHybridSearchDict +from .common import RagRetrievalConfigHybridSearchOrDict +from .common import RagRetrievalConfigOrDict +from .common import RagRetrievalConfigRanking +from .common import RagRetrievalConfigRankingDict +from .common import RagRetrievalConfigRankingLlmRanker +from .common import RagRetrievalConfigRankingLlmRankerDict +from .common import RagRetrievalConfigRankingLlmRankerOrDict +from .common import RagRetrievalConfigRankingOrDict +from .common import RagRetrievalConfigRankingRankService +from .common import RagRetrievalConfigRankingRankServiceDict +from .common import RagRetrievalConfigRankingRankServiceOrDict +from .common import RagVectorDbConfig +from .common import RagVectorDbConfigDict +from .common import RagVectorDbConfigOrDict +from .common import RagVectorDbConfigPinecone +from .common import RagVectorDbConfigPineconeDict +from .common import RagVectorDbConfigPineconeOrDict +from .common import RagVectorDbConfigRagManagedDb +from .common import RagVectorDbConfigRagManagedDbANN +from .common import RagVectorDbConfigRagManagedDbANNDict +from .common import RagVectorDbConfigRagManagedDbANNOrDict +from .common import RagVectorDbConfigRagManagedDbDict +from .common import RagVectorDbConfigRagManagedDbKNN +from .common import RagVectorDbConfigRagManagedDbKNNDict +from .common import RagVectorDbConfigRagManagedDbKNNOrDict +from .common import RagVectorDbConfigRagManagedDbOrDict +from .common import RagVectorDbConfigRagManagedVertexVectorSearch +from .common import RagVectorDbConfigRagManagedVertexVectorSearchDict +from .common import RagVectorDbConfigRagManagedVertexVectorSearchOrDict +from .common import RagVectorDbConfigVertexFeatureStore +from .common import RagVectorDbConfigVertexFeatureStoreDict +from .common import RagVectorDbConfigVertexFeatureStoreOrDict +from .common import RagVectorDbConfigVertexVectorSearch +from .common import RagVectorDbConfigVertexVectorSearchDict +from .common import RagVectorDbConfigVertexVectorSearchOrDict +from .common import RagVectorDbConfigWeaviate +from .common import RagVectorDbConfigWeaviateDict +from .common import RagVectorDbConfigWeaviateOrDict from .common import ReasoningEngine from .common import ReasoningEngineContextSpec from .common import ReasoningEngineContextSpecDict @@ -1078,6 +1402,7 @@ from .common import ReservationAffinity from .common import ReservationAffinityDict from .common import ReservationAffinityOrDict +from .common import ResourceType from .common import ResponseCandidate from .common import ResponseCandidateDict from .common import ResponseCandidateOrDict @@ -1093,6 +1418,12 @@ from .common import RetrieveAgentEngineMemoriesConfig from .common import RetrieveAgentEngineMemoriesConfigDict from .common import RetrieveAgentEngineMemoriesConfigOrDict +from .common import RetrieveContextsConfig +from .common import RetrieveContextsConfigDict +from .common import RetrieveContextsConfigOrDict +from .common import RetrieveContextsResponse +from .common import RetrieveContextsResponseDict +from .common import RetrieveContextsResponseOrDict from .common import RetrievedSkill from .common import RetrievedSkillDict from .common import RetrievedSkillOrDict @@ -1304,6 +1635,12 @@ from .common import SessionEventDict from .common import SessionEventOrDict from .common import SessionOrDict +from .common import SharePointSources +from .common import SharePointSourcesDict +from .common import SharePointSourcesOrDict +from .common import SharePointSourcesSharePointSource +from .common import SharePointSourcesSharePointSourceDict +from .common import SharePointSourcesSharePointSourceOrDict from .common import Skill from .common import SkillDict from .common import SkillOperation @@ -1313,8 +1650,18 @@ from .common import SkillRevision from .common import SkillRevisionDict from .common import SkillRevisionOrDict +from .common import SkillRevisionState from .common import SkillSource from .common import SkillState +from .common import SlackSource +from .common import SlackSourceDict +from .common import SlackSourceOrDict +from .common import SlackSourceSlackChannels +from .common import SlackSourceSlackChannelsDict +from .common import SlackSourceSlackChannelsOrDict +from .common import SlackSourceSlackChannelsSlackChannel +from .common import SlackSourceSlackChannelsSlackChannelDict +from .common import SlackSourceSlackChannelsSlackChannelOrDict from .common import State from .common import Strategy from .common import StructuredMemoryConfig @@ -1447,12 +1794,34 @@ from .common import UpdatePromptConfig from .common import UpdatePromptConfigDict from .common import UpdatePromptConfigOrDict +from .common import UpdateRagConfig +from .common import UpdateRagConfigDict +from .common import UpdateRagConfigOperation +from .common import UpdateRagConfigOperationDict +from .common import UpdateRagConfigOperationOrDict +from .common import UpdateRagConfigOrDict +from .common import UpdateRagCorpusConfig +from .common import UpdateRagCorpusConfigDict +from .common import UpdateRagCorpusConfigOrDict +from .common import UpdateRagCorpusOperation +from .common import UpdateRagCorpusOperationDict +from .common import UpdateRagCorpusOperationOrDict from .common import UpdateSkillConfig from .common import UpdateSkillConfigDict from .common import UpdateSkillConfigOrDict +from .common import VersionState +from .common import VertexAiSearchConfig +from .common import VertexAiSearchConfigDict +from .common import VertexAiSearchConfigOrDict from .common import VertexBaseConfig from .common import VertexBaseConfigDict from .common import VertexBaseConfigOrDict +from .common import VertexRagStore +from .common import VertexRagStoreDict +from .common import VertexRagStoreOrDict +from .common import VertexRagStoreRagResource +from .common import VertexRagStoreRagResourceDict +from .common import VertexRagStoreRagResourceOrDict from .common import VulnerableTool from .common import VulnerableToolDict from .common import VulnerableToolOrDict @@ -2223,6 +2592,258 @@ "ListAgentEngineMemoryRevisionsResponse", "ListAgentEngineMemoryRevisionsResponseDict", "ListAgentEngineMemoryRevisionsResponseOrDict", + "AskContextsConfig", + "AskContextsConfigDict", + "AskContextsConfigOrDict", + "RagRetrievalConfigFilter", + "RagRetrievalConfigFilterDict", + "RagRetrievalConfigFilterOrDict", + "RagRetrievalConfigHybridSearch", + "RagRetrievalConfigHybridSearchDict", + "RagRetrievalConfigHybridSearchOrDict", + "RagRetrievalConfigRankingLlmRanker", + "RagRetrievalConfigRankingLlmRankerDict", + "RagRetrievalConfigRankingLlmRankerOrDict", + "RagRetrievalConfigRankingRankService", + "RagRetrievalConfigRankingRankServiceDict", + "RagRetrievalConfigRankingRankServiceOrDict", + "RagRetrievalConfigRanking", + "RagRetrievalConfigRankingDict", + "RagRetrievalConfigRankingOrDict", + "RagRetrievalConfig", + "RagRetrievalConfigDict", + "RagRetrievalConfigOrDict", + "RagQueryRanking", + "RagQueryRankingDict", + "RagQueryRankingOrDict", + "RagQuery", + "RagQueryDict", + "RagQueryOrDict", + "RagChunkPageSpan", + "RagChunkPageSpanDict", + "RagChunkPageSpanOrDict", + "RagChunk", + "RagChunkDict", + "RagChunkOrDict", + "RagContextsContext", + "RagContextsContextDict", + "RagContextsContextOrDict", + "RagContexts", + "RagContextsDict", + "RagContextsOrDict", + "AskContextsResponse", + "AskContextsResponseDict", + "AskContextsResponseOrDict", + "CorpusStatus", + "CorpusStatusDict", + "CorpusStatusOrDict", + "RagCorpusCorpusTypeConfigDocumentCorpus", + "RagCorpusCorpusTypeConfigDocumentCorpusDict", + "RagCorpusCorpusTypeConfigDocumentCorpusOrDict", + "RagFileParsingConfigLlmParser", + "RagFileParsingConfigLlmParserDict", + "RagFileParsingConfigLlmParserOrDict", + "RagCorpusCorpusTypeConfigMemoryCorpus", + "RagCorpusCorpusTypeConfigMemoryCorpusDict", + "RagCorpusCorpusTypeConfigMemoryCorpusOrDict", + "RagCorpusCorpusTypeConfig", + "RagCorpusCorpusTypeConfigDict", + "RagCorpusCorpusTypeConfigOrDict", + "EncryptionSpec", + "EncryptionSpecDict", + "EncryptionSpecOrDict", + "RagEmbeddingModelConfigVertexPredictionEndpoint", + "RagEmbeddingModelConfigVertexPredictionEndpointDict", + "RagEmbeddingModelConfigVertexPredictionEndpointOrDict", + "RagEmbeddingModelConfigSparseEmbeddingConfigBm25", + "RagEmbeddingModelConfigSparseEmbeddingConfigBm25Dict", + "RagEmbeddingModelConfigSparseEmbeddingConfigBm25OrDict", + "RagEmbeddingModelConfigSparseEmbeddingConfig", + "RagEmbeddingModelConfigSparseEmbeddingConfigDict", + "RagEmbeddingModelConfigSparseEmbeddingConfigOrDict", + "RagEmbeddingModelConfigHybridSearchConfig", + "RagEmbeddingModelConfigHybridSearchConfigDict", + "RagEmbeddingModelConfigHybridSearchConfigOrDict", + "RagEmbeddingModelConfig", + "RagEmbeddingModelConfigDict", + "RagEmbeddingModelConfigOrDict", + "ApiAuthApiKeyConfig", + "ApiAuthApiKeyConfigDict", + "ApiAuthApiKeyConfigOrDict", + "ApiAuth", + "ApiAuthDict", + "ApiAuthOrDict", + "RagVectorDbConfigPinecone", + "RagVectorDbConfigPineconeDict", + "RagVectorDbConfigPineconeOrDict", + "RagVectorDbConfigRagManagedDbANN", + "RagVectorDbConfigRagManagedDbANNDict", + "RagVectorDbConfigRagManagedDbANNOrDict", + "RagVectorDbConfigRagManagedDbKNN", + "RagVectorDbConfigRagManagedDbKNNDict", + "RagVectorDbConfigRagManagedDbKNNOrDict", + "RagVectorDbConfigRagManagedDb", + "RagVectorDbConfigRagManagedDbDict", + "RagVectorDbConfigRagManagedDbOrDict", + "RagVectorDbConfigRagManagedVertexVectorSearch", + "RagVectorDbConfigRagManagedVertexVectorSearchDict", + "RagVectorDbConfigRagManagedVertexVectorSearchOrDict", + "RagVectorDbConfigVertexFeatureStore", + "RagVectorDbConfigVertexFeatureStoreDict", + "RagVectorDbConfigVertexFeatureStoreOrDict", + "RagVectorDbConfigVertexVectorSearch", + "RagVectorDbConfigVertexVectorSearchDict", + "RagVectorDbConfigVertexVectorSearchOrDict", + "RagVectorDbConfigWeaviate", + "RagVectorDbConfigWeaviateDict", + "RagVectorDbConfigWeaviateOrDict", + "RagVectorDbConfig", + "RagVectorDbConfigDict", + "RagVectorDbConfigOrDict", + "VertexAiSearchConfig", + "VertexAiSearchConfigDict", + "VertexAiSearchConfigOrDict", + "RagCorpus", + "RagCorpusDict", + "RagCorpusOrDict", + "CreateRagCorpusConfig", + "CreateRagCorpusConfigDict", + "CreateRagCorpusConfigOrDict", + "CreateRagCorpusOperation", + "CreateRagCorpusOperationDict", + "CreateRagCorpusOperationOrDict", + "GetCorpusOperationConfig", + "GetCorpusOperationConfigDict", + "GetCorpusOperationConfigOrDict", + "CorpusOperation", + "CorpusOperationDict", + "CorpusOperationOrDict", + "GetRagCorpusConfig", + "GetRagCorpusConfigDict", + "GetRagCorpusConfigOrDict", + "ListRagCorporaConfig", + "ListRagCorporaConfigDict", + "ListRagCorporaConfigOrDict", + "ListRagCorporaResponse", + "ListRagCorporaResponseDict", + "ListRagCorporaResponseOrDict", + "GetRagFileConfig", + "GetRagFileConfigDict", + "GetRagFileConfigOrDict", + "DirectUploadSource", + "DirectUploadSourceDict", + "DirectUploadSourceOrDict", + "FileStatus", + "FileStatusDict", + "FileStatusOrDict", + "GcsSource", + "GcsSourceDict", + "GcsSourceOrDict", + "GoogleDriveSourceResourceId", + "GoogleDriveSourceResourceIdDict", + "GoogleDriveSourceResourceIdOrDict", + "GoogleDriveSource", + "GoogleDriveSourceDict", + "GoogleDriveSourceOrDict", + "JiraSourceJiraQueries", + "JiraSourceJiraQueriesDict", + "JiraSourceJiraQueriesOrDict", + "JiraSource", + "JiraSourceDict", + "JiraSourceOrDict", + "SharePointSourcesSharePointSource", + "SharePointSourcesSharePointSourceDict", + "SharePointSourcesSharePointSourceOrDict", + "SharePointSources", + "SharePointSourcesDict", + "SharePointSourcesOrDict", + "SlackSourceSlackChannelsSlackChannel", + "SlackSourceSlackChannelsSlackChannelDict", + "SlackSourceSlackChannelsSlackChannelOrDict", + "SlackSourceSlackChannels", + "SlackSourceSlackChannelsDict", + "SlackSourceSlackChannelsOrDict", + "SlackSource", + "SlackSourceDict", + "SlackSourceOrDict", + "RagFile", + "RagFileDict", + "RagFileOrDict", + "ListRagFilesConfig", + "ListRagFilesConfigDict", + "ListRagFilesConfigOrDict", + "ListRagFilesResponse", + "ListRagFilesResponseDict", + "ListRagFilesResponseOrDict", + "GetRagConfig", + "GetRagConfigDict", + "GetRagConfigOrDict", + "RagManagedDbConfigBasic", + "RagManagedDbConfigBasicDict", + "RagManagedDbConfigBasicOrDict", + "RagManagedDbConfigEnterprise", + "RagManagedDbConfigEnterpriseDict", + "RagManagedDbConfigEnterpriseOrDict", + "RagManagedDbConfigScaled", + "RagManagedDbConfigScaledDict", + "RagManagedDbConfigScaledOrDict", + "RagManagedDbConfigServerless", + "RagManagedDbConfigServerlessDict", + "RagManagedDbConfigServerlessOrDict", + "RagManagedDbConfigUnprovisioned", + "RagManagedDbConfigUnprovisionedDict", + "RagManagedDbConfigUnprovisionedOrDict", + "RagManagedDbConfigSpanner", + "RagManagedDbConfigSpannerDict", + "RagManagedDbConfigSpannerOrDict", + "RagManagedDbConfig", + "RagManagedDbConfigDict", + "RagManagedDbConfigOrDict", + "RagEngineConfig", + "RagEngineConfigDict", + "RagEngineConfigOrDict", + "UpdateRagCorpusConfig", + "UpdateRagCorpusConfigDict", + "UpdateRagCorpusConfigOrDict", + "UpdateRagCorpusOperation", + "UpdateRagCorpusOperationDict", + "UpdateRagCorpusOperationOrDict", + "DeleteRagCorpusConfig", + "DeleteRagCorpusConfigDict", + "DeleteRagCorpusConfigOrDict", + "DeleteRagCorpusOperation", + "DeleteRagCorpusOperationDict", + "DeleteRagCorpusOperationOrDict", + "DeleteRagFileConfig", + "DeleteRagFileConfigDict", + "DeleteRagFileConfigOrDict", + "DeleteRagFileOperation", + "DeleteRagFileOperationDict", + "DeleteRagFileOperationOrDict", + "UpdateRagConfig", + "UpdateRagConfigDict", + "UpdateRagConfigOrDict", + "UpdateRagConfigOperation", + "UpdateRagConfigOperationDict", + "UpdateRagConfigOperationOrDict", + "RetrieveContextsConfig", + "RetrieveContextsConfigDict", + "RetrieveContextsConfigOrDict", + "VertexRagStoreRagResource", + "VertexRagStoreRagResourceDict", + "VertexRagStoreRagResourceOrDict", + "VertexRagStore", + "VertexRagStoreDict", + "VertexRagStoreOrDict", + "RetrieveContextsResponse", + "RetrieveContextsResponseDict", + "RetrieveContextsResponseOrDict", + "GetRagConfigOperationConfig", + "GetRagConfigOperationConfigDict", + "GetRagConfigOperationConfigOrDict", + "RagEngineConfigOperation", + "RagEngineConfigOperationDict", + "RagEngineConfigOperationOrDict", "GetAgentEngineRuntimeRevisionConfig", "GetAgentEngineRuntimeRevisionConfigDict", "GetAgentEngineRuntimeRevisionConfigOrDict", @@ -2622,6 +3243,96 @@ "ListSkillRevisionsResponse", "ListSkillRevisionsResponseDict", "ListSkillRevisionsResponseOrDict", + "ListPublisherModelsConfig", + "ListPublisherModelsConfigDict", + "ListPublisherModelsConfigOrDict", + "PublisherModelResourceReference", + "PublisherModelResourceReferenceDict", + "PublisherModelResourceReferenceOrDict", + "PublisherModelParent", + "PublisherModelParentDict", + "PublisherModelParentOrDict", + "PredictSchemata", + "PredictSchemataDict", + "PredictSchemataOrDict", + "PublisherModelCallToActionRegionalResourceReferences", + "PublisherModelCallToActionRegionalResourceReferencesDict", + "PublisherModelCallToActionRegionalResourceReferencesOrDict", + "AutomaticResources", + "AutomaticResourcesDict", + "AutomaticResourcesOrDict", + "Port", + "PortDict", + "PortOrDict", + "ProbeExecAction", + "ProbeExecActionDict", + "ProbeExecActionOrDict", + "ProbeGrpcAction", + "ProbeGrpcActionDict", + "ProbeGrpcActionOrDict", + "ProbeHttpHeader", + "ProbeHttpHeaderDict", + "ProbeHttpHeaderOrDict", + "ProbeHttpGetAction", + "ProbeHttpGetActionDict", + "ProbeHttpGetActionOrDict", + "ProbeTcpSocketAction", + "ProbeTcpSocketActionDict", + "ProbeTcpSocketActionOrDict", + "Probe", + "ProbeDict", + "ProbeOrDict", + "ModelContainerSpec", + "ModelContainerSpecDict", + "ModelContainerSpecOrDict", + "AutoscalingMetricSpec", + "AutoscalingMetricSpecDict", + "AutoscalingMetricSpecOrDict", + "FlexStart", + "FlexStartDict", + "FlexStartOrDict", + "DedicatedResourcesScaleToZeroSpec", + "DedicatedResourcesScaleToZeroSpecDict", + "DedicatedResourcesScaleToZeroSpecOrDict", + "DedicatedResources", + "DedicatedResourcesDict", + "DedicatedResourcesOrDict", + "PublisherModelCallToActionDeployDeployMetadata", + "PublisherModelCallToActionDeployDeployMetadataDict", + "PublisherModelCallToActionDeployDeployMetadataOrDict", + "LargeModelReference", + "LargeModelReferenceDict", + "LargeModelReferenceOrDict", + "PublisherModelCallToActionDeploy", + "PublisherModelCallToActionDeployDict", + "PublisherModelCallToActionDeployOrDict", + "PublisherModelCallToActionDeployGke", + "PublisherModelCallToActionDeployGkeDict", + "PublisherModelCallToActionDeployGkeOrDict", + "PublisherModelCallToActionDeployVertex", + "PublisherModelCallToActionDeployVertexDict", + "PublisherModelCallToActionDeployVertexOrDict", + "PublisherModelCallToActionOpenFineTuningPipelines", + "PublisherModelCallToActionOpenFineTuningPipelinesDict", + "PublisherModelCallToActionOpenFineTuningPipelinesOrDict", + "PublisherModelCallToActionOpenNotebooks", + "PublisherModelCallToActionOpenNotebooksDict", + "PublisherModelCallToActionOpenNotebooksOrDict", + "PublisherModelDocumentation", + "PublisherModelDocumentationDict", + "PublisherModelDocumentationOrDict", + "PublisherModelCallToActionViewRestApi", + "PublisherModelCallToActionViewRestApiDict", + "PublisherModelCallToActionViewRestApiOrDict", + "PublisherModelCallToAction", + "PublisherModelCallToActionDict", + "PublisherModelCallToActionOrDict", + "PublisherModel", + "PublisherModelDict", + "PublisherModelOrDict", + "ListPublisherModelsResponse", + "ListPublisherModelsResponseDict", + "ListPublisherModelsResponseOrDict", "PromptOptimizerConfig", "PromptOptimizerConfigDict", "PromptOptimizerConfigOrDict", @@ -2712,6 +3423,12 @@ "AgentEngineRuntimeRevision", "AgentEngineRuntimeRevisionDict", "AgentEngineRuntimeRevisionOrDict", + "ListDeployableModelsConfig", + "ListDeployableModelsConfigDict", + "ListDeployableModelsConfigOrDict", + "ListModelGardenModelsConfig", + "ListModelGardenModelsConfigDict", + "ListModelGardenModelsConfigOrDict", "A2aTaskState", "State", "Strategy", @@ -2723,6 +3440,8 @@ "AgentServerMode", "MemoryType", "Operator", + "RagFileType", + "ResourceType", "Language", "MachineConfig", "SandboxState", @@ -2730,14 +3449,18 @@ "DefaultContainerCategory", "PostSnapshotAction", "Framework", + "SkillState", "SkillSource", + "LaunchStage", + "OpenSourceCategory", + "VersionState", "EvaluationItemType", "SamplingMethod", "EvaluationRunState", "OptimizeTarget", "MemoryMetadataMergeStrategy", "GenerateMemoriesResponseGeneratedMemoryAction", - "SkillState", + "SkillRevisionState", "PromptOptimizerMethod", "OptimizationMethod", "PromptData", @@ -2810,6 +3533,20 @@ "_PurgeAgentEngineMemoriesRequestParameters", "_GetAgentEngineMemoryRevisionRequestParameters", "_ListAgentEngineMemoryRevisionsRequestParameters", + "_AskContextsRequestParameters", + "_CreateRagCorpusRequestParameters", + "_GetCorpusOperationParameters", + "_GetRagCorpusRequestParameters", + "_ListRagCorporaRequestParameters", + "_GetRagFileRequestParameters", + "_ListRagFilesRequestParameters", + "_GetRagConfigRequestParameters", + "_UpdateRagCorpusRequestParameters", + "_DeleteRagCorpusRequestParameters", + "_DeleteRagFileRequestParameters", + "_UpdateRagConfigRequestParameters", + "_RetrieveRagContextsRequestParameters", + "_GetRagConfigOperationParameters", "_GetAgentEngineRuntimeRevisionRequestParameters", "_ListAgentEngineRuntimeRevisionsRequestParameters", "_DeleteAgentEngineRuntimeRevisionRequestParameters", @@ -2870,6 +3607,7 @@ "_GetSkillOperationParameters", "_GetSkillRevisionRequestParameters", "_ListSkillRevisionsRequestParameters", + "_ListPublisherModelsRequestParameters", "evals", "agent_engines", "prompts", diff --git a/vertexai/_genai/types/common.py b/vertexai/_genai/types/common.py index f9ac6e1353..517c8e13ec 100644 --- a/vertexai/_genai/types/common.py +++ b/vertexai/_genai/types/common.py @@ -86,7 +86,7 @@ def _camel_key_to_snake(message: Any) -> Any: except ImportError: yaml = None -logger = logging.getLogger("vertexai_genai.types") +logger = logging.getLogger("agentplatform_genai.types") MetricSubclass = TypeVar("MetricSubclass", bound="Metric") @@ -304,6 +304,28 @@ class Operator(_common.CaseInSensitiveEnum): """Less than.""" +class RagFileType(_common.CaseInSensitiveEnum): + """Output only. The type of the RagFile.""" + + RAG_FILE_TYPE_UNSPECIFIED = "RAG_FILE_TYPE_UNSPECIFIED" + """RagFile type is unspecified.""" + RAG_FILE_TYPE_TXT = "RAG_FILE_TYPE_TXT" + """RagFile type is TXT.""" + RAG_FILE_TYPE_PDF = "RAG_FILE_TYPE_PDF" + """RagFile type is PDF.""" + + +class ResourceType(_common.CaseInSensitiveEnum): + """The type of the Google Drive resource.""" + + RESOURCE_TYPE_UNSPECIFIED = "RESOURCE_TYPE_UNSPECIFIED" + """Unspecified resource type.""" + RESOURCE_TYPE_FILE = "RESOURCE_TYPE_FILE" + """File resource type.""" + RESOURCE_TYPE_FOLDER = "RESOURCE_TYPE_FOLDER" + """Folder resource type.""" + + class Language(_common.CaseInSensitiveEnum): """The coding language supported in this environment.""" @@ -383,6 +405,21 @@ class Framework(_common.CaseInSensitiveEnum): """Angular framework.""" +class SkillState(_common.CaseInSensitiveEnum): + """State of the Skill.""" + + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + """The state of the Skill is unspecified.""" + ACTIVE = "ACTIVE" + """The Skill is active.""" + CREATING = "CREATING" + """The Skill is being created.""" + FAILED = "FAILED" + """The Skill was created, but failed to process.""" + DELETING = "DELETING" + """The Skill is being deleted.""" + + class SkillSource(_common.CaseInSensitiveEnum): """Output only. The source of the Skill.""" @@ -394,6 +431,51 @@ class SkillSource(_common.CaseInSensitiveEnum): """The skill is a system skill.""" +class LaunchStage(_common.CaseInSensitiveEnum): + """Indicates the launch stage of the model.""" + + LAUNCH_STAGE_UNSPECIFIED = "LAUNCH_STAGE_UNSPECIFIED" + """The model launch stage is unspecified.""" + EXPERIMENTAL = "EXPERIMENTAL" + """Used to indicate the PublisherModel is at Experimental launch stage, available to a small set of customers.""" + PRIVATE_PREVIEW = "PRIVATE_PREVIEW" + """Used to indicate the PublisherModel is at Private Preview launch stage, only available to a small set of customers, although a larger set of customers than an Experimental launch. Previews are the first launch stage used to get feedback from customers.""" + PUBLIC_PREVIEW = "PUBLIC_PREVIEW" + """Used to indicate the PublisherModel is at Public Preview launch stage, available to all customers, although not supported for production workloads.""" + GA = "GA" + """Used to indicate the PublisherModel is at GA launch stage, available to all customers and ready for production workload.""" + + +class OpenSourceCategory(_common.CaseInSensitiveEnum): + """Indicates the open source category of the publisher model.""" + + OPEN_SOURCE_CATEGORY_UNSPECIFIED = "OPEN_SOURCE_CATEGORY_UNSPECIFIED" + """The open source category is unspecified, which should not be used.""" + PROPRIETARY = "PROPRIETARY" + """Used to indicate the PublisherModel is not open sourced.""" + GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = "GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT" + """Used to indicate the PublisherModel is a Google-owned open source model w/ Google checkpoint.""" + THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = ( + "THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT" + ) + """Used to indicate the PublisherModel is a 3p-owned open source model w/ Google checkpoint.""" + GOOGLE_OWNED_OSS = "GOOGLE_OWNED_OSS" + """Used to indicate the PublisherModel is a Google-owned pure open source model.""" + THIRD_PARTY_OWNED_OSS = "THIRD_PARTY_OWNED_OSS" + """Used to indicate the PublisherModel is a 3p-owned pure open source model.""" + + +class VersionState(_common.CaseInSensitiveEnum): + """Indicates the state of the model version.""" + + VERSION_STATE_UNSPECIFIED = "VERSION_STATE_UNSPECIFIED" + """The version state is unspecified.""" + VERSION_STATE_STABLE = "VERSION_STATE_STABLE" + """Used to indicate the version is stable.""" + VERSION_STATE_UNSTABLE = "VERSION_STATE_UNSTABLE" + """Used to indicate the version is unstable.""" + + class EvaluationItemType(_common.CaseInSensitiveEnum): """The type of the EvaluationItem.""" @@ -474,19 +556,19 @@ class GenerateMemoriesResponseGeneratedMemoryAction(_common.CaseInSensitiveEnum) """The memory was deleted.""" -class SkillState(_common.CaseInSensitiveEnum): - """State of the Skill.""" +class SkillRevisionState(_common.CaseInSensitiveEnum): + """State of the Skill Revision.""" STATE_UNSPECIFIED = "STATE_UNSPECIFIED" - """The state of the Skill is unspecified.""" + """The state of the Skill Revision is unspecified.""" ACTIVE = "ACTIVE" - """The Skill is active.""" + """The Skill Revision is active.""" CREATING = "CREATING" - """The Skill is being created.""" + """The Skill Revision is being created.""" FAILED = "FAILED" - """The Skill was created, but failed to process.""" + """The Skill Revision was created, but failed to process.""" DELETING = "DELETING" - """The Skill is being deleted.""" + """The Skill Revision is being deleted.""" class PromptOptimizerMethod(_common.CaseInSensitiveEnum): @@ -11899,1504 +11981,1297 @@ class ListAgentEngineMemoryRevisionsResponseDict(TypedDict, total=False): ] -class GetAgentEngineRuntimeRevisionConfig(_common.BaseModel): - """Config for getting an Agent Engine Runtime Revision.""" +class AskContextsConfig(_common.BaseModel): + """Config for asking RAG Contexts.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) -class GetAgentEngineRuntimeRevisionConfigDict(TypedDict, total=False): - """Config for getting an Agent Engine Runtime Revision.""" +class AskContextsConfigDict(TypedDict, total=False): + """Config for asking RAG Contexts.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" -GetAgentEngineRuntimeRevisionConfigOrDict = Union[ - GetAgentEngineRuntimeRevisionConfig, GetAgentEngineRuntimeRevisionConfigDict -] +AskContextsConfigOrDict = Union[AskContextsConfig, AskContextsConfigDict] -class _GetAgentEngineRuntimeRevisionRequestParameters(_common.BaseModel): - """Parameters for getting an agent engine runtime revision.""" +class RagRetrievalConfigFilter(_common.BaseModel): + """Config for filters.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine runtime revision.""" + metadata_filter: Optional[str] = Field( + default=None, description="""Optional. String for metadata filtering.""" ) - config: Optional[GetAgentEngineRuntimeRevisionConfig] = Field( - default=None, description="""""" + vector_distance_threshold: Optional[float] = Field( + default=None, + description="""Optional. Only returns contexts with vector distance smaller than the threshold.""", + ) + vector_similarity_threshold: Optional[float] = Field( + default=None, + description="""Optional. Only returns contexts with vector similarity larger than the threshold.""", ) -class _GetAgentEngineRuntimeRevisionRequestParametersDict(TypedDict, total=False): - """Parameters for getting an agent engine runtime revision.""" +class RagRetrievalConfigFilterDict(TypedDict, total=False): + """Config for filters.""" - name: Optional[str] - """Name of the agent engine runtime revision.""" + metadata_filter: Optional[str] + """Optional. String for metadata filtering.""" - config: Optional[GetAgentEngineRuntimeRevisionConfigDict] - """""" + vector_distance_threshold: Optional[float] + """Optional. Only returns contexts with vector distance smaller than the threshold.""" + vector_similarity_threshold: Optional[float] + """Optional. Only returns contexts with vector similarity larger than the threshold.""" -_GetAgentEngineRuntimeRevisionRequestParametersOrDict = Union[ - _GetAgentEngineRuntimeRevisionRequestParameters, - _GetAgentEngineRuntimeRevisionRequestParametersDict, + +RagRetrievalConfigFilterOrDict = Union[ + RagRetrievalConfigFilter, RagRetrievalConfigFilterDict ] -class ReasoningEngineRuntimeRevision(_common.BaseModel): - """A runtime revision.""" +class RagRetrievalConfigHybridSearch(_common.BaseModel): + """Config for Hybrid Search.""" - create_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. Timestamp when this ReasoningEngineRuntimeRevision was created.""", - ) - name: Optional[str] = Field( + alpha: Optional[float] = Field( default=None, - description="""Identifier. The resource name of the ReasoningEngineRuntimeRevision. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`""", - ) - spec: Optional[ReasoningEngineSpec] = Field( - default=None, - description="""Immutable. Configurations of the ReasoningEngineRuntimeRevision. Contains only revision specific fields.""", - ) - state: Optional[State] = Field( - default=None, description="""Output only. The state of the revision.""" + description="""Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.""", ) -class ReasoningEngineRuntimeRevisionDict(TypedDict, total=False): - """A runtime revision.""" - - create_time: Optional[datetime.datetime] - """Output only. Timestamp when this ReasoningEngineRuntimeRevision was created.""" - - name: Optional[str] - """Identifier. The resource name of the ReasoningEngineRuntimeRevision. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`""" +class RagRetrievalConfigHybridSearchDict(TypedDict, total=False): + """Config for Hybrid Search.""" - spec: Optional[ReasoningEngineSpecDict] - """Immutable. Configurations of the ReasoningEngineRuntimeRevision. Contains only revision specific fields.""" - - state: Optional[State] - """Output only. The state of the revision.""" + alpha: Optional[float] + """Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.""" -ReasoningEngineRuntimeRevisionOrDict = Union[ - ReasoningEngineRuntimeRevision, ReasoningEngineRuntimeRevisionDict +RagRetrievalConfigHybridSearchOrDict = Union[ + RagRetrievalConfigHybridSearch, RagRetrievalConfigHybridSearchDict ] -class ListAgentEngineRuntimeRevisionsConfig(_common.BaseModel): - """Config for listing reasoning engine runtime revisions.""" +class RagRetrievalConfigRankingLlmRanker(_common.BaseModel): + """Config for LlmRanker.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( + model_name: Optional[str] = Field( default=None, - description="""An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""", + description="""Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).""", ) -class ListAgentEngineRuntimeRevisionsConfigDict(TypedDict, total=False): - """Config for listing reasoning engine runtime revisions.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - - page_size: Optional[int] - """""" - - page_token: Optional[str] - """""" +class RagRetrievalConfigRankingLlmRankerDict(TypedDict, total=False): + """Config for LlmRanker.""" - filter: Optional[str] - """An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""" + model_name: Optional[str] + """Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).""" -ListAgentEngineRuntimeRevisionsConfigOrDict = Union[ - ListAgentEngineRuntimeRevisionsConfig, ListAgentEngineRuntimeRevisionsConfigDict +RagRetrievalConfigRankingLlmRankerOrDict = Union[ + RagRetrievalConfigRankingLlmRanker, RagRetrievalConfigRankingLlmRankerDict ] -class _ListAgentEngineRuntimeRevisionsRequestParameters(_common.BaseModel): - """Parameters for listing reasoning engine runtime revisions.""" +class RagRetrievalConfigRankingRankService(_common.BaseModel): + """Config for Rank Service.""" - name: Optional[str] = Field( - default=None, description="""Name of the reasoning engine.""" - ) - config: Optional[ListAgentEngineRuntimeRevisionsConfig] = Field( - default=None, description="""""" + model_name: Optional[str] = Field( + default=None, + description="""Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`""", ) -class _ListAgentEngineRuntimeRevisionsRequestParametersDict(TypedDict, total=False): - """Parameters for listing reasoning engine runtime revisions.""" - - name: Optional[str] - """Name of the reasoning engine.""" +class RagRetrievalConfigRankingRankServiceDict(TypedDict, total=False): + """Config for Rank Service.""" - config: Optional[ListAgentEngineRuntimeRevisionsConfigDict] - """""" + model_name: Optional[str] + """Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`""" -_ListAgentEngineRuntimeRevisionsRequestParametersOrDict = Union[ - _ListAgentEngineRuntimeRevisionsRequestParameters, - _ListAgentEngineRuntimeRevisionsRequestParametersDict, +RagRetrievalConfigRankingRankServiceOrDict = Union[ + RagRetrievalConfigRankingRankService, RagRetrievalConfigRankingRankServiceDict ] -class ListReasoningEnginesRuntimeRevisionsResponse(_common.BaseModel): - """Response for listing agent engine runtime revisions.""" +class RagRetrievalConfigRanking(_common.BaseModel): + """Config for ranking and reranking.""" - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" + llm_ranker: Optional[RagRetrievalConfigRankingLlmRanker] = Field( + default=None, description="""Optional. Config for LlmRanker.""" ) - next_page_token: Optional[str] = Field(default=None, description="""""") - reasoning_engine_runtime_revisions: Optional[ - list[ReasoningEngineRuntimeRevision] - ] = Field( - default=None, description="""List of reasoning engine runtime revisions.""" + rank_service: Optional[RagRetrievalConfigRankingRankService] = Field( + default=None, description="""Optional. Config for Rank Service.""" ) -class ListReasoningEnginesRuntimeRevisionsResponseDict(TypedDict, total=False): - """Response for listing agent engine runtime revisions.""" - - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" +class RagRetrievalConfigRankingDict(TypedDict, total=False): + """Config for ranking and reranking.""" - next_page_token: Optional[str] - """""" + llm_ranker: Optional[RagRetrievalConfigRankingLlmRankerDict] + """Optional. Config for LlmRanker.""" - reasoning_engine_runtime_revisions: Optional[ - list[ReasoningEngineRuntimeRevisionDict] - ] - """List of reasoning engine runtime revisions.""" + rank_service: Optional[RagRetrievalConfigRankingRankServiceDict] + """Optional. Config for Rank Service.""" -ListReasoningEnginesRuntimeRevisionsResponseOrDict = Union[ - ListReasoningEnginesRuntimeRevisionsResponse, - ListReasoningEnginesRuntimeRevisionsResponseDict, +RagRetrievalConfigRankingOrDict = Union[ + RagRetrievalConfigRanking, RagRetrievalConfigRankingDict ] -class DeleteAgentEngineRuntimeRevisionConfig(_common.BaseModel): - """Config for deleting an Agent Engine Runtime Revision.""" +class RagRetrievalConfig(_common.BaseModel): + """Specifies the context retrieval config.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + filter: Optional[RagRetrievalConfigFilter] = Field( + default=None, description="""Optional. Config for filters.""" ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Waits for the operation to complete before returning.""", + hybrid_search: Optional[RagRetrievalConfigHybridSearch] = Field( + default=None, description="""Optional. Config for Hybrid Search.""" + ) + ranking: Optional[RagRetrievalConfigRanking] = Field( + default=None, description="""Optional. Config for ranking and reranking.""" + ) + top_k: Optional[int] = Field( + default=None, description="""Optional. The number of contexts to retrieve.""" ) -class DeleteAgentEngineRuntimeRevisionConfigDict(TypedDict, total=False): - """Config for deleting an Agent Engine Runtime Revision.""" +class RagRetrievalConfigDict(TypedDict, total=False): + """Specifies the context retrieval config.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + filter: Optional[RagRetrievalConfigFilterDict] + """Optional. Config for filters.""" - wait_for_completion: Optional[bool] - """Waits for the operation to complete before returning.""" + hybrid_search: Optional[RagRetrievalConfigHybridSearchDict] + """Optional. Config for Hybrid Search.""" + ranking: Optional[RagRetrievalConfigRankingDict] + """Optional. Config for ranking and reranking.""" -DeleteAgentEngineRuntimeRevisionConfigOrDict = Union[ - DeleteAgentEngineRuntimeRevisionConfig, DeleteAgentEngineRuntimeRevisionConfigDict -] + top_k: Optional[int] + """Optional. The number of contexts to retrieve.""" -class _DeleteAgentEngineRuntimeRevisionRequestParameters(_common.BaseModel): - """Parameters for deleting agent engine runtime revisions.""" +RagRetrievalConfigOrDict = Union[RagRetrievalConfig, RagRetrievalConfigDict] - name: Optional[str] = Field( + +class RagQueryRanking(_common.BaseModel): + """Configurations for hybrid search results ranking.""" + + alpha: Optional[float] = Field( default=None, - description="""Name of the agent engine runtime revision to delete.""", - ) - config: Optional[DeleteAgentEngineRuntimeRevisionConfig] = Field( - default=None, description="""""" + description="""Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.""", ) -class _DeleteAgentEngineRuntimeRevisionRequestParametersDict(TypedDict, total=False): - """Parameters for deleting agent engine runtime revisions.""" - - name: Optional[str] - """Name of the agent engine runtime revision to delete.""" +class RagQueryRankingDict(TypedDict, total=False): + """Configurations for hybrid search results ranking.""" - config: Optional[DeleteAgentEngineRuntimeRevisionConfigDict] - """""" + alpha: Optional[float] + """Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.""" -_DeleteAgentEngineRuntimeRevisionRequestParametersOrDict = Union[ - _DeleteAgentEngineRuntimeRevisionRequestParameters, - _DeleteAgentEngineRuntimeRevisionRequestParametersDict, -] +RagQueryRankingOrDict = Union[RagQueryRanking, RagQueryRankingDict] -class DeleteAgentEngineRuntimeRevisionOperation(_common.BaseModel): - """Operation for deleting agent engine runtime revisions.""" +class RagQuery(_common.BaseModel): + """A query to retrieve relevant contexts.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", + rag_retrieval_config: Optional[RagRetrievalConfig] = Field( + default=None, description="""Optional. The retrieval config for the query.""" ) - metadata: Optional[dict[str, Any]] = Field( + ranking: Optional[RagQueryRanking] = Field( default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + description="""Optional. Configurations for hybrid search results ranking.""", ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + similarity_top_k: Optional[int] = Field( + default=None, description="""Optional. The number of contexts to retrieve.""" ) - error: Optional[dict[str, Any]] = Field( + text: Optional[str] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Optional. The query in text format to get relevant contexts.""", ) -class DeleteAgentEngineRuntimeRevisionOperationDict(TypedDict, total=False): - """Operation for deleting agent engine runtime revisions.""" +class RagQueryDict(TypedDict, total=False): + """A query to retrieve relevant contexts.""" - 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}`.""" + rag_retrieval_config: Optional[RagRetrievalConfigDict] + """Optional. The retrieval config for the query.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + ranking: Optional[RagQueryRankingDict] + """Optional. Configurations for hybrid search results ranking.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + similarity_top_k: Optional[int] + """Optional. The number of contexts to retrieve.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + text: Optional[str] + """Optional. The query in text format to get relevant contexts.""" -DeleteAgentEngineRuntimeRevisionOperationOrDict = Union[ - DeleteAgentEngineRuntimeRevisionOperation, - DeleteAgentEngineRuntimeRevisionOperationDict, -] +RagQueryOrDict = Union[RagQuery, RagQueryDict] -class GetDeleteAgentEngineRuntimeRevisionOperationConfig(_common.BaseModel): +class _AskContextsRequestParameters(_common.BaseModel): + """Parameters for asking RAG Contexts.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) + query: Optional[RagQuery] = Field(default=None, description="""""") + config: Optional[AskContextsConfig] = Field(default=None, description="""""") + tools: Optional[list[genai_types.Tool]] = Field(default=None, description="""""") -class GetDeleteAgentEngineRuntimeRevisionOperationConfigDict(TypedDict, total=False): +class _AskContextsRequestParametersDict(TypedDict, total=False): + """Parameters for asking RAG Contexts.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + query: Optional[RagQueryDict] + """""" + config: Optional[AskContextsConfigDict] + """""" -GetDeleteAgentEngineRuntimeRevisionOperationConfigOrDict = Union[ - GetDeleteAgentEngineRuntimeRevisionOperationConfig, - GetDeleteAgentEngineRuntimeRevisionOperationConfigDict, + tools: Optional[list[genai_types.ToolDict]] + """""" + + +_AskContextsRequestParametersOrDict = Union[ + _AskContextsRequestParameters, _AskContextsRequestParametersDict ] -class _GetDeleteAgentEngineRuntimeRevisionOperationParameters(_common.BaseModel): - """Parameters for getting an operation that deletes a agent engine runtime revision.""" +class RagChunkPageSpan(_common.BaseModel): + """Represents where the chunk starts and ends in the document.""" - operation_name: Optional[str] = Field( - default=None, description="""The server-assigned name for the operation.""" + first_page: Optional[int] = Field( + default=None, + description="""Page where chunk starts in the document. Inclusive. 1-indexed.""", ) - config: Optional[GetDeleteAgentEngineRuntimeRevisionOperationConfig] = Field( - default=None, description="""Used to override the default configuration.""" + last_page: Optional[int] = Field( + default=None, + description="""Page where chunk ends in the document. Inclusive. 1-indexed.""", ) -class _GetDeleteAgentEngineRuntimeRevisionOperationParametersDict( - TypedDict, total=False -): - """Parameters for getting an operation that deletes a agent engine runtime revision.""" +class RagChunkPageSpanDict(TypedDict, total=False): + """Represents where the chunk starts and ends in the document.""" - operation_name: Optional[str] - """The server-assigned name for the operation.""" + first_page: Optional[int] + """Page where chunk starts in the document. Inclusive. 1-indexed.""" - config: Optional[GetDeleteAgentEngineRuntimeRevisionOperationConfigDict] - """Used to override the default configuration.""" + last_page: Optional[int] + """Page where chunk ends in the document. Inclusive. 1-indexed.""" -_GetDeleteAgentEngineRuntimeRevisionOperationParametersOrDict = Union[ - _GetDeleteAgentEngineRuntimeRevisionOperationParameters, - _GetDeleteAgentEngineRuntimeRevisionOperationParametersDict, -] +RagChunkPageSpanOrDict = Union[RagChunkPageSpan, RagChunkPageSpanDict] -class QueryAgentEngineRuntimeRevisionConfig(_common.BaseModel): - """Config for querying agent engine runtime revisions.""" +class RagChunk(_common.BaseModel): + """A RagChunk includes the content of a chunk of a RagFile, and associated metadata.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + chunk_id: Optional[str] = Field( + default=None, description="""The ID of the chunk.""" ) - class_method: Optional[str] = Field( - default=None, description="""The class method to call.""" + file_id: Optional[str] = Field( + default=None, description="""The ID of the file that the chunk belongs to.""" ) - input: Optional[dict[str, Any]] = Field( - default=None, description="""The input to the class method.""" + page_span: Optional[RagChunkPageSpan] = Field( + default=None, + description="""If populated, represents where the chunk starts and ends in the document.""", + ) + text: Optional[str] = Field( + default=None, description="""The content of the chunk.""" ) - include_all_fields: Optional[bool] = Field(default=False, description="""""") -class QueryAgentEngineRuntimeRevisionConfigDict(TypedDict, total=False): - """Config for querying agent engine runtime revisions.""" +class RagChunkDict(TypedDict, total=False): + """A RagChunk includes the content of a chunk of a RagFile, and associated metadata.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + chunk_id: Optional[str] + """The ID of the chunk.""" - class_method: Optional[str] - """The class method to call.""" + file_id: Optional[str] + """The ID of the file that the chunk belongs to.""" - input: Optional[dict[str, Any]] - """The input to the class method.""" + page_span: Optional[RagChunkPageSpanDict] + """If populated, represents where the chunk starts and ends in the document.""" - include_all_fields: Optional[bool] - """""" + text: Optional[str] + """The content of the chunk.""" -QueryAgentEngineRuntimeRevisionConfigOrDict = Union[ - QueryAgentEngineRuntimeRevisionConfig, QueryAgentEngineRuntimeRevisionConfigDict -] +RagChunkOrDict = Union[RagChunk, RagChunkDict] -class _QueryAgentEngineRuntimeRevisionRequestParameters(_common.BaseModel): - """Parameters for querying agent engine runtime revisions.""" +class RagContextsContext(_common.BaseModel): + """A context of the query.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine runtime revision.""" + chunk: Optional[RagChunk] = Field( + default=None, description="""Context of the retrieved chunk.""" ) - config: Optional[QueryAgentEngineRuntimeRevisionConfig] = Field( - default=None, description="""""" + distance: Optional[float] = Field( + default=None, + description="""The distance between the query dense embedding vector and the context text vector.""", + ) + score: Optional[float] = Field( + default=None, + description="""According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.""", + ) + source_display_name: Optional[str] = Field( + default=None, description="""The file display name.""" + ) + source_uri: Optional[str] = Field( + default=None, + description="""If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.""", ) + sparse_distance: Optional[float] = Field( + default=None, + description="""The distance between the query sparse embedding vector and the context text vector.""", + ) + text: Optional[str] = Field(default=None, description="""The text chunk.""") -class _QueryAgentEngineRuntimeRevisionRequestParametersDict(TypedDict, total=False): - """Parameters for querying agent engine runtime revisions.""" +class RagContextsContextDict(TypedDict, total=False): + """A context of the query.""" - name: Optional[str] - """Name of the agent engine runtime revision.""" + chunk: Optional[RagChunkDict] + """Context of the retrieved chunk.""" - config: Optional[QueryAgentEngineRuntimeRevisionConfigDict] - """""" + distance: Optional[float] + """The distance between the query dense embedding vector and the context text vector.""" + score: Optional[float] + """According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.""" -_QueryAgentEngineRuntimeRevisionRequestParametersOrDict = Union[ - _QueryAgentEngineRuntimeRevisionRequestParameters, - _QueryAgentEngineRuntimeRevisionRequestParametersDict, -] + source_display_name: Optional[str] + """The file display name.""" + source_uri: Optional[str] + """If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.""" -class SandboxEnvironmentSpecCodeExecutionEnvironment(_common.BaseModel): - """The code execution environment with customized settings.""" + sparse_distance: Optional[float] + """The distance between the query sparse embedding vector and the context text vector.""" - code_language: Optional[Language] = Field( - default=None, - description="""The coding language supported in this environment.""", - ) - machine_config: Optional[MachineConfig] = Field( - default=None, - description="""The machine config of the code execution environment.""", + text: Optional[str] + """The text chunk.""" + + +RagContextsContextOrDict = Union[RagContextsContext, RagContextsContextDict] + + +class RagContexts(_common.BaseModel): + """Relevant contexts for one query.""" + + contexts: Optional[list[RagContextsContext]] = Field( + default=None, description="""All its contexts.""" ) -class SandboxEnvironmentSpecCodeExecutionEnvironmentDict(TypedDict, total=False): - """The code execution environment with customized settings.""" +class RagContextsDict(TypedDict, total=False): + """Relevant contexts for one query.""" - code_language: Optional[Language] - """The coding language supported in this environment.""" + contexts: Optional[list[RagContextsContextDict]] + """All its contexts.""" - machine_config: Optional[MachineConfig] - """The machine config of the code execution environment.""" +RagContextsOrDict = Union[RagContexts, RagContextsDict] -SandboxEnvironmentSpecCodeExecutionEnvironmentOrDict = Union[ - SandboxEnvironmentSpecCodeExecutionEnvironment, - SandboxEnvironmentSpecCodeExecutionEnvironmentDict, -] +class AskContextsResponse(_common.BaseModel): -class SandboxEnvironmentSpecComputerUseEnvironment(_common.BaseModel): - """The computer use environment with customized settings.""" + contexts: Optional[RagContexts] = Field( + default=None, description="""The contexts of the query.""" + ) + response: Optional[str] = Field( + default=None, description="""The Retrieval Response.""" + ) - pass +class AskContextsResponseDict(TypedDict, total=False): -class SandboxEnvironmentSpecComputerUseEnvironmentDict(TypedDict, total=False): - """The computer use environment with customized settings.""" + contexts: Optional[RagContextsDict] + """The contexts of the query.""" - pass + response: Optional[str] + """The Retrieval Response.""" -SandboxEnvironmentSpecComputerUseEnvironmentOrDict = Union[ - SandboxEnvironmentSpecComputerUseEnvironment, - SandboxEnvironmentSpecComputerUseEnvironmentDict, -] +AskContextsResponseOrDict = Union[AskContextsResponse, AskContextsResponseDict] -class SandboxEnvironmentSpec(_common.BaseModel): - """The specification of a sandbox environment.""" +class CorpusStatus(_common.BaseModel): + """RagCorpus status.""" - code_execution_environment: Optional[ - SandboxEnvironmentSpecCodeExecutionEnvironment - ] = Field(default=None, description="""Optional. The code execution environment.""") - computer_use_environment: Optional[SandboxEnvironmentSpecComputerUseEnvironment] = ( - Field(default=None, description="""Optional. The computer use environment.""") + error_status: Optional[str] = Field( + default=None, + description="""Output only. Only when the `state` field is ERROR.""", + ) + state: Optional[Literal["UNKNOWN", "INITIALIZED", "ACTIVE", "ERROR"]] = Field( + default=None, description="""Output only. RagCorpus life state.""" ) -class SandboxEnvironmentSpecDict(TypedDict, total=False): - """The specification of a sandbox environment.""" +class CorpusStatusDict(TypedDict, total=False): + """RagCorpus status.""" - code_execution_environment: Optional[ - SandboxEnvironmentSpecCodeExecutionEnvironmentDict - ] - """Optional. The code execution environment.""" + error_status: Optional[str] + """Output only. Only when the `state` field is ERROR.""" - computer_use_environment: Optional[SandboxEnvironmentSpecComputerUseEnvironmentDict] - """Optional. The computer use environment.""" + state: Optional[Literal["UNKNOWN", "INITIALIZED", "ACTIVE", "ERROR"]] + """Output only. RagCorpus life state.""" -SandboxEnvironmentSpecOrDict = Union[SandboxEnvironmentSpec, SandboxEnvironmentSpecDict] +CorpusStatusOrDict = Union[CorpusStatus, CorpusStatusDict] -class CreateAgentEngineSandboxConfig(_common.BaseModel): - """Config for creating a Sandbox.""" +class RagCorpusCorpusTypeConfigDocumentCorpus(_common.BaseModel): + """Config for the document corpus.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - display_name: Optional[str] = Field( - default=None, description="""The display name of the sandbox.""" - ) - description: Optional[str] = Field( - default=None, description="""The description of the sandbox.""" - ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Waits for the operation to complete before returning.""", - ) - ttl: Optional[str] = Field( + pass + + +class RagCorpusCorpusTypeConfigDocumentCorpusDict(TypedDict, total=False): + """Config for the document corpus.""" + + pass + + +RagCorpusCorpusTypeConfigDocumentCorpusOrDict = Union[ + RagCorpusCorpusTypeConfigDocumentCorpus, RagCorpusCorpusTypeConfigDocumentCorpusDict +] + + +class RagFileParsingConfigLlmParser(_common.BaseModel): + """Specifies the LLM parsing for RagFiles.""" + + custom_parsing_prompt: Optional[str] = Field( default=None, - description="""The TTL for this resource. The expiration time is computed: now + TTL.""", + description="""The prompt to use for parsing. If not specified, a default prompt will be used.""", ) - sandbox_environment_template: Optional[str] = Field( + global_max_parsing_requests_per_min: Optional[int] = Field( default=None, - description="""The name of the sandbox environment template to create the sandbox from. The sandbox environment template should be in the format: - projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}""", + description="""The maximum number of requests the job is allowed to make to the LLM model per minute in this project. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If this value is not specified, max_parsing_requests_per_min will be used by indexing pipeline job as the global limit.""", ) - sandbox_environment_snapshot: Optional[str] = Field( + max_parsing_requests_per_min: Optional[int] = Field( default=None, - description="""The name of the sandbox environment snapshot to restore the sandbox from. The sandbox environment snapshot should be in the format: - projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}""", + description="""The maximum number of requests the job is allowed to make to the LLM model per minute. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If unspecified, a default value of 5000 QPM would be used.""", ) - owner: Optional[str] = Field( + model_name: Optional[str] = Field( default=None, - description="""Owner information for this sandbox environment. A sandbox can only be restored from a snapshot belonging to the same owner.""", + description="""The name of a LLM model used for parsing. Format: * `projects/{project_id}/locations/{location}/publishers/{publisher}/models/{model}`""", ) -class CreateAgentEngineSandboxConfigDict(TypedDict, total=False): - """Config for creating a Sandbox.""" +class RagFileParsingConfigLlmParserDict(TypedDict, total=False): + """Specifies the LLM parsing for RagFiles.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + custom_parsing_prompt: Optional[str] + """The prompt to use for parsing. If not specified, a default prompt will be used.""" - display_name: Optional[str] - """The display name of the sandbox.""" + global_max_parsing_requests_per_min: Optional[int] + """The maximum number of requests the job is allowed to make to the LLM model per minute in this project. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If this value is not specified, max_parsing_requests_per_min will be used by indexing pipeline job as the global limit.""" - description: Optional[str] - """The description of the sandbox.""" + max_parsing_requests_per_min: Optional[int] + """The maximum number of requests the job is allowed to make to the LLM model per minute. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If unspecified, a default value of 5000 QPM would be used.""" - wait_for_completion: Optional[bool] - """Waits for the operation to complete before returning.""" + model_name: Optional[str] + """The name of a LLM model used for parsing. Format: * `projects/{project_id}/locations/{location}/publishers/{publisher}/models/{model}`""" - ttl: Optional[str] - """The TTL for this resource. The expiration time is computed: now + TTL.""" - sandbox_environment_template: Optional[str] - """The name of the sandbox environment template to create the sandbox from. The sandbox environment template should be in the format: - projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}""" +RagFileParsingConfigLlmParserOrDict = Union[ + RagFileParsingConfigLlmParser, RagFileParsingConfigLlmParserDict +] - sandbox_environment_snapshot: Optional[str] - """The name of the sandbox environment snapshot to restore the sandbox from. The sandbox environment snapshot should be in the format: - projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}""" - owner: Optional[str] - """Owner information for this sandbox environment. A sandbox can only be restored from a snapshot belonging to the same owner.""" +class RagCorpusCorpusTypeConfigMemoryCorpus(_common.BaseModel): + """Config for the memory corpus.""" + + llm_parser: Optional[RagFileParsingConfigLlmParser] = Field( + default=None, description="""The LLM parser to use for the memory corpus.""" + ) -CreateAgentEngineSandboxConfigOrDict = Union[ - CreateAgentEngineSandboxConfig, CreateAgentEngineSandboxConfigDict +class RagCorpusCorpusTypeConfigMemoryCorpusDict(TypedDict, total=False): + """Config for the memory corpus.""" + + llm_parser: Optional[RagFileParsingConfigLlmParserDict] + """The LLM parser to use for the memory corpus.""" + + +RagCorpusCorpusTypeConfigMemoryCorpusOrDict = Union[ + RagCorpusCorpusTypeConfigMemoryCorpus, RagCorpusCorpusTypeConfigMemoryCorpusDict ] -class _CreateAgentEngineSandboxRequestParameters(_common.BaseModel): - """Parameters for creating Agent Engine Sandboxes.""" +class RagCorpusCorpusTypeConfig(_common.BaseModel): + """The config for the corpus type of the RagCorpus.""" - name: Optional[str] = Field( - default=None, - description="""Name of the agent engine to create the sandbox under.""", - ) - spec: Optional[SandboxEnvironmentSpec] = Field( - default=None, description="""The specification of the sandbox.""" + document_corpus: Optional[RagCorpusCorpusTypeConfigDocumentCorpus] = Field( + default=None, description="""Optional. Config for the document corpus.""" ) - config: Optional[CreateAgentEngineSandboxConfig] = Field( - default=None, description="""""" + memory_corpus: Optional[RagCorpusCorpusTypeConfigMemoryCorpus] = Field( + default=None, description="""Optional. Config for the memory corpus.""" ) -class _CreateAgentEngineSandboxRequestParametersDict(TypedDict, total=False): - """Parameters for creating Agent Engine Sandboxes.""" - - name: Optional[str] - """Name of the agent engine to create the sandbox under.""" +class RagCorpusCorpusTypeConfigDict(TypedDict, total=False): + """The config for the corpus type of the RagCorpus.""" - spec: Optional[SandboxEnvironmentSpecDict] - """The specification of the sandbox.""" + document_corpus: Optional[RagCorpusCorpusTypeConfigDocumentCorpusDict] + """Optional. Config for the document corpus.""" - config: Optional[CreateAgentEngineSandboxConfigDict] - """""" + memory_corpus: Optional[RagCorpusCorpusTypeConfigMemoryCorpusDict] + """Optional. Config for the memory corpus.""" -_CreateAgentEngineSandboxRequestParametersOrDict = Union[ - _CreateAgentEngineSandboxRequestParameters, - _CreateAgentEngineSandboxRequestParametersDict, +RagCorpusCorpusTypeConfigOrDict = Union[ + RagCorpusCorpusTypeConfig, RagCorpusCorpusTypeConfigDict ] -class SandboxEnvironmentConnectionInfo(_common.BaseModel): - """The connection information of the SandboxEnvironment.""" +class EncryptionSpec(_common.BaseModel): + """Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource.""" - load_balancer_hostname: Optional[str] = Field( - default=None, description="""Output only. The hostname of the load balancer.""" + kms_key_name: Optional[str] = Field( + default=None, + description="""Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.""", ) - load_balancer_ip: Optional[str] = Field( + + +class EncryptionSpecDict(TypedDict, total=False): + """Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource.""" + + kms_key_name: Optional[str] + """Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.""" + + +EncryptionSpecOrDict = Union[EncryptionSpec, EncryptionSpecDict] + + +class RagEmbeddingModelConfigVertexPredictionEndpoint(_common.BaseModel): + """Config representing a model hosted on Vertex Prediction Endpoint.""" + + endpoint: Optional[str] = Field( default=None, - description="""Output only. The IP address of the load balancer.""", + description="""Required. The endpoint resource name. Format: `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` or `projects/{project}/locations/{location}/endpoints/{endpoint}`""", ) - sandbox_internal_ip: Optional[str] = Field( + model: Optional[str] = Field( default=None, - description="""Output only. The internal IP address of the SandboxEnvironment.""", + description="""Output only. The resource name of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model. Pattern: `projects/{project}/locations/{location}/models/{model}`""", ) - routing_token: Optional[str] = Field( + model_version_id: Optional[str] = Field( default=None, - description="""Output only. The routing token for the SandboxEnvironment.""", + description="""Output only. Version ID of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model.""", ) -class SandboxEnvironmentConnectionInfoDict(TypedDict, total=False): - """The connection information of the SandboxEnvironment.""" - - load_balancer_hostname: Optional[str] - """Output only. The hostname of the load balancer.""" +class RagEmbeddingModelConfigVertexPredictionEndpointDict(TypedDict, total=False): + """Config representing a model hosted on Vertex Prediction Endpoint.""" - load_balancer_ip: Optional[str] - """Output only. The IP address of the load balancer.""" + endpoint: Optional[str] + """Required. The endpoint resource name. Format: `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` or `projects/{project}/locations/{location}/endpoints/{endpoint}`""" - sandbox_internal_ip: Optional[str] - """Output only. The internal IP address of the SandboxEnvironment.""" + model: Optional[str] + """Output only. The resource name of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model. Pattern: `projects/{project}/locations/{location}/models/{model}`""" - routing_token: Optional[str] - """Output only. The routing token for the SandboxEnvironment.""" + model_version_id: Optional[str] + """Output only. Version ID of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model.""" -SandboxEnvironmentConnectionInfoOrDict = Union[ - SandboxEnvironmentConnectionInfo, SandboxEnvironmentConnectionInfoDict +RagEmbeddingModelConfigVertexPredictionEndpointOrDict = Union[ + RagEmbeddingModelConfigVertexPredictionEndpoint, + RagEmbeddingModelConfigVertexPredictionEndpointDict, ] -class SandboxEnvironment(_common.BaseModel): - """A sandbox environment.""" +class RagEmbeddingModelConfigSparseEmbeddingConfigBm25(_common.BaseModel): + """Message for BM25 parameters.""" - expire_time: Optional[datetime.datetime] = Field( - default=None, - description="""Expiration time of the sandbox environment. - """, - ) - connection_info: Optional[SandboxEnvironmentConnectionInfo] = Field( + b: Optional[float] = Field( default=None, - description="""Output only. The connection information of the SandboxEnvironment.""", + description="""Optional. The parameter to control document length normalization. It determines how much the document length affects the final score. b is in the range of [0, 1]. The default value is 0.75.""", ) - create_time: Optional[datetime.datetime] = Field( + k1: Optional[float] = Field( default=None, - description="""Output only. The timestamp when this SandboxEnvironment was created.""", + description="""Optional. The parameter to control term frequency saturation. It determines the scaling between the matching term frequency and final score. k1 is in the range of [1.2, 3]. The default value is 1.2.""", ) - display_name: Optional[str] = Field( + multilingual: Optional[bool] = Field( default=None, - description="""Required. The display name of the SandboxEnvironment.""", + description="""Optional. Use multilingual tokenizer if set to true.""", ) - name: Optional[str] = Field( - default=None, description="""Identifier. The name of the SandboxEnvironment.""" - ) - spec: Optional[SandboxEnvironmentSpec] = Field( - default=None, - description="""Optional. The configuration of the SandboxEnvironment.""", - ) - state: Optional[SandboxState] = Field( - default=None, - description="""Output only. The runtime state of the SandboxEnvironment.""", - ) - ttl: Optional[str] = Field( - default=None, - description="""Optional. Input only. The TTL for the sandbox environment. The expiration time is computed: now + TTL.""", - ) - update_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. The timestamp when this SandboxEnvironment was most recently updated.""", - ) - latest_sandbox_environment_snapshot: Optional[str] = Field( - default=None, - description="""Output only. The resource name of the latest snapshot taken for this SandboxEnvironment.""", - ) - owner: Optional[str] = Field( - default=None, - description="""Optional. Owner information for this sandbox environment. A Sandbox can only be restored from a snapshot that belongs to the same owner. If not set, sandbox will be created as the default owner.""", - ) - sandbox_environment_snapshot: Optional[str] = Field( - default=None, - description="""Optional. The resource name of the SandboxEnvironmentSnapshot to use for creating this SandboxEnvironment. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""", - ) - sandbox_environment_template: Optional[str] = Field( - default=None, - description="""Optional. The name of the SandboxEnvironmentTemplate specified in the parent Agent Engine resource that this SandboxEnvironment is created from. Only one of `sandbox_environment_template` and `spec` should be set.""", - ) - - -class SandboxEnvironmentDict(TypedDict, total=False): - """A sandbox environment.""" - expire_time: Optional[datetime.datetime] - """Expiration time of the sandbox environment. - """ - connection_info: Optional[SandboxEnvironmentConnectionInfoDict] - """Output only. The connection information of the SandboxEnvironment.""" +class RagEmbeddingModelConfigSparseEmbeddingConfigBm25Dict(TypedDict, total=False): + """Message for BM25 parameters.""" - create_time: Optional[datetime.datetime] - """Output only. The timestamp when this SandboxEnvironment was created.""" + b: Optional[float] + """Optional. The parameter to control document length normalization. It determines how much the document length affects the final score. b is in the range of [0, 1]. The default value is 0.75.""" - display_name: Optional[str] - """Required. The display name of the SandboxEnvironment.""" + k1: Optional[float] + """Optional. The parameter to control term frequency saturation. It determines the scaling between the matching term frequency and final score. k1 is in the range of [1.2, 3]. The default value is 1.2.""" - name: Optional[str] - """Identifier. The name of the SandboxEnvironment.""" + multilingual: Optional[bool] + """Optional. Use multilingual tokenizer if set to true.""" - spec: Optional[SandboxEnvironmentSpecDict] - """Optional. The configuration of the SandboxEnvironment.""" - state: Optional[SandboxState] - """Output only. The runtime state of the SandboxEnvironment.""" +RagEmbeddingModelConfigSparseEmbeddingConfigBm25OrDict = Union[ + RagEmbeddingModelConfigSparseEmbeddingConfigBm25, + RagEmbeddingModelConfigSparseEmbeddingConfigBm25Dict, +] - ttl: Optional[str] - """Optional. Input only. The TTL for the sandbox environment. The expiration time is computed: now + TTL.""" - update_time: Optional[datetime.datetime] - """Output only. The timestamp when this SandboxEnvironment was most recently updated.""" +class RagEmbeddingModelConfigSparseEmbeddingConfig(_common.BaseModel): + """Configuration for sparse emebdding generation.""" - latest_sandbox_environment_snapshot: Optional[str] - """Output only. The resource name of the latest snapshot taken for this SandboxEnvironment.""" + bm25: Optional[RagEmbeddingModelConfigSparseEmbeddingConfigBm25] = Field( + default=None, description="""Use BM25 scoring algorithm.""" + ) - owner: Optional[str] - """Optional. Owner information for this sandbox environment. A Sandbox can only be restored from a snapshot that belongs to the same owner. If not set, sandbox will be created as the default owner.""" - sandbox_environment_snapshot: Optional[str] - """Optional. The resource name of the SandboxEnvironmentSnapshot to use for creating this SandboxEnvironment. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""" +class RagEmbeddingModelConfigSparseEmbeddingConfigDict(TypedDict, total=False): + """Configuration for sparse emebdding generation.""" - sandbox_environment_template: Optional[str] - """Optional. The name of the SandboxEnvironmentTemplate specified in the parent Agent Engine resource that this SandboxEnvironment is created from. Only one of `sandbox_environment_template` and `spec` should be set.""" + bm25: Optional[RagEmbeddingModelConfigSparseEmbeddingConfigBm25Dict] + """Use BM25 scoring algorithm.""" -SandboxEnvironmentOrDict = Union[SandboxEnvironment, SandboxEnvironmentDict] +RagEmbeddingModelConfigSparseEmbeddingConfigOrDict = Union[ + RagEmbeddingModelConfigSparseEmbeddingConfig, + RagEmbeddingModelConfigSparseEmbeddingConfigDict, +] -class AgentEngineSandboxOperation(_common.BaseModel): - """Operation that has an agent engine sandbox as a response.""" +class RagEmbeddingModelConfigHybridSearchConfig(_common.BaseModel): + """Config for hybrid search.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", - ) - error: Optional[dict[str, Any]] = Field( + dense_embedding_model_prediction_endpoint: Optional[ + RagEmbeddingModelConfigVertexPredictionEndpoint + ] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Required. The Vertex AI Prediction Endpoint that hosts the embedding model for dense embedding generations.""", ) - response: Optional[SandboxEnvironment] = Field( - default=None, description="""The Agent Engine Sandbox.""" + sparse_embedding_config: Optional[RagEmbeddingModelConfigSparseEmbeddingConfig] = ( + Field( + default=None, + description="""Optional. The configuration for sparse embedding generation. This field is optional the default behavior depends on the vector database choice on the RagCorpus.""", + ) ) -class AgentEngineSandboxOperationDict(TypedDict, total=False): - """Operation that has an agent engine sandbox as a response.""" - - 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}`.""" - - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" +class RagEmbeddingModelConfigHybridSearchConfigDict(TypedDict, total=False): + """Config for hybrid search.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + dense_embedding_model_prediction_endpoint: Optional[ + RagEmbeddingModelConfigVertexPredictionEndpointDict + ] + """Required. The Vertex AI Prediction Endpoint that hosts the embedding model for dense embedding generations.""" - response: Optional[SandboxEnvironmentDict] - """The Agent Engine Sandbox.""" + sparse_embedding_config: Optional[RagEmbeddingModelConfigSparseEmbeddingConfigDict] + """Optional. The configuration for sparse embedding generation. This field is optional the default behavior depends on the vector database choice on the RagCorpus.""" -AgentEngineSandboxOperationOrDict = Union[ - AgentEngineSandboxOperation, AgentEngineSandboxOperationDict +RagEmbeddingModelConfigHybridSearchConfigOrDict = Union[ + RagEmbeddingModelConfigHybridSearchConfig, + RagEmbeddingModelConfigHybridSearchConfigDict, ] -class DeleteAgentEngineSandboxConfig(_common.BaseModel): - """Config for deleting an Agent Engine Sandbox.""" +class RagEmbeddingModelConfig(_common.BaseModel): + """Config for the embedding model to use for RAG.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + hybrid_search_config: Optional[RagEmbeddingModelConfigHybridSearchConfig] = Field( + default=None, description="""Configuration for hybrid search.""" + ) + vertex_prediction_endpoint: Optional[ + RagEmbeddingModelConfigVertexPredictionEndpoint + ] = Field( + default=None, + description="""The Vertex AI Prediction Endpoint that either refers to a publisher model or an endpoint that is hosting a 1P fine-tuned text embedding model. Endpoints hosting non-1P fine-tuned text embedding models are currently not supported. This is used for dense vector search.""", ) -class DeleteAgentEngineSandboxConfigDict(TypedDict, total=False): - """Config for deleting an Agent Engine Sandbox.""" +class RagEmbeddingModelConfigDict(TypedDict, total=False): + """Config for the embedding model to use for RAG.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + hybrid_search_config: Optional[RagEmbeddingModelConfigHybridSearchConfigDict] + """Configuration for hybrid search.""" + vertex_prediction_endpoint: Optional[ + RagEmbeddingModelConfigVertexPredictionEndpointDict + ] + """The Vertex AI Prediction Endpoint that either refers to a publisher model or an endpoint that is hosting a 1P fine-tuned text embedding model. Endpoints hosting non-1P fine-tuned text embedding models are currently not supported. This is used for dense vector search.""" -DeleteAgentEngineSandboxConfigOrDict = Union[ - DeleteAgentEngineSandboxConfig, DeleteAgentEngineSandboxConfigDict + +RagEmbeddingModelConfigOrDict = Union[ + RagEmbeddingModelConfig, RagEmbeddingModelConfigDict ] -class _DeleteAgentEngineSandboxRequestParameters(_common.BaseModel): - """Parameters for deleting agent engines.""" +class ApiAuthApiKeyConfig(_common.BaseModel): + """The API secret.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine sandbox to delete.""" + api_key_secret_version: Optional[str] = Field( + default=None, + description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""", ) - config: Optional[DeleteAgentEngineSandboxConfig] = Field( - default=None, description="""""" + api_key_string: Optional[str] = Field( + default=None, + description="""The API key string. Either this or `api_key_secret_version` must be set.""", ) -class _DeleteAgentEngineSandboxRequestParametersDict(TypedDict, total=False): - """Parameters for deleting agent engines.""" +class ApiAuthApiKeyConfigDict(TypedDict, total=False): + """The API secret.""" - name: Optional[str] - """Name of the agent engine sandbox to delete.""" + api_key_secret_version: Optional[str] + """Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""" - config: Optional[DeleteAgentEngineSandboxConfigDict] - """""" + api_key_string: Optional[str] + """The API key string. Either this or `api_key_secret_version` must be set.""" -_DeleteAgentEngineSandboxRequestParametersOrDict = Union[ - _DeleteAgentEngineSandboxRequestParameters, - _DeleteAgentEngineSandboxRequestParametersDict, -] +ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict] -class DeleteAgentEngineSandboxOperation(_common.BaseModel): - """Operation for deleting agent engines.""" +class ApiAuth(_common.BaseModel): + """The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", - ) - error: Optional[dict[str, Any]] = Field( - default=None, - description="""The error result of the operation in case of failure or cancellation.""", + api_key_config: Optional[ApiAuthApiKeyConfig] = Field( + default=None, description="""The API secret.""" ) -class DeleteAgentEngineSandboxOperationDict(TypedDict, total=False): - """Operation for deleting agent engines.""" - - 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}`.""" - - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" +class ApiAuthDict(TypedDict, total=False): + """The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + api_key_config: Optional[ApiAuthApiKeyConfigDict] + """The API secret.""" -DeleteAgentEngineSandboxOperationOrDict = Union[ - DeleteAgentEngineSandboxOperation, DeleteAgentEngineSandboxOperationDict -] +ApiAuthOrDict = Union[ApiAuth, ApiAuthDict] -class Metadata(_common.BaseModel): - """Metadata for a chunk.""" +class RagVectorDbConfigPinecone(_common.BaseModel): + """The config for the Pinecone.""" - attributes: Optional[dict[str, bytes]] = Field( + index_name: Optional[str] = Field( default=None, - description="""Optional. Attributes attached to the data. The keys have semantic conventions and the consumers of the attributes should know how to deserialize the value bytes based on the keys.""", + description="""Pinecone index name. This value cannot be changed after it's set.""", ) -class MetadataDict(TypedDict, total=False): - """Metadata for a chunk.""" +class RagVectorDbConfigPineconeDict(TypedDict, total=False): + """The config for the Pinecone.""" - attributes: Optional[dict[str, bytes]] - """Optional. Attributes attached to the data. The keys have semantic conventions and the consumers of the attributes should know how to deserialize the value bytes based on the keys.""" + index_name: Optional[str] + """Pinecone index name. This value cannot be changed after it's set.""" -MetadataOrDict = Union[Metadata, MetadataDict] +RagVectorDbConfigPineconeOrDict = Union[ + RagVectorDbConfigPinecone, RagVectorDbConfigPineconeDict +] -class Chunk(_common.BaseModel): - """A chunk of data.""" +class RagVectorDbConfigRagManagedDbANN(_common.BaseModel): + """Config for ANN search. RagManagedDb uses a tree-based structure to partition data and facilitate faster searches. As a tradeoff, it requires longer indexing time and manual triggering of index rebuild via the ImportRagFiles and UpdateRagCorpus API.""" - data: Optional[bytes] = Field( - default=None, description="""Required. The data in the chunk.""" - ) - metadata: Optional[Metadata] = Field( + leaf_count: Optional[int] = Field( default=None, - description="""Optional. Metadata that is associated with the data in the payload.""", + description="""Number of leaf nodes in the tree-based structure. Each leaf node contains groups of closely related vectors along with their corresponding centroid. Recommended value is 10 * sqrt(num of RagFiles in your RagCorpus). Default value is 500.""", ) - mime_type: Optional[str] = Field( + tree_depth: Optional[int] = Field( default=None, - description="""Required. Mime type of the chunk data. See https://www.iana.org/assignments/media-types/media-types.xhtml for the full list.""", + description="""The depth of the tree-based structure. Only depth values of 2 and 3 are supported. Recommended value is 2 if you have if you have O(10K) files in the RagCorpus and set this to 3 if more than that. Default value is 2.""", ) -class ChunkDict(TypedDict, total=False): - """A chunk of data.""" - - data: Optional[bytes] - """Required. The data in the chunk.""" +class RagVectorDbConfigRagManagedDbANNDict(TypedDict, total=False): + """Config for ANN search. RagManagedDb uses a tree-based structure to partition data and facilitate faster searches. As a tradeoff, it requires longer indexing time and manual triggering of index rebuild via the ImportRagFiles and UpdateRagCorpus API.""" - metadata: Optional[MetadataDict] - """Optional. Metadata that is associated with the data in the payload.""" + leaf_count: Optional[int] + """Number of leaf nodes in the tree-based structure. Each leaf node contains groups of closely related vectors along with their corresponding centroid. Recommended value is 10 * sqrt(num of RagFiles in your RagCorpus). Default value is 500.""" - mime_type: Optional[str] - """Required. Mime type of the chunk data. See https://www.iana.org/assignments/media-types/media-types.xhtml for the full list.""" + tree_depth: Optional[int] + """The depth of the tree-based structure. Only depth values of 2 and 3 are supported. Recommended value is 2 if you have if you have O(10K) files in the RagCorpus and set this to 3 if more than that. Default value is 2.""" -ChunkOrDict = Union[Chunk, ChunkDict] +RagVectorDbConfigRagManagedDbANNOrDict = Union[ + RagVectorDbConfigRagManagedDbANN, RagVectorDbConfigRagManagedDbANNDict +] -class ExecuteCodeAgentEngineSandboxConfig(_common.BaseModel): - """Config for executing code in an Agent Engine sandbox.""" +class RagVectorDbConfigRagManagedDbKNN(_common.BaseModel): + """Config for KNN search.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) + pass -class ExecuteCodeAgentEngineSandboxConfigDict(TypedDict, total=False): - """Config for executing code in an Agent Engine sandbox.""" +class RagVectorDbConfigRagManagedDbKNNDict(TypedDict, total=False): + """Config for KNN search.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + pass -ExecuteCodeAgentEngineSandboxConfigOrDict = Union[ - ExecuteCodeAgentEngineSandboxConfig, ExecuteCodeAgentEngineSandboxConfigDict +RagVectorDbConfigRagManagedDbKNNOrDict = Union[ + RagVectorDbConfigRagManagedDbKNN, RagVectorDbConfigRagManagedDbKNNDict ] -class _ExecuteCodeAgentEngineSandboxRequestParameters(_common.BaseModel): - """Parameters for executing code in an agent engine sandbox.""" +class RagVectorDbConfigRagManagedDb(_common.BaseModel): + """The config for the default RAG-managed Vector DB.""" - name: Optional[str] = Field( + ann: Optional[RagVectorDbConfigRagManagedDbANN] = Field( default=None, - description="""Name of the agent engine sandbox to execute code in.""", - ) - inputs: Optional[list[Chunk]] = Field( - default=None, description="""Inputs to the code execution.""" + description="""Performs an ANN search on RagCorpus. Use this if you have a lot of files (> 10K) in your RagCorpus and want to reduce the search latency.""", ) - config: Optional[ExecuteCodeAgentEngineSandboxConfig] = Field( - default=None, description="""""" + knn: Optional[RagVectorDbConfigRagManagedDbKNN] = Field( + default=None, + description="""Performs a KNN search on RagCorpus. Default choice if not specified.""", ) -class _ExecuteCodeAgentEngineSandboxRequestParametersDict(TypedDict, total=False): - """Parameters for executing code in an agent engine sandbox.""" - - name: Optional[str] - """Name of the agent engine sandbox to execute code in.""" +class RagVectorDbConfigRagManagedDbDict(TypedDict, total=False): + """The config for the default RAG-managed Vector DB.""" - inputs: Optional[list[ChunkDict]] - """Inputs to the code execution.""" + ann: Optional[RagVectorDbConfigRagManagedDbANNDict] + """Performs an ANN search on RagCorpus. Use this if you have a lot of files (> 10K) in your RagCorpus and want to reduce the search latency.""" - config: Optional[ExecuteCodeAgentEngineSandboxConfigDict] - """""" + knn: Optional[RagVectorDbConfigRagManagedDbKNNDict] + """Performs a KNN search on RagCorpus. Default choice if not specified.""" -_ExecuteCodeAgentEngineSandboxRequestParametersOrDict = Union[ - _ExecuteCodeAgentEngineSandboxRequestParameters, - _ExecuteCodeAgentEngineSandboxRequestParametersDict, +RagVectorDbConfigRagManagedDbOrDict = Union[ + RagVectorDbConfigRagManagedDb, RagVectorDbConfigRagManagedDbDict ] -class ExecuteSandboxEnvironmentResponse(_common.BaseModel): - """The response for executing a sandbox environment.""" +class RagVectorDbConfigRagManagedVertexVectorSearch(_common.BaseModel): + """The config for the RAG-managed Vertex Vector Search 2.0.""" - outputs: Optional[list[Chunk]] = Field( - default=None, description="""The outputs from the sandbox environment.""" + collection_name: Optional[str] = Field( + default=None, + description="""Output only. The resource name of the Vector Search 2.0 Collection that RAG Created for the corpus. Only populated after the corpus is successfully created. Format: `projects/{project}/locations/{location}/collections/{collection_id}`""", ) -class ExecuteSandboxEnvironmentResponseDict(TypedDict, total=False): - """The response for executing a sandbox environment.""" +class RagVectorDbConfigRagManagedVertexVectorSearchDict(TypedDict, total=False): + """The config for the RAG-managed Vertex Vector Search 2.0.""" - outputs: Optional[list[ChunkDict]] - """The outputs from the sandbox environment.""" + collection_name: Optional[str] + """Output only. The resource name of the Vector Search 2.0 Collection that RAG Created for the corpus. Only populated after the corpus is successfully created. Format: `projects/{project}/locations/{location}/collections/{collection_id}`""" -ExecuteSandboxEnvironmentResponseOrDict = Union[ - ExecuteSandboxEnvironmentResponse, ExecuteSandboxEnvironmentResponseDict +RagVectorDbConfigRagManagedVertexVectorSearchOrDict = Union[ + RagVectorDbConfigRagManagedVertexVectorSearch, + RagVectorDbConfigRagManagedVertexVectorSearchDict, ] -class GetAgentEngineSandboxConfig(_common.BaseModel): - """Config for getting an Agent Engine Memory.""" +class RagVectorDbConfigVertexFeatureStore(_common.BaseModel): + """The config for the Vertex Feature Store.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + feature_view_resource_name: Optional[str] = Field( + default=None, + description="""The resource name of the FeatureView. Format: `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}`""", ) -class GetAgentEngineSandboxConfigDict(TypedDict, total=False): - """Config for getting an Agent Engine Memory.""" +class RagVectorDbConfigVertexFeatureStoreDict(TypedDict, total=False): + """The config for the Vertex Feature Store.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + feature_view_resource_name: Optional[str] + """The resource name of the FeatureView. Format: `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}`""" -GetAgentEngineSandboxConfigOrDict = Union[ - GetAgentEngineSandboxConfig, GetAgentEngineSandboxConfigDict +RagVectorDbConfigVertexFeatureStoreOrDict = Union[ + RagVectorDbConfigVertexFeatureStore, RagVectorDbConfigVertexFeatureStoreDict ] -class _GetAgentEngineSandboxRequestParameters(_common.BaseModel): - """Parameters for getting an agent engine sandbox.""" +class RagVectorDbConfigVertexVectorSearch(_common.BaseModel): + """The config for the Vertex Vector Search.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine sandbox.""" + index: Optional[str] = Field( + default=None, + description="""The resource name of the Index. Format: `projects/{project}/locations/{location}/indexes/{index}`""", ) - config: Optional[GetAgentEngineSandboxConfig] = Field( - default=None, description="""""" + index_endpoint: Optional[str] = Field( + default=None, + description="""The resource name of the Index Endpoint. Format: `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`""", ) -class _GetAgentEngineSandboxRequestParametersDict(TypedDict, total=False): - """Parameters for getting an agent engine sandbox.""" +class RagVectorDbConfigVertexVectorSearchDict(TypedDict, total=False): + """The config for the Vertex Vector Search.""" - name: Optional[str] - """Name of the agent engine sandbox.""" + index: Optional[str] + """The resource name of the Index. Format: `projects/{project}/locations/{location}/indexes/{index}`""" - config: Optional[GetAgentEngineSandboxConfigDict] - """""" + index_endpoint: Optional[str] + """The resource name of the Index Endpoint. Format: `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`""" -_GetAgentEngineSandboxRequestParametersOrDict = Union[ - _GetAgentEngineSandboxRequestParameters, _GetAgentEngineSandboxRequestParametersDict +RagVectorDbConfigVertexVectorSearchOrDict = Union[ + RagVectorDbConfigVertexVectorSearch, RagVectorDbConfigVertexVectorSearchDict ] -class ListAgentEngineSandboxesConfig(_common.BaseModel): - """Config for listing agent engine sandboxes.""" +class RagVectorDbConfigWeaviate(_common.BaseModel): + """The config for the Weaviate.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + collection_name: Optional[str] = Field( + default=None, + description="""The corresponding collection this corpus maps to. This value cannot be changed after it's set.""", ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( + http_endpoint: Optional[str] = Field( default=None, - description="""An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""", + description="""Weaviate DB instance HTTP endpoint. e.g. 34.56.78.90:8080 Vertex RAG only supports HTTP connection to Weaviate. This value cannot be changed after it's set.""", ) -class ListAgentEngineSandboxesConfigDict(TypedDict, total=False): - """Config for listing agent engine sandboxes.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - - page_size: Optional[int] - """""" +class RagVectorDbConfigWeaviateDict(TypedDict, total=False): + """The config for the Weaviate.""" - page_token: Optional[str] - """""" + collection_name: Optional[str] + """The corresponding collection this corpus maps to. This value cannot be changed after it's set.""" - filter: Optional[str] - """An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""" + http_endpoint: Optional[str] + """Weaviate DB instance HTTP endpoint. e.g. 34.56.78.90:8080 Vertex RAG only supports HTTP connection to Weaviate. This value cannot be changed after it's set.""" -ListAgentEngineSandboxesConfigOrDict = Union[ - ListAgentEngineSandboxesConfig, ListAgentEngineSandboxesConfigDict +RagVectorDbConfigWeaviateOrDict = Union[ + RagVectorDbConfigWeaviate, RagVectorDbConfigWeaviateDict ] -class _ListAgentEngineSandboxesRequestParameters(_common.BaseModel): - """Parameters for listing agent engine sandboxes.""" +class RagVectorDbConfig(_common.BaseModel): + """Config for the Vector DB to use for RAG.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine.""" + api_auth: Optional[ApiAuth] = Field( + default=None, description="""Authentication config for the chosen Vector DB.""" ) - config: Optional[ListAgentEngineSandboxesConfig] = Field( - default=None, description="""""" + pinecone: Optional[RagVectorDbConfigPinecone] = Field( + default=None, description="""The config for the Pinecone.""" ) - - -class _ListAgentEngineSandboxesRequestParametersDict(TypedDict, total=False): - """Parameters for listing agent engine sandboxes.""" - - name: Optional[str] - """Name of the agent engine.""" - - config: Optional[ListAgentEngineSandboxesConfigDict] - """""" - - -_ListAgentEngineSandboxesRequestParametersOrDict = Union[ - _ListAgentEngineSandboxesRequestParameters, - _ListAgentEngineSandboxesRequestParametersDict, -] - - -class ListAgentEngineSandboxesResponse(_common.BaseModel): - """Response for listing agent engine sandboxes.""" - - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" + rag_embedding_model_config: Optional[RagEmbeddingModelConfig] = Field( + default=None, + description="""Optional. Immutable. The embedding model config of the Vector DB.""", ) - next_page_token: Optional[str] = Field(default=None, description="""""") - sandbox_environments: Optional[list[SandboxEnvironment]] = Field( - default=None, description="""List of agent engine sandboxes.""" + rag_managed_db: Optional[RagVectorDbConfigRagManagedDb] = Field( + default=None, description="""The config for the RAG-managed Vector DB.""" + ) + rag_managed_vertex_vector_search: Optional[ + RagVectorDbConfigRagManagedVertexVectorSearch + ] = Field( + default=None, + description="""The config for the RAG-managed Vertex Vector Search 2.0.""", + ) + vertex_feature_store: Optional[RagVectorDbConfigVertexFeatureStore] = Field( + default=None, description="""The config for the Vertex Feature Store.""" + ) + vertex_vector_search: Optional[RagVectorDbConfigVertexVectorSearch] = Field( + default=None, description="""The config for the Vertex Vector Search.""" + ) + weaviate: Optional[RagVectorDbConfigWeaviate] = Field( + default=None, description="""The config for the Weaviate.""" ) -class ListAgentEngineSandboxesResponseDict(TypedDict, total=False): - """Response for listing agent engine sandboxes.""" - - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" - - next_page_token: Optional[str] - """""" - - sandbox_environments: Optional[list[SandboxEnvironmentDict]] - """List of agent engine sandboxes.""" - +class RagVectorDbConfigDict(TypedDict, total=False): + """Config for the Vector DB to use for RAG.""" -ListAgentEngineSandboxesResponseOrDict = Union[ - ListAgentEngineSandboxesResponse, ListAgentEngineSandboxesResponseDict -] + api_auth: Optional[ApiAuthDict] + """Authentication config for the chosen Vector DB.""" + pinecone: Optional[RagVectorDbConfigPineconeDict] + """The config for the Pinecone.""" -class _GetAgentEngineSandboxOperationParameters(_common.BaseModel): - """Parameters for getting an operation with a sandbox as a response.""" + rag_embedding_model_config: Optional[RagEmbeddingModelConfigDict] + """Optional. Immutable. The embedding model config of the Vector DB.""" - operation_name: Optional[str] = Field( - default=None, description="""The server-assigned name for the operation.""" - ) - config: Optional[GetAgentEngineOperationConfig] = Field( - default=None, description="""Used to override the default configuration.""" - ) + rag_managed_db: Optional[RagVectorDbConfigRagManagedDbDict] + """The config for the RAG-managed Vector DB.""" + rag_managed_vertex_vector_search: Optional[ + RagVectorDbConfigRagManagedVertexVectorSearchDict + ] + """The config for the RAG-managed Vertex Vector Search 2.0.""" -class _GetAgentEngineSandboxOperationParametersDict(TypedDict, total=False): - """Parameters for getting an operation with a sandbox as a response.""" + vertex_feature_store: Optional[RagVectorDbConfigVertexFeatureStoreDict] + """The config for the Vertex Feature Store.""" - operation_name: Optional[str] - """The server-assigned name for the operation.""" + vertex_vector_search: Optional[RagVectorDbConfigVertexVectorSearchDict] + """The config for the Vertex Vector Search.""" - config: Optional[GetAgentEngineOperationConfigDict] - """Used to override the default configuration.""" + weaviate: Optional[RagVectorDbConfigWeaviateDict] + """The config for the Weaviate.""" -_GetAgentEngineSandboxOperationParametersOrDict = Union[ - _GetAgentEngineSandboxOperationParameters, - _GetAgentEngineSandboxOperationParametersDict, -] +RagVectorDbConfigOrDict = Union[RagVectorDbConfig, RagVectorDbConfigDict] -class SandboxEnvironmentTemplateCustomContainerSpec(_common.BaseModel): - """Specification for deploying from a custom container image.""" +class VertexAiSearchConfig(_common.BaseModel): + """Config for the Vertex AI Search.""" - image_uri: Optional[str] = Field( + serving_config: Optional[str] = Field( default=None, - description="""Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to be run on each worker replica.""", + description="""Vertex AI Search Serving Config resource full name. For example, `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` or `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}`.""", ) -class SandboxEnvironmentTemplateCustomContainerSpecDict(TypedDict, total=False): - """Specification for deploying from a custom container image.""" +class VertexAiSearchConfigDict(TypedDict, total=False): + """Config for the Vertex AI Search.""" - image_uri: Optional[str] - """Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to be run on each worker replica.""" + serving_config: Optional[str] + """Vertex AI Search Serving Config resource full name. For example, `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` or `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}`.""" -SandboxEnvironmentTemplateCustomContainerSpecOrDict = Union[ - SandboxEnvironmentTemplateCustomContainerSpec, - SandboxEnvironmentTemplateCustomContainerSpecDict, -] +VertexAiSearchConfigOrDict = Union[VertexAiSearchConfig, VertexAiSearchConfigDict] -class SandboxEnvironmentTemplateNetworkPort(_common.BaseModel): - """Represents a network port in a container.""" +class RagCorpus(_common.BaseModel): + """A RAG Corpus.""" - port: Optional[int] = Field( + corpus_status: Optional[CorpusStatus] = Field( + default=None, description="""Output only. RagCorpus state.""" + ) + corpus_type_config: Optional[RagCorpusCorpusTypeConfig] = Field( default=None, - description="""Optional. Port number to expose. This must be a valid port number, between 1 and 65535.""", + description="""Optional. The corpus type config of the RagCorpus.""", ) - protocol: Optional[Protocol] = Field( + create_time: Optional[datetime.datetime] = Field( default=None, - description="""Optional. Protocol for port. Defaults to TCP if not specified.""", + description="""Output only. Timestamp when this RagCorpus was created.""", + ) + description: Optional[str] = Field( + default=None, description="""Optional. The description of the RagCorpus.""" + ) + display_name: Optional[str] = Field( + default=None, + description="""Required. The display name of the RagCorpus. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", + ) + encryption_spec: Optional[EncryptionSpec] = Field( + default=None, + description="""Optional. Immutable. The CMEK key name used to encrypt at-rest data related to this Corpus. Only applicable to RagManagedDb option for Vector DB. This field can only be set at corpus creation time, and cannot be updated or deleted.""", + ) + name: Optional[str] = Field( + default=None, description="""Output only. The resource name of the RagCorpus.""" + ) + rag_embedding_model_config: Optional[RagEmbeddingModelConfig] = Field( + default=None, + description="""Optional. Immutable. The embedding model config of the RagCorpus.""", + ) + rag_files_count: Optional[int] = Field( + default=None, + description="""Output only. Number of RagFiles in the RagCorpus. NOTE: This field is not populated in the response of VertexRagDataService.ListRagCorpora.""", + ) + rag_vector_db_config: Optional[RagVectorDbConfig] = Field( + default=None, + description="""Optional. Immutable. The Vector DB config of the RagCorpus.""", + ) + satisfies_pzi: Optional[bool] = Field( + default=None, description="""Output only. Reserved for future use.""" + ) + satisfies_pzs: Optional[bool] = Field( + default=None, description="""Output only. Reserved for future use.""" + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this RagCorpus was last updated.""", + ) + vector_db_config: Optional[RagVectorDbConfig] = Field( + default=None, + description="""Optional. Immutable. The config for the Vector DBs.""", + ) + vertex_ai_search_config: Optional[VertexAiSearchConfig] = Field( + default=None, + description="""Optional. Immutable. The config for the Vertex AI Search.""", ) -class SandboxEnvironmentTemplateNetworkPortDict(TypedDict, total=False): - """Represents a network port in a container.""" +class RagCorpusDict(TypedDict, total=False): + """A RAG Corpus.""" - port: Optional[int] - """Optional. Port number to expose. This must be a valid port number, between 1 and 65535.""" + corpus_status: Optional[CorpusStatusDict] + """Output only. RagCorpus state.""" - protocol: Optional[Protocol] - """Optional. Protocol for port. Defaults to TCP if not specified.""" + corpus_type_config: Optional[RagCorpusCorpusTypeConfigDict] + """Optional. The corpus type config of the RagCorpus.""" + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this RagCorpus was created.""" -SandboxEnvironmentTemplateNetworkPortOrDict = Union[ - SandboxEnvironmentTemplateNetworkPort, SandboxEnvironmentTemplateNetworkPortDict -] + description: Optional[str] + """Optional. The description of the RagCorpus.""" + display_name: Optional[str] + """Required. The display name of the RagCorpus. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" -class SandboxEnvironmentTemplateResourceRequirements(_common.BaseModel): - """Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.""" + encryption_spec: Optional[EncryptionSpecDict] + """Optional. Immutable. The CMEK key name used to encrypt at-rest data related to this Corpus. Only applicable to RagManagedDb option for Vector DB. This field can only be set at corpus creation time, and cannot be updated or deleted.""" - limits: Optional[dict[str, str]] = Field( - default=None, - description="""Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").""", - ) - requests: Optional[dict[str, str]] = Field( - default=None, - description="""Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").""", - ) + name: Optional[str] + """Output only. The resource name of the RagCorpus.""" + rag_embedding_model_config: Optional[RagEmbeddingModelConfigDict] + """Optional. Immutable. The embedding model config of the RagCorpus.""" -class SandboxEnvironmentTemplateResourceRequirementsDict(TypedDict, total=False): - """Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.""" + rag_files_count: Optional[int] + """Output only. Number of RagFiles in the RagCorpus. NOTE: This field is not populated in the response of VertexRagDataService.ListRagCorpora.""" - limits: Optional[dict[str, str]] - """Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").""" + rag_vector_db_config: Optional[RagVectorDbConfigDict] + """Optional. Immutable. The Vector DB config of the RagCorpus.""" - requests: Optional[dict[str, str]] - """Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").""" + satisfies_pzi: Optional[bool] + """Output only. Reserved for future use.""" + satisfies_pzs: Optional[bool] + """Output only. Reserved for future use.""" -SandboxEnvironmentTemplateResourceRequirementsOrDict = Union[ - SandboxEnvironmentTemplateResourceRequirements, - SandboxEnvironmentTemplateResourceRequirementsDict, -] + update_time: Optional[datetime.datetime] + """Output only. Timestamp when this RagCorpus was last updated.""" + vector_db_config: Optional[RagVectorDbConfigDict] + """Optional. Immutable. The config for the Vector DBs.""" -class SandboxEnvironmentTemplateCustomContainerEnvironment(_common.BaseModel): - """The customized sandbox runtime environment for BYOC.""" + vertex_ai_search_config: Optional[VertexAiSearchConfigDict] + """Optional. Immutable. The config for the Vertex AI Search.""" - custom_container_spec: Optional[SandboxEnvironmentTemplateCustomContainerSpec] = ( - Field( - default=None, - description="""The specification of the custom container environment.""", - ) - ) - ports: Optional[list[SandboxEnvironmentTemplateNetworkPort]] = Field( - default=None, description="""Ports to expose from the container.""" - ) - resources: Optional[SandboxEnvironmentTemplateResourceRequirements] = Field( - default=None, description="""Resource requests and limits for the container.""" - ) +RagCorpusOrDict = Union[RagCorpus, RagCorpusDict] -class SandboxEnvironmentTemplateCustomContainerEnvironmentDict(TypedDict, total=False): - """The customized sandbox runtime environment for BYOC.""" - custom_container_spec: Optional[SandboxEnvironmentTemplateCustomContainerSpecDict] - """The specification of the custom container environment.""" +class CreateRagCorpusConfig(_common.BaseModel): + """Config for creating a RAG corpus.""" - ports: Optional[list[SandboxEnvironmentTemplateNetworkPortDict]] - """Ports to expose from the container.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) - resources: Optional[SandboxEnvironmentTemplateResourceRequirementsDict] - """Resource requests and limits for the container.""" +class CreateRagCorpusConfigDict(TypedDict, total=False): + """Config for creating a RAG corpus.""" -SandboxEnvironmentTemplateCustomContainerEnvironmentOrDict = Union[ - SandboxEnvironmentTemplateCustomContainerEnvironment, - SandboxEnvironmentTemplateCustomContainerEnvironmentDict, -] + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -class SandboxEnvironmentTemplateDefaultContainerEnvironment(_common.BaseModel): - """The default sandbox runtime environment for default container workloads.""" +CreateRagCorpusConfigOrDict = Union[CreateRagCorpusConfig, CreateRagCorpusConfigDict] - default_container_category: Optional[DefaultContainerCategory] = Field( - default=None, - description="""Required. The category of the default container image.""", - ) +class _CreateRagCorpusRequestParameters(_common.BaseModel): + """Parameters for creating a RAG corpus.""" -class SandboxEnvironmentTemplateDefaultContainerEnvironmentDict(TypedDict, total=False): - """The default sandbox runtime environment for default container workloads.""" + rag_corpus: Optional[RagCorpus] = Field(default=None, description="""""") + config: Optional[CreateRagCorpusConfig] = Field(default=None, description="""""") - default_container_category: Optional[DefaultContainerCategory] - """Required. The category of the default container image.""" +class _CreateRagCorpusRequestParametersDict(TypedDict, total=False): + """Parameters for creating a RAG corpus.""" -SandboxEnvironmentTemplateDefaultContainerEnvironmentOrDict = Union[ - SandboxEnvironmentTemplateDefaultContainerEnvironment, - SandboxEnvironmentTemplateDefaultContainerEnvironmentDict, -] + rag_corpus: Optional[RagCorpusDict] + """""" + config: Optional[CreateRagCorpusConfigDict] + """""" -class SandboxEnvironmentTemplateEgressControlConfig(_common.BaseModel): - """Configuration for egress control of sandbox instances.""" - internet_access: Optional[bool] = Field( - default=None, description="""Optional. Whether to allow internet access.""" - ) - - -class SandboxEnvironmentTemplateEgressControlConfigDict(TypedDict, total=False): - """Configuration for egress control of sandbox instances.""" - - internet_access: Optional[bool] - """Optional. Whether to allow internet access.""" - - -SandboxEnvironmentTemplateEgressControlConfigOrDict = Union[ - SandboxEnvironmentTemplateEgressControlConfig, - SandboxEnvironmentTemplateEgressControlConfigDict, +_CreateRagCorpusRequestParametersOrDict = Union[ + _CreateRagCorpusRequestParameters, _CreateRagCorpusRequestParametersDict ] -class CreateSandboxEnvironmentTemplateConfig(_common.BaseModel): - """Config for creating a Sandbox Template.""" +class CreateRagCorpusOperation(_common.BaseModel): + """Operation for creating a RAG corpus.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Waits for the operation to complete before returning.""", + name: Optional[str] = Field( + default=None, + description="""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}`.""", ) - custom_container_environment: Optional[ - SandboxEnvironmentTemplateCustomContainerEnvironment - ] = Field( + metadata: Optional[dict[str, Any]] = Field( default=None, - description="""The custom container environment for the sandbox template.""", + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - default_container_environment: Optional[ - SandboxEnvironmentTemplateDefaultContainerEnvironment - ] = Field( + done: Optional[bool] = Field( default=None, - description="""The default container environment for the sandbox template.""", + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", ) - egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfig] = ( - Field( - default=None, - description="""The egress control config for the sandbox template.""", - ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", ) -class CreateSandboxEnvironmentTemplateConfigDict(TypedDict, total=False): - """Config for creating a Sandbox Template.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" +class CreateRagCorpusOperationDict(TypedDict, total=False): + """Operation for creating a RAG corpus.""" - wait_for_completion: Optional[bool] - """Waits for the operation to complete before returning.""" + 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}`.""" - custom_container_environment: Optional[ - SandboxEnvironmentTemplateCustomContainerEnvironmentDict - ] - """The custom container environment for the sandbox template.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - default_container_environment: Optional[ - SandboxEnvironmentTemplateDefaultContainerEnvironmentDict - ] - """The default container environment for the sandbox template.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfigDict] - """The egress control config for the sandbox template.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -CreateSandboxEnvironmentTemplateConfigOrDict = Union[ - CreateSandboxEnvironmentTemplateConfig, CreateSandboxEnvironmentTemplateConfigDict +CreateRagCorpusOperationOrDict = Union[ + CreateRagCorpusOperation, CreateRagCorpusOperationDict ] -class _CreateSandboxEnvironmentTemplateRequestParameters(_common.BaseModel): - """Parameters for creating Sandbox Environment Templates.""" +class GetCorpusOperationConfig(_common.BaseModel): + """Config for getting a corpus operation.""" - name: Optional[str] = Field( - default=None, - description="""Name of the agent engine to create the template under.""", - ) - config: Optional[CreateSandboxEnvironmentTemplateConfig] = Field( - default=None, description="""""" - ) - display_name: Optional[str] = Field( - default=None, description="""The display name of the sandbox template.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) -class _CreateSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False): - """Parameters for creating Sandbox Environment Templates.""" - - name: Optional[str] - """Name of the agent engine to create the template under.""" - - config: Optional[CreateSandboxEnvironmentTemplateConfigDict] - """""" +class GetCorpusOperationConfigDict(TypedDict, total=False): + """Config for getting a corpus operation.""" - display_name: Optional[str] - """The display name of the sandbox template.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -_CreateSandboxEnvironmentTemplateRequestParametersOrDict = Union[ - _CreateSandboxEnvironmentTemplateRequestParameters, - _CreateSandboxEnvironmentTemplateRequestParametersDict, +GetCorpusOperationConfigOrDict = Union[ + GetCorpusOperationConfig, GetCorpusOperationConfigDict ] -class SandboxEnvironmentTemplate(_common.BaseModel): - """A sandbox environment template.""" +class _GetCorpusOperationParameters(_common.BaseModel): + """Parameters for getting a corpus operation.""" - create_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. The timestamp when this SandboxEnvironmentTemplate was created.""", - ) - custom_container_environment: Optional[ - SandboxEnvironmentTemplateCustomContainerEnvironment - ] = Field( - default=None, - description="""The sandbox environment for custom container workloads.""", - ) - default_container_environment: Optional[ - SandboxEnvironmentTemplateDefaultContainerEnvironment - ] = Field( - default=None, - description="""The sandbox environment for default container workloads.""", - ) - display_name: Optional[str] = Field( - default=None, - description="""Required. The display name of the SandboxEnvironmentTemplate.""", - ) - egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfig] = ( - Field( - default=None, - description="""Optional. The configuration for egress control of this template.""", - ) - ) - name: Optional[str] = Field( - default=None, - description="""Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`""", - ) - state: Optional[ - Literal[ - "UNSPECIFIED", - "PROVISIONING", - "ACTIVE", - "DEPROVISIONING", - "DELETED", - "FAILED", - ] - ] = Field( - default=None, - description="""Output only. The state of the sandbox environment template.""", + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" ) - update_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. The timestamp when this SandboxEnvironmentTemplate was most recently updated.""", + config: Optional[GetCorpusOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" ) -class SandboxEnvironmentTemplateDict(TypedDict, total=False): - """A sandbox environment template.""" - - create_time: Optional[datetime.datetime] - """Output only. The timestamp when this SandboxEnvironmentTemplate was created.""" - - custom_container_environment: Optional[ - SandboxEnvironmentTemplateCustomContainerEnvironmentDict - ] - """The sandbox environment for custom container workloads.""" - - default_container_environment: Optional[ - SandboxEnvironmentTemplateDefaultContainerEnvironmentDict - ] - """The sandbox environment for default container workloads.""" - - display_name: Optional[str] - """Required. The display name of the SandboxEnvironmentTemplate.""" - - egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfigDict] - """Optional. The configuration for egress control of this template.""" - - name: Optional[str] - """Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`""" +class _GetCorpusOperationParametersDict(TypedDict, total=False): + """Parameters for getting a corpus operation.""" - state: Optional[ - Literal[ - "UNSPECIFIED", - "PROVISIONING", - "ACTIVE", - "DEPROVISIONING", - "DELETED", - "FAILED", - ] - ] - """Output only. The state of the sandbox environment template.""" + operation_name: Optional[str] + """The server-assigned name for the operation.""" - update_time: Optional[datetime.datetime] - """Output only. The timestamp when this SandboxEnvironmentTemplate was most recently updated.""" + config: Optional[GetCorpusOperationConfigDict] + """Used to override the default configuration.""" -SandboxEnvironmentTemplateOrDict = Union[ - SandboxEnvironmentTemplate, SandboxEnvironmentTemplateDict +_GetCorpusOperationParametersOrDict = Union[ + _GetCorpusOperationParameters, _GetCorpusOperationParametersDict ] -class SandboxEnvironmentTemplateOperation(_common.BaseModel): - """Operation that has an agent engine sandbox as a response.""" +class CorpusOperation(_common.BaseModel): + """Operation that has a corpus as a response.""" name: Optional[str] = Field( default=None, @@ -13414,13 +13289,13 @@ class SandboxEnvironmentTemplateOperation(_common.BaseModel): default=None, description="""The error result of the operation in case of failure or cancellation.""", ) - response: Optional[SandboxEnvironmentTemplate] = Field( - default=None, description="""The Agent Engine Sandbox Template.""" + response: Optional[RagCorpus] = Field( + default=None, description="""The created Corpus.""" ) -class SandboxEnvironmentTemplateOperationDict(TypedDict, total=False): - """Operation that has an agent engine sandbox as a response.""" +class CorpusOperationDict(TypedDict, total=False): + """Operation that has a corpus as a response.""" 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}`.""" @@ -13434,639 +13309,625 @@ class SandboxEnvironmentTemplateOperationDict(TypedDict, total=False): error: Optional[dict[str, Any]] """The error result of the operation in case of failure or cancellation.""" - response: Optional[SandboxEnvironmentTemplateDict] - """The Agent Engine Sandbox Template.""" + response: Optional[RagCorpusDict] + """The created Corpus.""" -SandboxEnvironmentTemplateOperationOrDict = Union[ - SandboxEnvironmentTemplateOperation, SandboxEnvironmentTemplateOperationDict -] +CorpusOperationOrDict = Union[CorpusOperation, CorpusOperationDict] -class DeleteSandboxEnvironmentTemplateConfig(_common.BaseModel): - """Config for deleting a Sandbox Template.""" +class GetRagCorpusConfig(_common.BaseModel): + """Config for getting a RAG corpus.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) -class DeleteSandboxEnvironmentTemplateConfigDict(TypedDict, total=False): - """Config for deleting a Sandbox Template.""" +class GetRagCorpusConfigDict(TypedDict, total=False): + """Config for getting a RAG corpus.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" -DeleteSandboxEnvironmentTemplateConfigOrDict = Union[ - DeleteSandboxEnvironmentTemplateConfig, DeleteSandboxEnvironmentTemplateConfigDict -] +GetRagCorpusConfigOrDict = Union[GetRagCorpusConfig, GetRagCorpusConfigDict] -class _DeleteSandboxEnvironmentTemplateRequestParameters(_common.BaseModel): - """Parameters for deleting sandbox templates.""" +class _GetRagCorpusRequestParameters(_common.BaseModel): + """Parameters for getting a RAG corpus.""" - name: Optional[str] = Field( - default=None, description="""Name of the sandbox template to delete.""" - ) - config: Optional[DeleteSandboxEnvironmentTemplateConfig] = Field( - default=None, description="""""" - ) + config: Optional[GetRagCorpusConfig] = Field(default=None, description="""""") + name: Optional[str] = Field(default=None, description="""""") -class _DeleteSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False): - """Parameters for deleting sandbox templates.""" +class _GetRagCorpusRequestParametersDict(TypedDict, total=False): + """Parameters for getting a RAG corpus.""" - name: Optional[str] - """Name of the sandbox template to delete.""" + config: Optional[GetRagCorpusConfigDict] + """""" - config: Optional[DeleteSandboxEnvironmentTemplateConfigDict] + name: Optional[str] """""" -_DeleteSandboxEnvironmentTemplateRequestParametersOrDict = Union[ - _DeleteSandboxEnvironmentTemplateRequestParameters, - _DeleteSandboxEnvironmentTemplateRequestParametersDict, +_GetRagCorpusRequestParametersOrDict = Union[ + _GetRagCorpusRequestParameters, _GetRagCorpusRequestParametersDict ] -class DeleteSandboxEnvironmentTemplateOperation(_common.BaseModel): - """Operation for deleting sandbox templates.""" +class ListRagCorporaConfig(_common.BaseModel): + """Config for listing RagCorpora.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", - ) - error: Optional[dict[str, Any]] = Field( - default=None, - description="""The error result of the operation in case of failure or cancellation.""", + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") -class DeleteSandboxEnvironmentTemplateOperationDict(TypedDict, total=False): - """Operation for deleting sandbox templates.""" +class ListRagCorporaConfigDict(TypedDict, total=False): + """Config for listing RagCorpora.""" - 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}`.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + page_size: Optional[int] + """""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + page_token: Optional[str] + """""" -DeleteSandboxEnvironmentTemplateOperationOrDict = Union[ - DeleteSandboxEnvironmentTemplateOperation, - DeleteSandboxEnvironmentTemplateOperationDict, -] +ListRagCorporaConfigOrDict = Union[ListRagCorporaConfig, ListRagCorporaConfigDict] -class GetSandboxEnvironmentTemplateConfig(_common.BaseModel): - """Config for getting a Sandbox Template.""" +class _ListRagCorporaRequestParameters(_common.BaseModel): + """Parameters for listing RagCorpora.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) + config: Optional[ListRagCorporaConfig] = Field(default=None, description="""""") -class GetSandboxEnvironmentTemplateConfigDict(TypedDict, total=False): - """Config for getting a Sandbox Template.""" +class _ListRagCorporaRequestParametersDict(TypedDict, total=False): + """Parameters for listing RagCorpora.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + config: Optional[ListRagCorporaConfigDict] + """""" -GetSandboxEnvironmentTemplateConfigOrDict = Union[ - GetSandboxEnvironmentTemplateConfig, GetSandboxEnvironmentTemplateConfigDict +_ListRagCorporaRequestParametersOrDict = Union[ + _ListRagCorporaRequestParameters, _ListRagCorporaRequestParametersDict ] -class _GetSandboxEnvironmentTemplateRequestParameters(_common.BaseModel): - """Parameters for getting a sandbox template.""" +class ListRagCorporaResponse(_common.BaseModel): + """Response for listing RagCorpora.""" - name: Optional[str] = Field( - default=None, description="""Name of the sandbox template.""" + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" ) - config: Optional[GetSandboxEnvironmentTemplateConfig] = Field( - default=None, description="""""" + next_page_token: Optional[str] = Field(default=None, description="""""") + rag_corpora: Optional[list[RagCorpus]] = Field( + default=None, description="""List of RagCorpus instances.""" ) -class _GetSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False): - """Parameters for getting a sandbox template.""" +class ListRagCorporaResponseDict(TypedDict, total=False): + """Response for listing RagCorpora.""" - name: Optional[str] - """Name of the sandbox template.""" + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" - config: Optional[GetSandboxEnvironmentTemplateConfigDict] + next_page_token: Optional[str] """""" + rag_corpora: Optional[list[RagCorpusDict]] + """List of RagCorpus instances.""" -_GetSandboxEnvironmentTemplateRequestParametersOrDict = Union[ - _GetSandboxEnvironmentTemplateRequestParameters, - _GetSandboxEnvironmentTemplateRequestParametersDict, -] +ListRagCorporaResponseOrDict = Union[ListRagCorporaResponse, ListRagCorporaResponseDict] -class ListSandboxEnvironmentTemplatesConfig(_common.BaseModel): - """Config for listing sandbox templates.""" + +class GetRagFileConfig(_common.BaseModel): + """Config for getting a RAG corpus.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( - default=None, - description="""An expression for filtering the results of the request.""", - ) -class ListSandboxEnvironmentTemplatesConfigDict(TypedDict, total=False): - """Config for listing sandbox templates.""" +class GetRagFileConfigDict(TypedDict, total=False): + """Config for getting a RAG corpus.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" - page_size: Optional[int] - """""" - page_token: Optional[str] +GetRagFileConfigOrDict = Union[GetRagFileConfig, GetRagFileConfigDict] + + +class _GetRagFileRequestParameters(_common.BaseModel): + """Parameters for getting a RAG corpus.""" + + config: Optional[GetRagFileConfig] = Field(default=None, description="""""") + name: Optional[str] = Field(default=None, description="""""") + + +class _GetRagFileRequestParametersDict(TypedDict, total=False): + """Parameters for getting a RAG corpus.""" + + config: Optional[GetRagFileConfigDict] """""" - filter: Optional[str] - """An expression for filtering the results of the request.""" + name: Optional[str] + """""" -ListSandboxEnvironmentTemplatesConfigOrDict = Union[ - ListSandboxEnvironmentTemplatesConfig, ListSandboxEnvironmentTemplatesConfigDict +_GetRagFileRequestParametersOrDict = Union[ + _GetRagFileRequestParameters, _GetRagFileRequestParametersDict ] -class _ListSandboxEnvironmentTemplatesRequestParameters(_common.BaseModel): - """Parameters for listing sandbox templates.""" - - name: Optional[str] = Field( - default=None, description="""Name of the agent engine.""" - ) - config: Optional[ListSandboxEnvironmentTemplatesConfig] = Field( - default=None, description="""""" - ) +class DirectUploadSource(_common.BaseModel): + """The input content is encapsulated and uploaded in the request.""" + pass -class _ListSandboxEnvironmentTemplatesRequestParametersDict(TypedDict, total=False): - """Parameters for listing sandbox templates.""" - name: Optional[str] - """Name of the agent engine.""" +class DirectUploadSourceDict(TypedDict, total=False): + """The input content is encapsulated and uploaded in the request.""" - config: Optional[ListSandboxEnvironmentTemplatesConfigDict] - """""" + pass -_ListSandboxEnvironmentTemplatesRequestParametersOrDict = Union[ - _ListSandboxEnvironmentTemplatesRequestParameters, - _ListSandboxEnvironmentTemplatesRequestParametersDict, -] +DirectUploadSourceOrDict = Union[DirectUploadSource, DirectUploadSourceDict] -class ListSandboxEnvironmentTemplatesResponse(_common.BaseModel): - """Response for listing sandbox templates.""" +class FileStatus(_common.BaseModel): + """RagFile status.""" - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" + error_status: Optional[str] = Field( + default=None, + description="""Output only. Only when the `state` field is ERROR.""", ) - next_page_token: Optional[str] = Field(default=None, description="""""") - sandbox_environment_templates: Optional[list[SandboxEnvironmentTemplate]] = Field( - default=None, description="""List of sandbox templates.""" + state: Optional[State] = Field( + default=None, description="""Output only. RagFile state.""" ) -class ListSandboxEnvironmentTemplatesResponseDict(TypedDict, total=False): - """Response for listing sandbox templates.""" +class FileStatusDict(TypedDict, total=False): + """RagFile status.""" - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" + error_status: Optional[str] + """Output only. Only when the `state` field is ERROR.""" - next_page_token: Optional[str] - """""" + state: Optional[State] + """Output only. RagFile state.""" - sandbox_environment_templates: Optional[list[SandboxEnvironmentTemplateDict]] - """List of sandbox templates.""" +FileStatusOrDict = Union[FileStatus, FileStatusDict] -ListSandboxEnvironmentTemplatesResponseOrDict = Union[ - ListSandboxEnvironmentTemplatesResponse, ListSandboxEnvironmentTemplatesResponseDict -] +class GcsSource(_common.BaseModel): + """The Google Cloud Storage location for the input content.""" -class _GetSandboxEnvironmentTemplateOperationParameters(_common.BaseModel): - """Parameters for getting an operation with a sandbox template as a response.""" + uris: Optional[list[str]] = Field( + default=None, + description="""Required. Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more information on wildcards, see https://cloud.google.com/storage/docs/wildcards.""", + ) - operation_name: Optional[str] = Field( - default=None, description="""The server-assigned name for the operation.""" + +class GcsSourceDict(TypedDict, total=False): + """The Google Cloud Storage location for the input content.""" + + uris: Optional[list[str]] + """Required. Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more information on wildcards, see https://cloud.google.com/storage/docs/wildcards.""" + + +GcsSourceOrDict = Union[GcsSource, GcsSourceDict] + + +class GoogleDriveSourceResourceId(_common.BaseModel): + """The type and ID of the Google Drive resource.""" + + resource_id: Optional[str] = Field( + default=None, description="""Required. The ID of the Google Drive resource.""" ) - config: Optional[GetAgentEngineOperationConfig] = Field( - default=None, description="""Used to override the default configuration.""" + resource_type: Optional[ResourceType] = Field( + default=None, description="""Required. The type of the Google Drive resource.""" ) -class _GetSandboxEnvironmentTemplateOperationParametersDict(TypedDict, total=False): - """Parameters for getting an operation with a sandbox template as a response.""" +class GoogleDriveSourceResourceIdDict(TypedDict, total=False): + """The type and ID of the Google Drive resource.""" - operation_name: Optional[str] - """The server-assigned name for the operation.""" + resource_id: Optional[str] + """Required. The ID of the Google Drive resource.""" - config: Optional[GetAgentEngineOperationConfigDict] - """Used to override the default configuration.""" + resource_type: Optional[ResourceType] + """Required. The type of the Google Drive resource.""" -_GetSandboxEnvironmentTemplateOperationParametersOrDict = Union[ - _GetSandboxEnvironmentTemplateOperationParameters, - _GetSandboxEnvironmentTemplateOperationParametersDict, +GoogleDriveSourceResourceIdOrDict = Union[ + GoogleDriveSourceResourceId, GoogleDriveSourceResourceIdDict ] -class CreateAgentEngineSandboxSnapshotConfig(_common.BaseModel): - """Config for creating a Sandbox Environment Snapshot.""" +class GoogleDriveSource(_common.BaseModel): + """The Google Drive location for the input content.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + resource_ids: Optional[list[GoogleDriveSourceResourceId]] = Field( + default=None, description="""Required. Google Drive resource IDs.""" ) - display_name: Optional[str] = Field( - default=None, description="""The display name of the sandbox snapshot.""" + + +class GoogleDriveSourceDict(TypedDict, total=False): + """The Google Drive location for the input content.""" + + resource_ids: Optional[list[GoogleDriveSourceResourceIdDict]] + """Required. Google Drive resource IDs.""" + + +GoogleDriveSourceOrDict = Union[GoogleDriveSource, GoogleDriveSourceDict] + + +class JiraSourceJiraQueries(_common.BaseModel): + """JiraQueries contains the Jira queries and corresponding authentication.""" + + api_key_config: Optional[ApiAuthApiKeyConfig] = Field( + default=None, + description="""Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Jira API key. See [Manage API tokens for your Atlassian account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/).""", ) - owner: Optional[str] = Field( - default=None, description="""The owner of the sandbox snapshot.""" + custom_queries: Optional[list[str]] = Field( + default=None, + description="""A list of custom Jira queries to import. For information about JQL (Jira Query Language), see https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/""", ) - ttl: Optional[str] = Field( + email: Optional[str] = Field( + default=None, description="""Required. The Jira email address.""" + ) + projects: Optional[list[str]] = Field( default=None, - description="""The TTL for this resource. The expiration time is computed: now + TTL.""", + description="""A list of Jira projects to import in their entirety.""", ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Waits for the operation to complete before returning.""", + server_uri: Optional[str] = Field( + default=None, description="""Required. The Jira server URI.""" ) -class CreateAgentEngineSandboxSnapshotConfigDict(TypedDict, total=False): - """Config for creating a Sandbox Environment Snapshot.""" +class JiraSourceJiraQueriesDict(TypedDict, total=False): + """JiraQueries contains the Jira queries and corresponding authentication.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + api_key_config: Optional[ApiAuthApiKeyConfigDict] + """Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Jira API key. See [Manage API tokens for your Atlassian account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/).""" - display_name: Optional[str] - """The display name of the sandbox snapshot.""" + custom_queries: Optional[list[str]] + """A list of custom Jira queries to import. For information about JQL (Jira Query Language), see https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/""" - owner: Optional[str] - """The owner of the sandbox snapshot.""" + email: Optional[str] + """Required. The Jira email address.""" - ttl: Optional[str] - """The TTL for this resource. The expiration time is computed: now + TTL.""" + projects: Optional[list[str]] + """A list of Jira projects to import in their entirety.""" - wait_for_completion: Optional[bool] - """Waits for the operation to complete before returning.""" + server_uri: Optional[str] + """Required. The Jira server URI.""" -CreateAgentEngineSandboxSnapshotConfigOrDict = Union[ - CreateAgentEngineSandboxSnapshotConfig, CreateAgentEngineSandboxSnapshotConfigDict -] +JiraSourceJiraQueriesOrDict = Union[JiraSourceJiraQueries, JiraSourceJiraQueriesDict] -class _CreateSandboxEnvironmentSnapshotRequestParameters(_common.BaseModel): - """Parameters for creating a sandbox environment snapshot.""" +class JiraSource(_common.BaseModel): + """The Jira source for the ImportRagFilesRequest.""" - source_sandbox_environment_name: Optional[str] = Field( - default=None, description="""Name of the sandbox environment to snapshot.""" + jira_queries: Optional[list[JiraSourceJiraQueries]] = Field( + default=None, description="""Required. The Jira queries.""" ) - config: Optional[CreateAgentEngineSandboxSnapshotConfig] = Field( - default=None, description="""""" - ) - -class _CreateSandboxEnvironmentSnapshotRequestParametersDict(TypedDict, total=False): - """Parameters for creating a sandbox environment snapshot.""" - source_sandbox_environment_name: Optional[str] - """Name of the sandbox environment to snapshot.""" +class JiraSourceDict(TypedDict, total=False): + """The Jira source for the ImportRagFilesRequest.""" - config: Optional[CreateAgentEngineSandboxSnapshotConfigDict] - """""" + jira_queries: Optional[list[JiraSourceJiraQueriesDict]] + """Required. The Jira queries.""" -_CreateSandboxEnvironmentSnapshotRequestParametersOrDict = Union[ - _CreateSandboxEnvironmentSnapshotRequestParameters, - _CreateSandboxEnvironmentSnapshotRequestParametersDict, -] +JiraSourceOrDict = Union[JiraSource, JiraSourceDict] -class SandboxEnvironmentSnapshot(_common.BaseModel): - """A sandbox environment snapshot.""" +class SharePointSourcesSharePointSource(_common.BaseModel): + """An individual SharePointSource.""" - display_name: Optional[str] = Field( - default=None, - description="""The display name of the sandbox environment snapshot.""", - ) - expire_time: Optional[datetime.datetime] = Field( - default=None, - description="""Expiration time of the sandbox environment snapshot. - """, - ) - create_time: Optional[datetime.datetime] = Field( + client_id: Optional[str] = Field( default=None, - description="""Output only. The timestamp when this SandboxEnvironmentSnapshot was created.""", + description="""The Application ID for the app registered in Microsoft Azure Portal. The application must also be configured with MS Graph permissions "Files.ReadAll", "Sites.ReadAll" and BrowserSiteLists.Read.All.""", ) - name: Optional[str] = Field( + client_secret: Optional[ApiAuthApiKeyConfig] = Field( default=None, - description="""Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""", + description="""The application secret for the app registered in Azure.""", ) - owner: Optional[str] = Field( - default=None, - description="""Optional. Owner information for this sandbox snapshot. Different owners will have isolations on snapshot storage and identity. If not set, snapshot will be created as the default owner.""", + drive_id: Optional[str] = Field( + default=None, description="""The ID of the drive to download from.""" ) - parent_snapshot: Optional[str] = Field( - default=None, - description="""Output only. The resource name of the parent SandboxEnvironmentSnapshot. Empty if this is a root Snapshot (the first snapshot from a newly created sandbox). Can be used to reconstruct the whole ancestry tree of snapshots.""", + drive_name: Optional[str] = Field( + default=None, description="""The name of the drive to download from.""" ) - post_snapshot_action: Optional[PostSnapshotAction] = Field( + file_id: Optional[str] = Field( default=None, - description="""Optional. Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource.""", + description="""Output only. The SharePoint file id. Output only.""", ) - size_bytes: Optional[int] = Field( + sharepoint_folder_id: Optional[str] = Field( default=None, - description="""Optional. Output only. Size of the snapshot data in bytes.""", + description="""The ID of the SharePoint folder to download from.""", ) - source_sandbox_environment: Optional[str] = Field( + sharepoint_folder_path: Optional[str] = Field( default=None, - description="""Required. The resource name of the source SandboxEnvironment this snapshot was taken from.""", + description="""The path of the SharePoint folder to download from.""", ) - ttl: Optional[str] = Field( + sharepoint_site_name: Optional[str] = Field( default=None, - description="""Optional. Input only. The TTL for the sandbox environment snapshot. The expiration time is computed: now + TTL.""", + description="""The name of the SharePoint site to download from. This can be the site name or the site id.""", ) - update_time: Optional[datetime.datetime] = Field( + tenant_id: Optional[str] = Field( default=None, - description="""Output only. The timestamp when this SandboxEnvironment was most recently updated.""", + description="""Unique identifier of the Azure Active Directory Instance.""", ) -class SandboxEnvironmentSnapshotDict(TypedDict, total=False): - """A sandbox environment snapshot.""" +class SharePointSourcesSharePointSourceDict(TypedDict, total=False): + """An individual SharePointSource.""" - display_name: Optional[str] - """The display name of the sandbox environment snapshot.""" + client_id: Optional[str] + """The Application ID for the app registered in Microsoft Azure Portal. The application must also be configured with MS Graph permissions "Files.ReadAll", "Sites.ReadAll" and BrowserSiteLists.Read.All.""" - expire_time: Optional[datetime.datetime] - """Expiration time of the sandbox environment snapshot. - """ + client_secret: Optional[ApiAuthApiKeyConfigDict] + """The application secret for the app registered in Azure.""" - create_time: Optional[datetime.datetime] - """Output only. The timestamp when this SandboxEnvironmentSnapshot was created.""" + drive_id: Optional[str] + """The ID of the drive to download from.""" - name: Optional[str] - """Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""" + drive_name: Optional[str] + """The name of the drive to download from.""" - owner: Optional[str] - """Optional. Owner information for this sandbox snapshot. Different owners will have isolations on snapshot storage and identity. If not set, snapshot will be created as the default owner.""" + file_id: Optional[str] + """Output only. The SharePoint file id. Output only.""" - parent_snapshot: Optional[str] - """Output only. The resource name of the parent SandboxEnvironmentSnapshot. Empty if this is a root Snapshot (the first snapshot from a newly created sandbox). Can be used to reconstruct the whole ancestry tree of snapshots.""" + sharepoint_folder_id: Optional[str] + """The ID of the SharePoint folder to download from.""" - post_snapshot_action: Optional[PostSnapshotAction] - """Optional. Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource.""" + sharepoint_folder_path: Optional[str] + """The path of the SharePoint folder to download from.""" - size_bytes: Optional[int] - """Optional. Output only. Size of the snapshot data in bytes.""" + sharepoint_site_name: Optional[str] + """The name of the SharePoint site to download from. This can be the site name or the site id.""" - source_sandbox_environment: Optional[str] - """Required. The resource name of the source SandboxEnvironment this snapshot was taken from.""" + tenant_id: Optional[str] + """Unique identifier of the Azure Active Directory Instance.""" - ttl: Optional[str] - """Optional. Input only. The TTL for the sandbox environment snapshot. The expiration time is computed: now + TTL.""" - update_time: Optional[datetime.datetime] - """Output only. The timestamp when this SandboxEnvironment was most recently updated.""" +SharePointSourcesSharePointSourceOrDict = Union[ + SharePointSourcesSharePointSource, SharePointSourcesSharePointSourceDict +] -SandboxEnvironmentSnapshotOrDict = Union[ - SandboxEnvironmentSnapshot, SandboxEnvironmentSnapshotDict -] +class SharePointSources(_common.BaseModel): + """The SharePointSources to pass to ImportRagFiles.""" + share_point_sources: Optional[list[SharePointSourcesSharePointSource]] = Field( + default=None, description="""The SharePoint sources.""" + ) -class AgentEngineSandboxSnapshotOperation(_common.BaseModel): - """Operation that has an agent engine sandbox snapshot as a response.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", +class SharePointSourcesDict(TypedDict, total=False): + """The SharePointSources to pass to ImportRagFiles.""" + + share_point_sources: Optional[list[SharePointSourcesSharePointSourceDict]] + """The SharePoint sources.""" + + +SharePointSourcesOrDict = Union[SharePointSources, SharePointSourcesDict] + + +class SlackSourceSlackChannelsSlackChannel(_common.BaseModel): + """SlackChannel contains the Slack channel ID and the time range to import.""" + + channel_id: Optional[str] = Field( + default=None, description="""Required. The Slack channel ID.""" ) - done: Optional[bool] = Field( + end_time: Optional[datetime.datetime] = Field( default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + description="""Optional. The ending timestamp for messages to import.""", ) - error: Optional[dict[str, Any]] = Field( + start_time: Optional[datetime.datetime] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Optional. The starting timestamp for messages to import.""", ) - response: Optional[SandboxEnvironmentSnapshot] = Field( - default=None, description="""The Agent Engine Sandbox Snapshot.""" - ) - -class AgentEngineSandboxSnapshotOperationDict(TypedDict, total=False): - """Operation that has an agent engine sandbox snapshot as a response.""" - - 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}`.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" +class SlackSourceSlackChannelsSlackChannelDict(TypedDict, total=False): + """SlackChannel contains the Slack channel ID and the time range to import.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + channel_id: Optional[str] + """Required. The Slack channel ID.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + end_time: Optional[datetime.datetime] + """Optional. The ending timestamp for messages to import.""" - response: Optional[SandboxEnvironmentSnapshotDict] - """The Agent Engine Sandbox Snapshot.""" + start_time: Optional[datetime.datetime] + """Optional. The starting timestamp for messages to import.""" -AgentEngineSandboxSnapshotOperationOrDict = Union[ - AgentEngineSandboxSnapshotOperation, AgentEngineSandboxSnapshotOperationDict +SlackSourceSlackChannelsSlackChannelOrDict = Union[ + SlackSourceSlackChannelsSlackChannel, SlackSourceSlackChannelsSlackChannelDict ] -class DeleteSandboxEnvironmentSnapshotConfig(_common.BaseModel): - """Config for deleting a Sandbox Environment Snapshot.""" +class SlackSourceSlackChannels(_common.BaseModel): + """SlackChannels contains the Slack channels and corresponding access token.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + api_key_config: Optional[ApiAuthApiKeyConfig] = Field( + default=None, + description="""Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Slack channel access token that has access to the slack channel IDs. See: https://api.slack.com/tutorials/tracks/getting-a-token.""", + ) + channels: Optional[list[SlackSourceSlackChannelsSlackChannel]] = Field( + default=None, description="""Required. The Slack channel IDs.""" ) -class DeleteSandboxEnvironmentSnapshotConfigDict(TypedDict, total=False): - """Config for deleting a Sandbox Environment Snapshot.""" +class SlackSourceSlackChannelsDict(TypedDict, total=False): + """SlackChannels contains the Slack channels and corresponding access token.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + api_key_config: Optional[ApiAuthApiKeyConfigDict] + """Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Slack channel access token that has access to the slack channel IDs. See: https://api.slack.com/tutorials/tracks/getting-a-token.""" + channels: Optional[list[SlackSourceSlackChannelsSlackChannelDict]] + """Required. The Slack channel IDs.""" -DeleteSandboxEnvironmentSnapshotConfigOrDict = Union[ - DeleteSandboxEnvironmentSnapshotConfig, DeleteSandboxEnvironmentSnapshotConfigDict + +SlackSourceSlackChannelsOrDict = Union[ + SlackSourceSlackChannels, SlackSourceSlackChannelsDict ] -class _DeleteSandboxEnvironmentSnapshotRequestParameters(_common.BaseModel): - """Parameters for deleting sandbox environment snapshots.""" +class SlackSource(_common.BaseModel): + """The Slack source for the ImportRagFilesRequest.""" - name: Optional[str] = Field( - default=None, - description="""Name of the sandbox environment snapshot to delete.""", - ) - config: Optional[DeleteSandboxEnvironmentSnapshotConfig] = Field( - default=None, description="""""" + channels: Optional[list[SlackSourceSlackChannels]] = Field( + default=None, description="""Required. The Slack channels.""" ) -class _DeleteSandboxEnvironmentSnapshotRequestParametersDict(TypedDict, total=False): - """Parameters for deleting sandbox environment snapshots.""" - - name: Optional[str] - """Name of the sandbox environment snapshot to delete.""" +class SlackSourceDict(TypedDict, total=False): + """The Slack source for the ImportRagFilesRequest.""" - config: Optional[DeleteSandboxEnvironmentSnapshotConfigDict] - """""" + channels: Optional[list[SlackSourceSlackChannelsDict]] + """Required. The Slack channels.""" -_DeleteSandboxEnvironmentSnapshotRequestParametersOrDict = Union[ - _DeleteSandboxEnvironmentSnapshotRequestParameters, - _DeleteSandboxEnvironmentSnapshotRequestParametersDict, -] +SlackSourceOrDict = Union[SlackSource, SlackSourceDict] -class DeleteSandboxEnvironmentSnapshotOperation(_common.BaseModel): - """Operation for deleting sandbox environment snapshots.""" +class RagFile(_common.BaseModel): + """A RAG File.""" - name: Optional[str] = Field( + create_time: Optional[datetime.datetime] = Field( default=None, - description="""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}`.""", + description="""Output only. Timestamp when this RagFile was created.""", ) - metadata: Optional[dict[str, Any]] = Field( + description: Optional[str] = Field( + default=None, description="""Optional. The description of the RagFile.""" + ) + direct_upload_source: Optional[DirectUploadSource] = Field( default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + description="""Output only. The RagFile is encapsulated and uploaded in the UploadRagFile request.""", ) - done: Optional[bool] = Field( + display_name: Optional[str] = Field( default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + description="""Required. The display name of the RagFile. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", ) - error: Optional[dict[str, Any]] = Field( + file_status: Optional[FileStatus] = Field( + default=None, description="""Output only. State of the RagFile.""" + ) + gcs_source: Optional[GcsSource] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Output only. Google Cloud Storage location of the RagFile. It does not support wildcards in the Cloud Storage uri for now.""", + ) + google_drive_source: Optional[GoogleDriveSource] = Field( + default=None, + description="""Output only. Google Drive location. Supports importing individual files as well as Google Drive folders.""", + ) + jira_source: Optional[JiraSource] = Field( + default=None, description="""The RagFile is imported from a Jira query.""" + ) + name: Optional[str] = Field( + default=None, description="""Output only. The resource name of the RagFile.""" + ) + rag_file_type: Optional[RagFileType] = Field( + default=None, description="""Output only. The type of the RagFile.""" + ) + share_point_sources: Optional[SharePointSources] = Field( + default=None, + description="""The RagFile is imported from a SharePoint source.""", + ) + size_bytes: Optional[int] = Field( + default=None, description="""Output only. The size of the RagFile in bytes.""" + ) + slack_source: Optional[SlackSource] = Field( + default=None, description="""The RagFile is imported from a Slack channel.""" + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this RagFile was last updated.""", + ) + user_metadata: Optional[str] = Field( + default=None, + description="""Output only. The metadata for metadata search. The user_metadata Needs to be in JSON format.""", ) -class DeleteSandboxEnvironmentSnapshotOperationDict(TypedDict, total=False): - """Operation for deleting sandbox environment snapshots.""" - - 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}`.""" - - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" - - -DeleteSandboxEnvironmentSnapshotOperationOrDict = Union[ - DeleteSandboxEnvironmentSnapshotOperation, - DeleteSandboxEnvironmentSnapshotOperationDict, -] +class RagFileDict(TypedDict, total=False): + """A RAG File.""" + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this RagFile was created.""" -class GetSandboxEnvironmentSnapshotConfig(_common.BaseModel): - """Config for getting a Sandbox Environment Snapshot.""" + description: Optional[str] + """Optional. The description of the RagFile.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) + direct_upload_source: Optional[DirectUploadSourceDict] + """Output only. The RagFile is encapsulated and uploaded in the UploadRagFile request.""" + display_name: Optional[str] + """Required. The display name of the RagFile. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" -class GetSandboxEnvironmentSnapshotConfigDict(TypedDict, total=False): - """Config for getting a Sandbox Environment Snapshot.""" + file_status: Optional[FileStatusDict] + """Output only. State of the RagFile.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + gcs_source: Optional[GcsSourceDict] + """Output only. Google Cloud Storage location of the RagFile. It does not support wildcards in the Cloud Storage uri for now.""" + google_drive_source: Optional[GoogleDriveSourceDict] + """Output only. Google Drive location. Supports importing individual files as well as Google Drive folders.""" -GetSandboxEnvironmentSnapshotConfigOrDict = Union[ - GetSandboxEnvironmentSnapshotConfig, GetSandboxEnvironmentSnapshotConfigDict -] + jira_source: Optional[JiraSourceDict] + """The RagFile is imported from a Jira query.""" + name: Optional[str] + """Output only. The resource name of the RagFile.""" -class _GetSandboxEnvironmentSnapshotRequestParameters(_common.BaseModel): - """Parameters for getting a sandbox environment snapshot.""" + rag_file_type: Optional[RagFileType] + """Output only. The type of the RagFile.""" - name: Optional[str] = Field( - default=None, description="""Name of the sandbox environment snapshot.""" - ) - config: Optional[GetSandboxEnvironmentSnapshotConfig] = Field( - default=None, description="""""" - ) + share_point_sources: Optional[SharePointSourcesDict] + """The RagFile is imported from a SharePoint source.""" + size_bytes: Optional[int] + """Output only. The size of the RagFile in bytes.""" -class _GetSandboxEnvironmentSnapshotRequestParametersDict(TypedDict, total=False): - """Parameters for getting a sandbox environment snapshot.""" + slack_source: Optional[SlackSourceDict] + """The RagFile is imported from a Slack channel.""" - name: Optional[str] - """Name of the sandbox environment snapshot.""" + update_time: Optional[datetime.datetime] + """Output only. Timestamp when this RagFile was last updated.""" - config: Optional[GetSandboxEnvironmentSnapshotConfigDict] - """""" + user_metadata: Optional[str] + """Output only. The metadata for metadata search. The user_metadata Needs to be in JSON format.""" -_GetSandboxEnvironmentSnapshotRequestParametersOrDict = Union[ - _GetSandboxEnvironmentSnapshotRequestParameters, - _GetSandboxEnvironmentSnapshotRequestParametersDict, -] +RagFileOrDict = Union[RagFile, RagFileDict] -class ListSandboxEnvironmentSnapshotsConfig(_common.BaseModel): - """Config for listing sandbox environment snapshots.""" +class ListRagFilesConfig(_common.BaseModel): + """Config for listing RagFile instances within a RagCorpus.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) page_size: Optional[int] = Field(default=None, description="""""") page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( - default=None, - description="""An expression for filtering the results of the request.""", - ) -class ListSandboxEnvironmentSnapshotsConfigDict(TypedDict, total=False): - """Config for listing sandbox environment snapshots.""" +class ListRagFilesConfigDict(TypedDict, total=False): + """Config for listing RagFile instances within a RagCorpus.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" @@ -14077,57 +13938,46 @@ class ListSandboxEnvironmentSnapshotsConfigDict(TypedDict, total=False): page_token: Optional[str] """""" - filter: Optional[str] - """An expression for filtering the results of the request.""" +ListRagFilesConfigOrDict = Union[ListRagFilesConfig, ListRagFilesConfigDict] -ListSandboxEnvironmentSnapshotsConfigOrDict = Union[ - ListSandboxEnvironmentSnapshotsConfig, ListSandboxEnvironmentSnapshotsConfigDict -] +class _ListRagFilesRequestParameters(_common.BaseModel): + """Parameters for listing RagFile instances within a RagCorpus.""" -class _ListSandboxEnvironmentSnapshotsRequestParameters(_common.BaseModel): - """Parameters for listing sandbox environment snapshots.""" + config: Optional[ListRagFilesConfig] = Field(default=None, description="""""") + name: Optional[str] = Field(default=None, description="""""") - name: Optional[str] = Field( - default=None, - description="""Name of the reasoning engine to list snapshots from.""", - ) - config: Optional[ListSandboxEnvironmentSnapshotsConfig] = Field( - default=None, description="""""" - ) +class _ListRagFilesRequestParametersDict(TypedDict, total=False): + """Parameters for listing RagFile instances within a RagCorpus.""" -class _ListSandboxEnvironmentSnapshotsRequestParametersDict(TypedDict, total=False): - """Parameters for listing sandbox environment snapshots.""" + config: Optional[ListRagFilesConfigDict] + """""" name: Optional[str] - """Name of the reasoning engine to list snapshots from.""" - - config: Optional[ListSandboxEnvironmentSnapshotsConfigDict] """""" -_ListSandboxEnvironmentSnapshotsRequestParametersOrDict = Union[ - _ListSandboxEnvironmentSnapshotsRequestParameters, - _ListSandboxEnvironmentSnapshotsRequestParametersDict, +_ListRagFilesRequestParametersOrDict = Union[ + _ListRagFilesRequestParameters, _ListRagFilesRequestParametersDict ] -class ListSandboxEnvironmentSnapshotsResponse(_common.BaseModel): - """Response for listing sandbox environment snapshots.""" +class ListRagFilesResponse(_common.BaseModel): + """Response for listing RagFile instances within a RagCorpus.""" sdk_http_response: Optional[genai_types.HttpResponse] = Field( default=None, description="""Used to retain the full HTTP response.""" ) next_page_token: Optional[str] = Field(default=None, description="""""") - sandbox_environment_snapshots: Optional[list[SandboxEnvironmentSnapshot]] = Field( - default=None, description="""List of sandbox environment snapshots.""" + rag_files: Optional[list[RagFile]] = Field( + default=None, description="""List of RagFile instances within a RagCorpus.""" ) -class ListSandboxEnvironmentSnapshotsResponseDict(TypedDict, total=False): - """Response for listing sandbox environment snapshots.""" +class ListRagFilesResponseDict(TypedDict, total=False): + """Response for listing RagFile instances within a RagCorpus.""" sdk_http_response: Optional[genai_types.HttpResponseDict] """Used to retain the full HTTP response.""" @@ -14135,224 +13985,292 @@ class ListSandboxEnvironmentSnapshotsResponseDict(TypedDict, total=False): next_page_token: Optional[str] """""" - sandbox_environment_snapshots: Optional[list[SandboxEnvironmentSnapshotDict]] - """List of sandbox environment snapshots.""" + rag_files: Optional[list[RagFileDict]] + """List of RagFile instances within a RagCorpus.""" -ListSandboxEnvironmentSnapshotsResponseOrDict = Union[ - ListSandboxEnvironmentSnapshotsResponse, ListSandboxEnvironmentSnapshotsResponseDict -] +ListRagFilesResponseOrDict = Union[ListRagFilesResponse, ListRagFilesResponseDict] -class _GetAgentEngineSandboxSnapshotOperationParameters(_common.BaseModel): - """Parameters for getting an operation with a sandbox snapshot as a response.""" +class GetRagConfig(_common.BaseModel): + """Config for getting a RAG Config.""" - operation_name: Optional[str] = Field( - default=None, description="""The server-assigned name for the operation.""" - ) - config: Optional[GetAgentEngineOperationConfig] = Field( - default=None, description="""Used to override the default configuration.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) -class _GetAgentEngineSandboxSnapshotOperationParametersDict(TypedDict, total=False): - """Parameters for getting an operation with a sandbox snapshot as a response.""" +class GetRagConfigDict(TypedDict, total=False): + """Config for getting a RAG Config.""" - operation_name: Optional[str] - """The server-assigned name for the operation.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - config: Optional[GetAgentEngineOperationConfigDict] - """Used to override the default configuration.""" +GetRagConfigOrDict = Union[GetRagConfig, GetRagConfigDict] -_GetAgentEngineSandboxSnapshotOperationParametersOrDict = Union[ - _GetAgentEngineSandboxSnapshotOperationParameters, - _GetAgentEngineSandboxSnapshotOperationParametersDict, + +class _GetRagConfigRequestParameters(_common.BaseModel): + """Parameters for getting a RAG Config.""" + + config: Optional[GetRagConfig] = Field(default=None, description="""""") + + +class _GetRagConfigRequestParametersDict(TypedDict, total=False): + """Parameters for getting a RAG Config.""" + + config: Optional[GetRagConfigDict] + """""" + + +_GetRagConfigRequestParametersOrDict = Union[ + _GetRagConfigRequestParameters, _GetRagConfigRequestParametersDict ] -class CreateAgentEngineSessionConfig(_common.BaseModel): - """Config for creating a Session.""" +class RagManagedDbConfigBasic(_common.BaseModel): + """Basic tier is a cost-effective and low compute tier suitable for the following cases: * Experimenting with RagManagedDb. * Small data size. * Latency insensitive workload. * Only using RAG Engine with external vector DBs. NOTE: This is the default tier under Spanner mode if not explicitly chosen.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - display_name: Optional[str] = Field( - default=None, description="""The display name of the session.""" - ) - session_state: Optional[dict[str, Any]] = Field( - default=None, - description="""Session state which stores key conversation points.""", - ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Waits for the operation to complete before returning.""", - ) - ttl: Optional[str] = Field( - default=None, - description="""Optional. Input only. The TTL for this resource. + pass - The expiration time is computed: now + TTL.""", - ) - expire_time: Optional[datetime.datetime] = Field( - default=None, - description="""Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""", - ) - labels: Optional[dict[str, str]] = Field( - default=None, - description="""Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""", - ) - session_id: Optional[str] = Field( - default=None, - description="""Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""", - ) +class RagManagedDbConfigBasicDict(TypedDict, total=False): + """Basic tier is a cost-effective and low compute tier suitable for the following cases: * Experimenting with RagManagedDb. * Small data size. * Latency insensitive workload. * Only using RAG Engine with external vector DBs. NOTE: This is the default tier under Spanner mode if not explicitly chosen.""" -class CreateAgentEngineSessionConfigDict(TypedDict, total=False): - """Config for creating a Session.""" + pass - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - display_name: Optional[str] - """The display name of the session.""" +RagManagedDbConfigBasicOrDict = Union[ + RagManagedDbConfigBasic, RagManagedDbConfigBasicDict +] - session_state: Optional[dict[str, Any]] - """Session state which stores key conversation points.""" - wait_for_completion: Optional[bool] - """Waits for the operation to complete before returning.""" +class RagManagedDbConfigEnterprise(_common.BaseModel): + """Enterprise tier offers production grade performance along with autoscaling functionality. It is suitable for customers with large amounts of data or performance sensitive workloads.""" - ttl: Optional[str] - """Optional. Input only. The TTL for this resource. + pass - The expiration time is computed: now + TTL.""" - expire_time: Optional[datetime.datetime] - """Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""" +class RagManagedDbConfigEnterpriseDict(TypedDict, total=False): + """Enterprise tier offers production grade performance along with autoscaling functionality. It is suitable for customers with large amounts of data or performance sensitive workloads.""" - labels: Optional[dict[str, str]] - """Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""" + pass - session_id: Optional[str] - """Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""" +RagManagedDbConfigEnterpriseOrDict = Union[ + RagManagedDbConfigEnterprise, RagManagedDbConfigEnterpriseDict +] -CreateAgentEngineSessionConfigOrDict = Union[ - CreateAgentEngineSessionConfig, CreateAgentEngineSessionConfigDict + +class RagManagedDbConfigScaled(_common.BaseModel): + """Scaled tier offers production grade performance along with autoscaling functionality. It is suitable for customers with large amounts of data or performance sensitive workloads.""" + + pass + + +class RagManagedDbConfigScaledDict(TypedDict, total=False): + """Scaled tier offers production grade performance along with autoscaling functionality. It is suitable for customers with large amounts of data or performance sensitive workloads.""" + + pass + + +RagManagedDbConfigScaledOrDict = Union[ + RagManagedDbConfigScaled, RagManagedDbConfigScaledDict ] -class _CreateAgentEngineSessionRequestParameters(_common.BaseModel): - """Parameters for creating Agent Engine Sessions.""" +class RagManagedDbConfigServerless(_common.BaseModel): + """Message to configure the serverless mode offered by RAG Engine.""" - name: Optional[str] = Field( + pass + + +class RagManagedDbConfigServerlessDict(TypedDict, total=False): + """Message to configure the serverless mode offered by RAG Engine.""" + + pass + + +RagManagedDbConfigServerlessOrDict = Union[ + RagManagedDbConfigServerless, RagManagedDbConfigServerlessDict +] + + +class RagManagedDbConfigUnprovisioned(_common.BaseModel): + """Disables the RAG Engine service and deletes all your data held within this service. This will halt the billing of the service. NOTE: Once deleted the data cannot be recovered. To start using RAG Engine again, you will need to update the tier by calling the UpdateRagEngineConfig API.""" + + pass + + +class RagManagedDbConfigUnprovisionedDict(TypedDict, total=False): + """Disables the RAG Engine service and deletes all your data held within this service. This will halt the billing of the service. NOTE: Once deleted the data cannot be recovered. To start using RAG Engine again, you will need to update the tier by calling the UpdateRagEngineConfig API.""" + + pass + + +RagManagedDbConfigUnprovisionedOrDict = Union[ + RagManagedDbConfigUnprovisioned, RagManagedDbConfigUnprovisionedDict +] + + +class RagManagedDbConfigSpanner(_common.BaseModel): + """Message to configure the Spanner database used by RagManagedDb.""" + + basic: Optional[RagManagedDbConfigBasic] = Field( default=None, - description="""Name of the agent engine to create the session under.""", + description="""Sets the RagManagedDb to the Basic tier. This is the default tier for Spanner mode if not explicitly chosen.""", ) - user_id: Optional[str] = Field( - default=None, description="""The user ID of the session.""" + scaled: Optional[RagManagedDbConfigScaled] = Field( + default=None, description="""Sets the RagManagedDb to the Scaled tier.""" ) - config: Optional[CreateAgentEngineSessionConfig] = Field( - default=None, description="""""" + unprovisioned: Optional[RagManagedDbConfigUnprovisioned] = Field( + default=None, description="""Sets the RagManagedDb to the Unprovisioned tier.""" ) -class _CreateAgentEngineSessionRequestParametersDict(TypedDict, total=False): - """Parameters for creating Agent Engine Sessions.""" +class RagManagedDbConfigSpannerDict(TypedDict, total=False): + """Message to configure the Spanner database used by RagManagedDb.""" - name: Optional[str] - """Name of the agent engine to create the session under.""" + basic: Optional[RagManagedDbConfigBasicDict] + """Sets the RagManagedDb to the Basic tier. This is the default tier for Spanner mode if not explicitly chosen.""" - user_id: Optional[str] - """The user ID of the session.""" + scaled: Optional[RagManagedDbConfigScaledDict] + """Sets the RagManagedDb to the Scaled tier.""" - config: Optional[CreateAgentEngineSessionConfigDict] - """""" + unprovisioned: Optional[RagManagedDbConfigUnprovisionedDict] + """Sets the RagManagedDb to the Unprovisioned tier.""" -_CreateAgentEngineSessionRequestParametersOrDict = Union[ - _CreateAgentEngineSessionRequestParameters, - _CreateAgentEngineSessionRequestParametersDict, +RagManagedDbConfigSpannerOrDict = Union[ + RagManagedDbConfigSpanner, RagManagedDbConfigSpannerDict ] -class Session(_common.BaseModel): - """A session.""" +class RagManagedDbConfig(_common.BaseModel): + """Configuration message for RagManagedDb used by RagEngine.""" - create_time: Optional[datetime.datetime] = Field( + basic: Optional[RagManagedDbConfigBasic] = Field( default=None, - description="""Output only. Timestamp when the session was created.""", + description="""Deprecated: Use `mode` instead to set the tier under Spanner. Sets the RagManagedDb to the Basic tier.""", ) - display_name: Optional[str] = Field( - default=None, description="""Optional. The display name of the session.""" + enterprise: Optional[RagManagedDbConfigEnterprise] = Field( + default=None, description="""Sets the RagManagedDb to the Enterprise tier.""" ) - expire_time: Optional[datetime.datetime] = Field( + scaled: Optional[RagManagedDbConfigScaled] = Field( default=None, - description="""Optional. Timestamp of when this session is considered expired. This is *always* provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation.""", + description="""Deprecated: Use `mode` instead to set the tier under Spanner. Sets the RagManagedDb to the Scaled tier.""", ) - labels: Optional[dict[str, str]] = Field( + serverless: Optional[RagManagedDbConfigServerless] = Field( default=None, - description="""The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""", + description="""Sets the backend to be the serverless mode offered by RAG Engine.""", ) - name: Optional[str] = Field( + spanner: Optional[RagManagedDbConfigSpanner] = Field( default=None, - description="""Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.""", + description="""Sets the RAG Engine backend to be RagManagedDb, built on top of Spanner. NOTE: This is the default mode (w/ Basic Tier) if not explicitly chosen.""", ) - session_state: Optional[dict[str, Any]] = Field( + unprovisioned: Optional[RagManagedDbConfigUnprovisioned] = Field( default=None, - description="""Optional. Session specific memory which stores key conversation points.""", + description="""Deprecated: Use `mode` instead to set the tier under Spanner. Sets the RagManagedDb to the Unprovisioned tier.""", ) - ttl: Optional[str] = Field( + + +class RagManagedDbConfigDict(TypedDict, total=False): + """Configuration message for RagManagedDb used by RagEngine.""" + + basic: Optional[RagManagedDbConfigBasicDict] + """Deprecated: Use `mode` instead to set the tier under Spanner. Sets the RagManagedDb to the Basic tier.""" + + enterprise: Optional[RagManagedDbConfigEnterpriseDict] + """Sets the RagManagedDb to the Enterprise tier.""" + + scaled: Optional[RagManagedDbConfigScaledDict] + """Deprecated: Use `mode` instead to set the tier under Spanner. Sets the RagManagedDb to the Scaled tier.""" + + serverless: Optional[RagManagedDbConfigServerlessDict] + """Sets the backend to be the serverless mode offered by RAG Engine.""" + + spanner: Optional[RagManagedDbConfigSpannerDict] + """Sets the RAG Engine backend to be RagManagedDb, built on top of Spanner. NOTE: This is the default mode (w/ Basic Tier) if not explicitly chosen.""" + + unprovisioned: Optional[RagManagedDbConfigUnprovisionedDict] + """Deprecated: Use `mode` instead to set the tier under Spanner. Sets the RagManagedDb to the Unprovisioned tier.""" + + +RagManagedDbConfigOrDict = Union[RagManagedDbConfig, RagManagedDbConfigDict] + + +class RagEngineConfig(_common.BaseModel): + """The config of the RAG Engine.""" + + name: Optional[str] = Field( default=None, - description="""Optional. Input only. The TTL for this session. The minimum value is 24 hours.""", + description="""Identifier. The name of the RagEngineConfig. Format: `projects/{project}/locations/{location}/ragEngineConfig`""", ) - update_time: Optional[datetime.datetime] = Field( + rag_managed_db_config: Optional[RagManagedDbConfig] = Field( default=None, - description="""Output only. Timestamp when the session was updated.""", + description="""The config of the RagManagedDb used by RagEngine.""", ) - user_id: Optional[str] = Field( - default=None, - description="""Required. Immutable. String id provided by the user""", + + +class RagEngineConfigDict(TypedDict, total=False): + """The config of the RAG Engine.""" + + name: Optional[str] + """Identifier. The name of the RagEngineConfig. Format: `projects/{project}/locations/{location}/ragEngineConfig`""" + + rag_managed_db_config: Optional[RagManagedDbConfigDict] + """The config of the RagManagedDb used by RagEngine.""" + + +RagEngineConfigOrDict = Union[RagEngineConfig, RagEngineConfigDict] + + +class UpdateRagCorpusConfig(_common.BaseModel): + """Config for updating a RAG corpus.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) -class SessionDict(TypedDict, total=False): - """A session.""" +class UpdateRagCorpusConfigDict(TypedDict, total=False): + """Config for updating a RAG corpus.""" - create_time: Optional[datetime.datetime] - """Output only. Timestamp when the session was created.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - display_name: Optional[str] - """Optional. The display name of the session.""" - expire_time: Optional[datetime.datetime] - """Optional. Timestamp of when this session is considered expired. This is *always* provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation.""" +UpdateRagCorpusConfigOrDict = Union[UpdateRagCorpusConfig, UpdateRagCorpusConfigDict] - labels: Optional[dict[str, str]] - """The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""" - name: Optional[str] - """Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.""" +class _UpdateRagCorpusRequestParameters(_common.BaseModel): + """Parameters for updating a RAG corpus.""" - session_state: Optional[dict[str, Any]] - """Optional. Session specific memory which stores key conversation points.""" + config: Optional[UpdateRagCorpusConfig] = Field(default=None, description="""""") + name: Optional[str] = Field(default=None, description="""""") + rag_corpus: Optional[RagCorpus] = Field(default=None, description="""""") - ttl: Optional[str] - """Optional. Input only. The TTL for this session. The minimum value is 24 hours.""" - update_time: Optional[datetime.datetime] - """Output only. Timestamp when the session was updated.""" +class _UpdateRagCorpusRequestParametersDict(TypedDict, total=False): + """Parameters for updating a RAG corpus.""" - user_id: Optional[str] - """Required. Immutable. String id provided by the user""" + config: Optional[UpdateRagCorpusConfigDict] + """""" + name: Optional[str] + """""" -SessionOrDict = Union[Session, SessionDict] + rag_corpus: Optional[RagCorpusDict] + """""" -class AgentEngineSessionOperation(_common.BaseModel): - """Operation that has an agent engine session as a response.""" +_UpdateRagCorpusRequestParametersOrDict = Union[ + _UpdateRagCorpusRequestParameters, _UpdateRagCorpusRequestParametersDict +] + + +class UpdateRagCorpusOperation(_common.BaseModel): + """Operation for updating a RAG corpus.""" name: Optional[str] = Field( default=None, @@ -14370,13 +14288,10 @@ class AgentEngineSessionOperation(_common.BaseModel): default=None, description="""The error result of the operation in case of failure or cancellation.""", ) - response: Optional[Session] = Field( - default=None, description="""The Agent Engine Session.""" - ) -class AgentEngineSessionOperationDict(TypedDict, total=False): - """Operation that has an agent engine session as a response.""" +class UpdateRagCorpusOperationDict(TypedDict, total=False): + """Operation for updating a RAG corpus.""" 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}`.""" @@ -14390,64 +14305,54 @@ class AgentEngineSessionOperationDict(TypedDict, total=False): error: Optional[dict[str, Any]] """The error result of the operation in case of failure or cancellation.""" - response: Optional[SessionDict] - """The Agent Engine Session.""" - -AgentEngineSessionOperationOrDict = Union[ - AgentEngineSessionOperation, AgentEngineSessionOperationDict +UpdateRagCorpusOperationOrDict = Union[ + UpdateRagCorpusOperation, UpdateRagCorpusOperationDict ] -class DeleteAgentEngineSessionConfig(_common.BaseModel): - """Config for deleting an Agent Engine Session.""" +class DeleteRagCorpusConfig(_common.BaseModel): + """Config for deleting a RAG corpus.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) -class DeleteAgentEngineSessionConfigDict(TypedDict, total=False): - """Config for deleting an Agent Engine Session.""" +class DeleteRagCorpusConfigDict(TypedDict, total=False): + """Config for deleting a RAG corpus.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" -DeleteAgentEngineSessionConfigOrDict = Union[ - DeleteAgentEngineSessionConfig, DeleteAgentEngineSessionConfigDict -] +DeleteRagCorpusConfigOrDict = Union[DeleteRagCorpusConfig, DeleteRagCorpusConfigDict] -class _DeleteAgentEngineSessionRequestParameters(_common.BaseModel): - """Parameters for deleting agent engine sessions.""" +class _DeleteRagCorpusRequestParameters(_common.BaseModel): + """Parameters for deleting a RAG corpus.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine session to delete.""" - ) - config: Optional[DeleteAgentEngineSessionConfig] = Field( - default=None, description="""""" - ) + config: Optional[DeleteRagCorpusConfig] = Field(default=None, description="""""") + name: Optional[str] = Field(default=None, description="""""") -class _DeleteAgentEngineSessionRequestParametersDict(TypedDict, total=False): - """Parameters for deleting agent engine sessions.""" +class _DeleteRagCorpusRequestParametersDict(TypedDict, total=False): + """Parameters for deleting a RAG corpus.""" - name: Optional[str] - """Name of the agent engine session to delete.""" + config: Optional[DeleteRagCorpusConfigDict] + """""" - config: Optional[DeleteAgentEngineSessionConfigDict] + name: Optional[str] """""" -_DeleteAgentEngineSessionRequestParametersOrDict = Union[ - _DeleteAgentEngineSessionRequestParameters, - _DeleteAgentEngineSessionRequestParametersDict, +_DeleteRagCorpusRequestParametersOrDict = Union[ + _DeleteRagCorpusRequestParameters, _DeleteRagCorpusRequestParametersDict ] -class DeleteAgentEngineSessionOperation(_common.BaseModel): - """Operation for deleting agent engine sessions.""" +class DeleteRagCorpusOperation(_common.BaseModel): + """Operation for deleting a RAG corpus.""" name: Optional[str] = Field( default=None, @@ -14467,8 +14372,8 @@ class DeleteAgentEngineSessionOperation(_common.BaseModel): ) -class DeleteAgentEngineSessionOperationDict(TypedDict, total=False): - """Operation for deleting agent engine sessions.""" +class DeleteRagCorpusOperationDict(TypedDict, total=False): + """Operation for deleting a RAG corpus.""" 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}`.""" @@ -14483,540 +14388,495 @@ class DeleteAgentEngineSessionOperationDict(TypedDict, total=False): """The error result of the operation in case of failure or cancellation.""" -DeleteAgentEngineSessionOperationOrDict = Union[ - DeleteAgentEngineSessionOperation, DeleteAgentEngineSessionOperationDict +DeleteRagCorpusOperationOrDict = Union[ + DeleteRagCorpusOperation, DeleteRagCorpusOperationDict ] -class GetAgentEngineSessionConfig(_common.BaseModel): - """Config for getting an Agent Engine Session.""" +class DeleteRagFileConfig(_common.BaseModel): + """Config for deleting a RAG File.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) -class GetAgentEngineSessionConfigDict(TypedDict, total=False): - """Config for getting an Agent Engine Session.""" +class DeleteRagFileConfigDict(TypedDict, total=False): + """Config for deleting a RAG File.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" -GetAgentEngineSessionConfigOrDict = Union[ - GetAgentEngineSessionConfig, GetAgentEngineSessionConfigDict -] +DeleteRagFileConfigOrDict = Union[DeleteRagFileConfig, DeleteRagFileConfigDict] -class _GetAgentEngineSessionRequestParameters(_common.BaseModel): - """Parameters for getting an agent engine session.""" +class _DeleteRagFileRequestParameters(_common.BaseModel): + """Parameters for deleting a RAG File.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine session.""" - ) - config: Optional[GetAgentEngineSessionConfig] = Field( - default=None, description="""""" - ) + config: Optional[DeleteRagFileConfig] = Field(default=None, description="""""") + name: Optional[str] = Field(default=None, description="""""") -class _GetAgentEngineSessionRequestParametersDict(TypedDict, total=False): - """Parameters for getting an agent engine session.""" +class _DeleteRagFileRequestParametersDict(TypedDict, total=False): + """Parameters for deleting a RAG File.""" - name: Optional[str] - """Name of the agent engine session.""" + config: Optional[DeleteRagFileConfigDict] + """""" - config: Optional[GetAgentEngineSessionConfigDict] + name: Optional[str] """""" -_GetAgentEngineSessionRequestParametersOrDict = Union[ - _GetAgentEngineSessionRequestParameters, _GetAgentEngineSessionRequestParametersDict +_DeleteRagFileRequestParametersOrDict = Union[ + _DeleteRagFileRequestParameters, _DeleteRagFileRequestParametersDict ] -class ListAgentEngineSessionsConfig(_common.BaseModel): - """Config for listing agent engine sessions.""" +class DeleteRagFileOperation(_common.BaseModel): + """Operation for deleting a RAG File.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + name: Optional[str] = Field( + default=None, + description="""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}`.""", ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( + metadata: Optional[dict[str, Any]] = Field( default=None, - description="""An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""", + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", ) -class ListAgentEngineSessionsConfigDict(TypedDict, total=False): - """Config for listing agent engine sessions.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - - page_size: Optional[int] - """""" - - page_token: Optional[str] - """""" +class DeleteRagFileOperationDict(TypedDict, total=False): + """Operation for deleting a RAG File.""" - filter: Optional[str] - """An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""" + 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}`.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" -ListAgentEngineSessionsConfigOrDict = Union[ - ListAgentEngineSessionsConfig, ListAgentEngineSessionsConfigDict -] + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -class _ListAgentEngineSessionsRequestParameters(_common.BaseModel): - """Parameters for listing agent engines.""" - name: Optional[str] = Field( - default=None, description="""Name of the agent engine.""" - ) - config: Optional[ListAgentEngineSessionsConfig] = Field( - default=None, description="""""" - ) +DeleteRagFileOperationOrDict = Union[DeleteRagFileOperation, DeleteRagFileOperationDict] -class _ListAgentEngineSessionsRequestParametersDict(TypedDict, total=False): - """Parameters for listing agent engines.""" +class UpdateRagConfig(_common.BaseModel): + """Config for updating a RAG Config.""" - name: Optional[str] - """Name of the agent engine.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) - config: Optional[ListAgentEngineSessionsConfigDict] - """""" +class UpdateRagConfigDict(TypedDict, total=False): + """Config for updating a RAG Config.""" -_ListAgentEngineSessionsRequestParametersOrDict = Union[ - _ListAgentEngineSessionsRequestParameters, - _ListAgentEngineSessionsRequestParametersDict, -] + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -class ListReasoningEnginesSessionsResponse(_common.BaseModel): - """Response for listing agent engine sessions.""" +UpdateRagConfigOrDict = Union[UpdateRagConfig, UpdateRagConfigDict] - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" - ) - next_page_token: Optional[str] = Field(default=None, description="""""") - sessions: Optional[list[Session]] = Field( - default=None, description="""List of agent engine sessions.""" - ) +class _UpdateRagConfigRequestParameters(_common.BaseModel): + """Parameters for updating a RAG Config.""" -class ListReasoningEnginesSessionsResponseDict(TypedDict, total=False): - """Response for listing agent engine sessions.""" + updated_config: Optional[RagEngineConfig] = Field(default=None, description="""""") + config: Optional[UpdateRagConfig] = Field(default=None, description="""""") - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" - next_page_token: Optional[str] +class _UpdateRagConfigRequestParametersDict(TypedDict, total=False): + """Parameters for updating a RAG Config.""" + + updated_config: Optional[RagEngineConfigDict] """""" - sessions: Optional[list[SessionDict]] - """List of agent engine sessions.""" + config: Optional[UpdateRagConfigDict] + """""" -ListReasoningEnginesSessionsResponseOrDict = Union[ - ListReasoningEnginesSessionsResponse, ListReasoningEnginesSessionsResponseDict +_UpdateRagConfigRequestParametersOrDict = Union[ + _UpdateRagConfigRequestParameters, _UpdateRagConfigRequestParametersDict ] -class _GetAgentEngineSessionOperationParameters(_common.BaseModel): - """Parameters for getting an operation with a session as a response.""" +class UpdateRagConfigOperation(_common.BaseModel): + """Operation for updating a RAG Config.""" - operation_name: Optional[str] = Field( - default=None, description="""The server-assigned name for the operation.""" + name: Optional[str] = Field( + default=None, + description="""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}`.""", ) - config: Optional[GetAgentEngineOperationConfig] = Field( - default=None, description="""Used to override the default configuration.""" + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", ) -class _GetAgentEngineSessionOperationParametersDict(TypedDict, total=False): - """Parameters for getting an operation with a session as a response.""" +class UpdateRagConfigOperationDict(TypedDict, total=False): + """Operation for updating a RAG Config.""" - operation_name: Optional[str] - """The server-assigned name for the 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}`.""" - config: Optional[GetAgentEngineOperationConfigDict] - """Used to override the default configuration.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" -_GetAgentEngineSessionOperationParametersOrDict = Union[ - _GetAgentEngineSessionOperationParameters, - _GetAgentEngineSessionOperationParametersDict, + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + +UpdateRagConfigOperationOrDict = Union[ + UpdateRagConfigOperation, UpdateRagConfigOperationDict ] -class UpdateAgentEngineSessionConfig(_common.BaseModel): - """Config for updating agent engine session.""" +class RetrieveContextsConfig(_common.BaseModel): + """Config for retrieving RAG Contexts.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) - display_name: Optional[str] = Field( - default=None, description="""The display name of the session.""" - ) - session_state: Optional[dict[str, Any]] = Field( + + +class RetrieveContextsConfigDict(TypedDict, total=False): + """Config for retrieving RAG Contexts.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +RetrieveContextsConfigOrDict = Union[RetrieveContextsConfig, RetrieveContextsConfigDict] + + +class VertexRagStoreRagResource(_common.BaseModel): + """The definition of the Rag resource.""" + + rag_corpus: Optional[str] = Field( default=None, - description="""Session state which stores key conversation points.""", - ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Waits for the operation to complete before returning.""", + description="""Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`""", ) - ttl: Optional[str] = Field( + rag_file_ids: Optional[list[str]] = Field( default=None, - description="""Optional. Input only. The TTL for this resource. + description="""Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.""", + ) - The expiration time is computed: now + TTL.""", + +class VertexRagStoreRagResourceDict(TypedDict, total=False): + """The definition of the Rag resource.""" + + rag_corpus: Optional[str] + """Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`""" + + rag_file_ids: Optional[list[str]] + """Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.""" + + +VertexRagStoreRagResourceOrDict = Union[ + VertexRagStoreRagResource, VertexRagStoreRagResourceDict +] + + +class VertexRagStore(_common.BaseModel): + """Retrieve from Vertex RAG Store for grounding.""" + + rag_corpora: Optional[list[str]] = Field( + default=None, + description="""Optional. Deprecated. Please use rag_resources instead.""", ) - expire_time: Optional[datetime.datetime] = Field( + rag_resources: Optional[list[VertexRagStoreRagResource]] = Field( default=None, - description="""Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""", + description="""Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.""", ) - labels: Optional[dict[str, str]] = Field( + rag_retrieval_config: Optional[RagRetrievalConfig] = Field( default=None, - description="""Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""", + description="""Optional. The retrieval config for the Rag query.""", ) - session_id: Optional[str] = Field( + similarity_top_k: Optional[int] = Field( default=None, - description="""Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""", + description="""Optional. Number of top k results to return from the selected corpora.""", ) - update_mask: Optional[str] = Field( + store_context: Optional[bool] = Field( default=None, - description="""The update mask to apply. For the `FieldMask` definition, see - https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.""", + description="""Optional. Currently only supported for Gemini Multimodal Live API. In Gemini Multimodal Live API, if `store_context` bool is specified, Gemini will leverage it to automatically memorize the interactions between the client and Gemini, and retrieve context when needed to augment the response generation for users' ongoing and future interactions.""", ) - user_id: Optional[str] = Field( - default=None, description="""User ID of the agent engine session to update.""" + vector_distance_threshold: Optional[float] = Field( + default=None, + description="""Optional. Only return results with vector distance smaller than the threshold.""", ) -class UpdateAgentEngineSessionConfigDict(TypedDict, total=False): - """Config for updating agent engine session.""" +class VertexRagStoreDict(TypedDict, total=False): + """Retrieve from Vertex RAG Store for grounding.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + rag_corpora: Optional[list[str]] + """Optional. Deprecated. Please use rag_resources instead.""" - display_name: Optional[str] - """The display name of the session.""" + rag_resources: Optional[list[VertexRagStoreRagResourceDict]] + """Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.""" - session_state: Optional[dict[str, Any]] - """Session state which stores key conversation points.""" + rag_retrieval_config: Optional[RagRetrievalConfigDict] + """Optional. The retrieval config for the Rag query.""" - wait_for_completion: Optional[bool] - """Waits for the operation to complete before returning.""" + similarity_top_k: Optional[int] + """Optional. Number of top k results to return from the selected corpora.""" - ttl: Optional[str] - """Optional. Input only. The TTL for this resource. + store_context: Optional[bool] + """Optional. Currently only supported for Gemini Multimodal Live API. In Gemini Multimodal Live API, if `store_context` bool is specified, Gemini will leverage it to automatically memorize the interactions between the client and Gemini, and retrieve context when needed to augment the response generation for users' ongoing and future interactions.""" - The expiration time is computed: now + TTL.""" + vector_distance_threshold: Optional[float] + """Optional. Only return results with vector distance smaller than the threshold.""" - expire_time: Optional[datetime.datetime] - """Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""" - labels: Optional[dict[str, str]] - """Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""" +VertexRagStoreOrDict = Union[VertexRagStore, VertexRagStoreDict] - session_id: Optional[str] - """Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""" - update_mask: Optional[str] - """The update mask to apply. For the `FieldMask` definition, see - https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.""" +class _RetrieveRagContextsRequestParameters(_common.BaseModel): + """Parameters for retrieving RAG Contexts.""" - user_id: Optional[str] - """User ID of the agent engine session to update.""" + vertex_rag_store: Optional[VertexRagStore] = Field(default=None, description="""""") + query: Optional[RagQuery] = Field(default=None, description="""""") + config: Optional[RetrieveContextsConfig] = Field(default=None, description="""""") -UpdateAgentEngineSessionConfigOrDict = Union[ - UpdateAgentEngineSessionConfig, UpdateAgentEngineSessionConfigDict +class _RetrieveRagContextsRequestParametersDict(TypedDict, total=False): + """Parameters for retrieving RAG Contexts.""" + + vertex_rag_store: Optional[VertexRagStoreDict] + """""" + + query: Optional[RagQueryDict] + """""" + + config: Optional[RetrieveContextsConfigDict] + """""" + + +_RetrieveRagContextsRequestParametersOrDict = Union[ + _RetrieveRagContextsRequestParameters, _RetrieveRagContextsRequestParametersDict ] -class _UpdateAgentEngineSessionRequestParameters(_common.BaseModel): - """Parameters for updating agent engine sessions.""" +class RetrieveContextsResponse(_common.BaseModel): - name: Optional[str] = Field( - default=None, description="""Name of the agent engine session to update.""" - ) - config: Optional[UpdateAgentEngineSessionConfig] = Field( - default=None, description="""""" + contexts: Optional[RagContexts] = Field( + default=None, description="""The contexts of the query.""" ) -class _UpdateAgentEngineSessionRequestParametersDict(TypedDict, total=False): - """Parameters for updating agent engine sessions.""" - - name: Optional[str] - """Name of the agent engine session to update.""" +class RetrieveContextsResponseDict(TypedDict, total=False): - config: Optional[UpdateAgentEngineSessionConfigDict] - """""" + contexts: Optional[RagContextsDict] + """The contexts of the query.""" -_UpdateAgentEngineSessionRequestParametersOrDict = Union[ - _UpdateAgentEngineSessionRequestParameters, - _UpdateAgentEngineSessionRequestParametersDict, +RetrieveContextsResponseOrDict = Union[ + RetrieveContextsResponse, RetrieveContextsResponseDict ] -class EventActions(_common.BaseModel): - """Actions are parts of events that are executed by the agent.""" +class GetRagConfigOperationConfig(_common.BaseModel): + """Config for getting a RAG config operation.""" - artifact_delta: Optional[dict[str, int]] = Field( - default=None, - description="""Optional. Indicates that the event is updating an artifact. key is the filename, value is the version.""", - ) - escalate: Optional[bool] = Field( - default=None, - description="""Optional. The agent is escalating to a higher level agent.""", - ) - requested_auth_configs: Optional[dict[str, Any]] = Field( - default=None, - description="""Optional. Will only be set by a tool response indicating tool request euc. Struct key is the function call id since one function call response (from model) could correspond to multiple function calls. Struct value is the required auth config, which can be another struct.""", - ) - skip_summarization: Optional[bool] = Field( - default=None, - description="""Optional. If true, it won't call model to summarize function response. Only used for function_response event.""", - ) - state_delta: Optional[dict[str, Any]] = Field( - default=None, - description="""Optional. Indicates that the event is updating the state with the given delta.""", - ) - transfer_agent: Optional[str] = Field( - default=None, - description="""Optional. If set, the event transfers to the specified agent.""", + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) -class EventActionsDict(TypedDict, total=False): - """Actions are parts of events that are executed by the agent.""" +class GetRagConfigOperationConfigDict(TypedDict, total=False): + """Config for getting a RAG config operation.""" - artifact_delta: Optional[dict[str, int]] - """Optional. Indicates that the event is updating an artifact. key is the filename, value is the version.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - escalate: Optional[bool] - """Optional. The agent is escalating to a higher level agent.""" - requested_auth_configs: Optional[dict[str, Any]] - """Optional. Will only be set by a tool response indicating tool request euc. Struct key is the function call id since one function call response (from model) could correspond to multiple function calls. Struct value is the required auth config, which can be another struct.""" +GetRagConfigOperationConfigOrDict = Union[ + GetRagConfigOperationConfig, GetRagConfigOperationConfigDict +] - skip_summarization: Optional[bool] - """Optional. If true, it won't call model to summarize function response. Only used for function_response event.""" - state_delta: Optional[dict[str, Any]] - """Optional. Indicates that the event is updating the state with the given delta.""" +class _GetRagConfigOperationParameters(_common.BaseModel): + """Parameters for getting a RAG config operation.""" - transfer_agent: Optional[str] - """Optional. If set, the event transfers to the specified agent.""" + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" + ) + config: Optional[GetRagConfigOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" + ) -EventActionsOrDict = Union[EventActions, EventActionsDict] +class _GetRagConfigOperationParametersDict(TypedDict, total=False): + """Parameters for getting a RAG config operation.""" + operation_name: Optional[str] + """The server-assigned name for the operation.""" -class EventMetadata(_common.BaseModel): - """Metadata relating to a LLM response event.""" + config: Optional[GetRagConfigOperationConfigDict] + """Used to override the default configuration.""" - grounding_metadata: Optional[genai_types.GroundingMetadata] = Field( - default=None, - description="""Optional. Metadata returned to client when grounding is enabled.""", - ) - branch: Optional[str] = Field( - default=None, - description="""Optional. The branch of the event. The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple child agents shouldn't see their siblings' conversation history.""", - ) - custom_metadata: Optional[dict[str, Any]] = Field( - default=None, description="""The custom metadata of the LlmResponse.""" - ) - interrupted: Optional[bool] = Field( + +_GetRagConfigOperationParametersOrDict = Union[ + _GetRagConfigOperationParameters, _GetRagConfigOperationParametersDict +] + + +class RagEngineConfigOperation(_common.BaseModel): + """Operation for getting a RAG config.""" + + name: Optional[str] = Field( default=None, - description="""Optional. Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.""", + description="""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}`.""", ) - long_running_tool_ids: Optional[list[str]] = Field( + metadata: Optional[dict[str, Any]] = Field( default=None, - description="""Optional. Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. Only valid for function call event.""", + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - partial: Optional[bool] = Field( + done: Optional[bool] = Field( default=None, - description="""Optional. Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.""", + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", ) - turn_complete: Optional[bool] = Field( + error: Optional[dict[str, Any]] = Field( default=None, - description="""Optional. Indicates whether the response from the model is complete. Only used for streaming mode.""", - ) - input_transcription: Optional[genai_types.Transcription] = Field( - default=None, description="""Optional. Audio transcription of user input.""" - ) - output_transcription: Optional[genai_types.Transcription] = Field( - default=None, description="""Optional. Audio transcription of model output.""" + description="""The error result of the operation in case of failure or cancellation.""", ) -class EventMetadataDict(TypedDict, total=False): - """Metadata relating to a LLM response event.""" - - grounding_metadata: Optional[genai_types.GroundingMetadataDict] - """Optional. Metadata returned to client when grounding is enabled.""" - - branch: Optional[str] - """Optional. The branch of the event. The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple child agents shouldn't see their siblings' conversation history.""" - - custom_metadata: Optional[dict[str, Any]] - """The custom metadata of the LlmResponse.""" - - interrupted: Optional[bool] - """Optional. Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.""" - - long_running_tool_ids: Optional[list[str]] - """Optional. Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. Only valid for function call event.""" +class RagEngineConfigOperationDict(TypedDict, total=False): + """Operation for getting a RAG config.""" - partial: Optional[bool] - """Optional. Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.""" + 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}`.""" - turn_complete: Optional[bool] - """Optional. Indicates whether the response from the model is complete. Only used for streaming mode.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - input_transcription: Optional[genai_types.TranscriptionDict] - """Optional. Audio transcription of user input.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - output_transcription: Optional[genai_types.TranscriptionDict] - """Optional. Audio transcription of model output.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -EventMetadataOrDict = Union[EventMetadata, EventMetadataDict] +RagEngineConfigOperationOrDict = Union[ + RagEngineConfigOperation, RagEngineConfigOperationDict +] -class AppendAgentEngineSessionEventConfig(_common.BaseModel): - """Config for appending agent engine session event.""" +class GetAgentEngineRuntimeRevisionConfig(_common.BaseModel): + """Config for getting an Agent Engine Runtime Revision.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) - content: Optional[genai_types.Content] = Field( - default=None, description="""The content of the session event.""" - ) - actions: Optional[EventActions] = Field( - default=None, - description="""Actions are parts of events that are related to the session event.""", - ) - error_code: Optional[str] = Field( - default=None, description="""The error code of the session event.""" - ) - error_message: Optional[str] = Field( - default=None, description="""The error message of the session event.""" - ) - event_metadata: Optional[EventMetadata] = Field( - default=None, description="""Metadata relating to the session event.""" - ) - raw_event: Optional[dict[str, Any]] = Field( - default=None, - description="""Weakly typed raw event data in proto struct format.""", - ) -class AppendAgentEngineSessionEventConfigDict(TypedDict, total=False): - """Config for appending agent engine session event.""" +class GetAgentEngineRuntimeRevisionConfigDict(TypedDict, total=False): + """Config for getting an Agent Engine Runtime Revision.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" - content: Optional[genai_types.ContentDict] - """The content of the session event.""" - - actions: Optional[EventActionsDict] - """Actions are parts of events that are related to the session event.""" - - error_code: Optional[str] - """The error code of the session event.""" - - error_message: Optional[str] - """The error message of the session event.""" - - event_metadata: Optional[EventMetadataDict] - """Metadata relating to the session event.""" - - raw_event: Optional[dict[str, Any]] - """Weakly typed raw event data in proto struct format.""" - -AppendAgentEngineSessionEventConfigOrDict = Union[ - AppendAgentEngineSessionEventConfig, AppendAgentEngineSessionEventConfigDict +GetAgentEngineRuntimeRevisionConfigOrDict = Union[ + GetAgentEngineRuntimeRevisionConfig, GetAgentEngineRuntimeRevisionConfigDict ] -class _AppendAgentEngineSessionEventRequestParameters(_common.BaseModel): - """Parameters for appending agent engines.""" +class _GetAgentEngineRuntimeRevisionRequestParameters(_common.BaseModel): + """Parameters for getting an agent engine runtime revision.""" name: Optional[str] = Field( - default=None, description="""Name of the agent engine session.""" - ) - author: Optional[str] = Field( - default=None, description="""Author of the agent engine session event.""" - ) - invocation_id: Optional[str] = Field( - default=None, description="""Invocation ID of the agent engine.""" - ) - timestamp: Optional[datetime.datetime] = Field( - default=None, description="""Timestamp indicating when the event was created.""" + default=None, description="""Name of the agent engine runtime revision.""" ) - config: Optional[AppendAgentEngineSessionEventConfig] = Field( + config: Optional[GetAgentEngineRuntimeRevisionConfig] = Field( default=None, description="""""" ) -class _AppendAgentEngineSessionEventRequestParametersDict(TypedDict, total=False): - """Parameters for appending agent engines.""" +class _GetAgentEngineRuntimeRevisionRequestParametersDict(TypedDict, total=False): + """Parameters for getting an agent engine runtime revision.""" name: Optional[str] - """Name of the agent engine session.""" + """Name of the agent engine runtime revision.""" - author: Optional[str] - """Author of the agent engine session event.""" + config: Optional[GetAgentEngineRuntimeRevisionConfigDict] + """""" - invocation_id: Optional[str] - """Invocation ID of the agent engine.""" - timestamp: Optional[datetime.datetime] - """Timestamp indicating when the event was created.""" +_GetAgentEngineRuntimeRevisionRequestParametersOrDict = Union[ + _GetAgentEngineRuntimeRevisionRequestParameters, + _GetAgentEngineRuntimeRevisionRequestParametersDict, +] - config: Optional[AppendAgentEngineSessionEventConfigDict] - """""" +class ReasoningEngineRuntimeRevision(_common.BaseModel): + """A runtime revision.""" -_AppendAgentEngineSessionEventRequestParametersOrDict = Union[ - _AppendAgentEngineSessionEventRequestParameters, - _AppendAgentEngineSessionEventRequestParametersDict, -] + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this ReasoningEngineRuntimeRevision was created.""", + ) + name: Optional[str] = Field( + default=None, + description="""Identifier. The resource name of the ReasoningEngineRuntimeRevision. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`""", + ) + spec: Optional[ReasoningEngineSpec] = Field( + default=None, + description="""Immutable. Configurations of the ReasoningEngineRuntimeRevision. Contains only revision specific fields.""", + ) + state: Optional[State] = Field( + default=None, description="""Output only. The state of the revision.""" + ) -class AppendAgentEngineSessionEventResponse(_common.BaseModel): - """Response for appending agent engine session event.""" +class ReasoningEngineRuntimeRevisionDict(TypedDict, total=False): + """A runtime revision.""" - pass + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this ReasoningEngineRuntimeRevision was created.""" + name: Optional[str] + """Identifier. The resource name of the ReasoningEngineRuntimeRevision. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`""" -class AppendAgentEngineSessionEventResponseDict(TypedDict, total=False): - """Response for appending agent engine session event.""" + spec: Optional[ReasoningEngineSpecDict] + """Immutable. Configurations of the ReasoningEngineRuntimeRevision. Contains only revision specific fields.""" - pass + state: Optional[State] + """Output only. The state of the revision.""" -AppendAgentEngineSessionEventResponseOrDict = Union[ - AppendAgentEngineSessionEventResponse, AppendAgentEngineSessionEventResponseDict +ReasoningEngineRuntimeRevisionOrDict = Union[ + ReasoningEngineRuntimeRevision, ReasoningEngineRuntimeRevisionDict ] -class ListAgentEngineSessionEventsConfig(_common.BaseModel): - """Config for listing agent engine session events.""" +class ListAgentEngineRuntimeRevisionsConfig(_common.BaseModel): + """Config for listing reasoning engine runtime revisions.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" @@ -15030,8 +14890,8 @@ class ListAgentEngineSessionEventsConfig(_common.BaseModel): ) -class ListAgentEngineSessionEventsConfigDict(TypedDict, total=False): - """Config for listing agent engine session events.""" +class ListAgentEngineRuntimeRevisionsConfigDict(TypedDict, total=False): + """Config for listing reasoning engine runtime revisions.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" @@ -15047,1954 +14907,5901 @@ class ListAgentEngineSessionEventsConfigDict(TypedDict, total=False): For field names both snake_case and camelCase are supported.""" -ListAgentEngineSessionEventsConfigOrDict = Union[ - ListAgentEngineSessionEventsConfig, ListAgentEngineSessionEventsConfigDict +ListAgentEngineRuntimeRevisionsConfigOrDict = Union[ + ListAgentEngineRuntimeRevisionsConfig, ListAgentEngineRuntimeRevisionsConfigDict ] -class _ListAgentEngineSessionEventsRequestParameters(_common.BaseModel): - """Parameters for listing agent engine session events.""" +class _ListAgentEngineRuntimeRevisionsRequestParameters(_common.BaseModel): + """Parameters for listing reasoning engine runtime revisions.""" name: Optional[str] = Field( - default=None, description="""Name of the agent engine session.""" + default=None, description="""Name of the reasoning engine.""" ) - config: Optional[ListAgentEngineSessionEventsConfig] = Field( + config: Optional[ListAgentEngineRuntimeRevisionsConfig] = Field( default=None, description="""""" ) -class _ListAgentEngineSessionEventsRequestParametersDict(TypedDict, total=False): - """Parameters for listing agent engine session events.""" +class _ListAgentEngineRuntimeRevisionsRequestParametersDict(TypedDict, total=False): + """Parameters for listing reasoning engine runtime revisions.""" name: Optional[str] - """Name of the agent engine session.""" + """Name of the reasoning engine.""" - config: Optional[ListAgentEngineSessionEventsConfigDict] + config: Optional[ListAgentEngineRuntimeRevisionsConfigDict] """""" -_ListAgentEngineSessionEventsRequestParametersOrDict = Union[ - _ListAgentEngineSessionEventsRequestParameters, - _ListAgentEngineSessionEventsRequestParametersDict, +_ListAgentEngineRuntimeRevisionsRequestParametersOrDict = Union[ + _ListAgentEngineRuntimeRevisionsRequestParameters, + _ListAgentEngineRuntimeRevisionsRequestParametersDict, ] -class SessionEvent(_common.BaseModel): - """A session event.""" +class ListReasoningEnginesRuntimeRevisionsResponse(_common.BaseModel): + """Response for listing agent engine runtime revisions.""" - content: Optional[genai_types.Content] = Field( - default=None, - description="""Optional. Content of the event provided by the author.""", - ) - actions: Optional[EventActions] = Field( - default=None, description="""Optional. Actions executed by the agent.""" + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" ) - author: Optional[str] = Field( - default=None, - description="""Required. The name of the agent that sent the event, or user.""", - ) - error_code: Optional[str] = Field( - default=None, - description="""Optional. Error code if the response is an error. Code varies by model.""", - ) - error_message: Optional[str] = Field( - default=None, - description="""Optional. Error message if the response is an error.""", - ) - event_metadata: Optional[EventMetadata] = Field( - default=None, description="""Optional. Metadata relating to this event.""" - ) - invocation_id: Optional[str] = Field( - default=None, - description="""Required. The invocation id of the event, multiple events can have the same invocation id.""", - ) - name: Optional[str] = Field( - default=None, - description="""Identifier. The resource name of the event. Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.""", - ) - timestamp: Optional[datetime.datetime] = Field( - default=None, - description="""Required. Timestamp when the event was created on client side.""", - ) - raw_event: Optional[dict[str, Any]] = Field( - default=None, - description="""Optional. Weakly typed raw event data in proto struct format.""", + next_page_token: Optional[str] = Field(default=None, description="""""") + reasoning_engine_runtime_revisions: Optional[ + list[ReasoningEngineRuntimeRevision] + ] = Field( + default=None, description="""List of reasoning engine runtime revisions.""" ) -class SessionEventDict(TypedDict, total=False): - """A session event.""" +class ListReasoningEnginesRuntimeRevisionsResponseDict(TypedDict, total=False): + """Response for listing agent engine runtime revisions.""" - content: Optional[genai_types.ContentDict] - """Optional. Content of the event provided by the author.""" + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" - actions: Optional[EventActionsDict] - """Optional. Actions executed by the agent.""" + next_page_token: Optional[str] + """""" - author: Optional[str] - """Required. The name of the agent that sent the event, or user.""" + reasoning_engine_runtime_revisions: Optional[ + list[ReasoningEngineRuntimeRevisionDict] + ] + """List of reasoning engine runtime revisions.""" - error_code: Optional[str] - """Optional. Error code if the response is an error. Code varies by model.""" - error_message: Optional[str] - """Optional. Error message if the response is an error.""" +ListReasoningEnginesRuntimeRevisionsResponseOrDict = Union[ + ListReasoningEnginesRuntimeRevisionsResponse, + ListReasoningEnginesRuntimeRevisionsResponseDict, +] - event_metadata: Optional[EventMetadataDict] - """Optional. Metadata relating to this event.""" - invocation_id: Optional[str] - """Required. The invocation id of the event, multiple events can have the same invocation id.""" +class DeleteAgentEngineRuntimeRevisionConfig(_common.BaseModel): + """Config for deleting an Agent Engine Runtime Revision.""" - name: Optional[str] - """Identifier. The resource name of the event. Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Waits for the operation to complete before returning.""", + ) - timestamp: Optional[datetime.datetime] - """Required. Timestamp when the event was created on client side.""" - raw_event: Optional[dict[str, Any]] - """Optional. Weakly typed raw event data in proto struct format.""" +class DeleteAgentEngineRuntimeRevisionConfigDict(TypedDict, total=False): + """Config for deleting an Agent Engine Runtime Revision.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + wait_for_completion: Optional[bool] + """Waits for the operation to complete before returning.""" -SessionEventOrDict = Union[SessionEvent, SessionEventDict] +DeleteAgentEngineRuntimeRevisionConfigOrDict = Union[ + DeleteAgentEngineRuntimeRevisionConfig, DeleteAgentEngineRuntimeRevisionConfigDict +] -class ListAgentEngineSessionEventsResponse(_common.BaseModel): - """Response for listing agent engine session events.""" +class _DeleteAgentEngineRuntimeRevisionRequestParameters(_common.BaseModel): + """Parameters for deleting agent engine runtime revisions.""" - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" + name: Optional[str] = Field( + default=None, + description="""Name of the agent engine runtime revision to delete.""", ) - next_page_token: Optional[str] = Field(default=None, description="""""") - session_events: Optional[list[SessionEvent]] = Field( - default=None, description="""List of session events.""" + config: Optional[DeleteAgentEngineRuntimeRevisionConfig] = Field( + default=None, description="""""" ) -class ListAgentEngineSessionEventsResponseDict(TypedDict, total=False): - """Response for listing agent engine session events.""" +class _DeleteAgentEngineRuntimeRevisionRequestParametersDict(TypedDict, total=False): + """Parameters for deleting agent engine runtime revisions.""" - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" + name: Optional[str] + """Name of the agent engine runtime revision to delete.""" - next_page_token: Optional[str] + config: Optional[DeleteAgentEngineRuntimeRevisionConfigDict] """""" - session_events: Optional[list[SessionEventDict]] - """List of session events.""" - -ListAgentEngineSessionEventsResponseOrDict = Union[ - ListAgentEngineSessionEventsResponse, ListAgentEngineSessionEventsResponseDict +_DeleteAgentEngineRuntimeRevisionRequestParametersOrDict = Union[ + _DeleteAgentEngineRuntimeRevisionRequestParameters, + _DeleteAgentEngineRuntimeRevisionRequestParametersDict, ] -class GeminiExample(_common.BaseModel): - """Represents a Gemini example.""" +class DeleteAgentEngineRuntimeRevisionOperation(_common.BaseModel): + """Operation for deleting agent engine runtime revisions.""" - model: Optional[str] = Field( - default=None, description="""The model used to generate the Gemini example.""" - ) - contents: Optional[list[genai_types.Content]] = Field( - default=None, description="""Contents of the Gemini example.""" - ) - system_instruction: Optional[genai_types.Content] = Field( - default=None, description="""System instruction for the Gemini example.""" - ) - cached_content: Optional[str] = Field( - default=None, description="""Cached content for the Gemini example.""" - ) - tools: Optional[list[genai_types.Tool]] = Field( - default=None, description="""Tools for the Gemini example.""" - ) - tool_config: Optional[genai_types.ToolConfig] = Field( - default=None, description="""Tools for the Gemini example.""" + name: Optional[str] = Field( + default=None, + description="""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}`.""", ) - safety_settings: Optional[list[genai_types.SafetySetting]] = Field( - default=None, description="""Safety settings for the Gemini example.""" + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - generation_config: Optional[genai_types.GenerationConfig] = Field( - default=None, description="""Generation config for the Gemini example.""" + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", ) - model_armor_config: Optional[genai_types.ModelArmorConfig] = Field( + error: Optional[dict[str, Any]] = Field( default=None, - description="""Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.""", + description="""The error result of the operation in case of failure or cancellation.""", ) -class GeminiExampleDict(TypedDict, total=False): - """Represents a Gemini example.""" +class DeleteAgentEngineRuntimeRevisionOperationDict(TypedDict, total=False): + """Operation for deleting agent engine runtime revisions.""" - model: Optional[str] - """The model used to generate the Gemini example.""" + 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}`.""" - contents: Optional[list[genai_types.ContentDict]] - """Contents of the Gemini example.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - system_instruction: Optional[genai_types.ContentDict] - """System instruction for the Gemini example.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - cached_content: Optional[str] - """Cached content for the Gemini example.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" - tools: Optional[list[genai_types.ToolDict]] - """Tools for the Gemini example.""" - tool_config: Optional[genai_types.ToolConfigDict] - """Tools for the Gemini example.""" +DeleteAgentEngineRuntimeRevisionOperationOrDict = Union[ + DeleteAgentEngineRuntimeRevisionOperation, + DeleteAgentEngineRuntimeRevisionOperationDict, +] - safety_settings: Optional[list[genai_types.SafetySettingDict]] - """Safety settings for the Gemini example.""" - generation_config: Optional[genai_types.GenerationConfigDict] - """Generation config for the Gemini example.""" +class GetDeleteAgentEngineRuntimeRevisionOperationConfig(_common.BaseModel): - model_armor_config: Optional[genai_types.ModelArmorConfigDict] - """Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) -GeminiExampleOrDict = Union[GeminiExample, GeminiExampleDict] +class GetDeleteAgentEngineRuntimeRevisionOperationConfigDict(TypedDict, total=False): + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -class GeminiTemplateConfig(_common.BaseModel): - """Represents a Gemini template config.""" - gemini_example: Optional[GeminiExample] = Field( - default=None, - description="""Required. The template that will be used for assembling the request to use for downstream applications.""", +GetDeleteAgentEngineRuntimeRevisionOperationConfigOrDict = Union[ + GetDeleteAgentEngineRuntimeRevisionOperationConfig, + GetDeleteAgentEngineRuntimeRevisionOperationConfigDict, +] + + +class _GetDeleteAgentEngineRuntimeRevisionOperationParameters(_common.BaseModel): + """Parameters for getting an operation that deletes a agent engine runtime revision.""" + + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" ) - field_mapping: Optional[dict[str, str]] = Field( - default=None, - description="""Required. Map of template parameters to the columns in the dataset table.""", + config: Optional[GetDeleteAgentEngineRuntimeRevisionOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" ) -class GeminiTemplateConfigDict(TypedDict, total=False): - """Represents a Gemini template config.""" +class _GetDeleteAgentEngineRuntimeRevisionOperationParametersDict( + TypedDict, total=False +): + """Parameters for getting an operation that deletes a agent engine runtime revision.""" - gemini_example: Optional[GeminiExampleDict] - """Required. The template that will be used for assembling the request to use for downstream applications.""" + operation_name: Optional[str] + """The server-assigned name for the operation.""" - field_mapping: Optional[dict[str, str]] - """Required. Map of template parameters to the columns in the dataset table.""" + config: Optional[GetDeleteAgentEngineRuntimeRevisionOperationConfigDict] + """Used to override the default configuration.""" -GeminiTemplateConfigOrDict = Union[GeminiTemplateConfig, GeminiTemplateConfigDict] +_GetDeleteAgentEngineRuntimeRevisionOperationParametersOrDict = Union[ + _GetDeleteAgentEngineRuntimeRevisionOperationParameters, + _GetDeleteAgentEngineRuntimeRevisionOperationParametersDict, +] -class GeminiRequestReadConfig(_common.BaseModel): - """Represents the config for reading Gemini requests.""" +class QueryAgentEngineRuntimeRevisionConfig(_common.BaseModel): + """Config for querying agent engine runtime revisions.""" - template_config: Optional[GeminiTemplateConfig] = Field( - default=None, description="""Gemini request template with placeholders.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) - assembled_request_column_name: Optional[str] = Field( - default=None, - description="""Column name in the underlying BigQuery table that contains already fully assembled Gemini requests.""", + class_method: Optional[str] = Field( + default=None, description="""The class method to call.""" ) + input: Optional[dict[str, Any]] = Field( + default=None, description="""The input to the class method.""" + ) + include_all_fields: Optional[bool] = Field(default=False, description="""""") - @classmethod - def single_turn_template( - cls, - *, - prompt: str, - response: Optional[str] = None, - system_instruction: Optional[str] = None, - model: Optional[str] = None, - cached_content: Optional[str] = None, - tools: Optional[list[Union[genai_types.Tool, dict[str, Any]]]] = None, - tool_config: Optional[Union[genai_types.ToolConfig, dict[str, Any]]] = None, - safety_settings: Optional[ - list[Union[genai_types.SafetySetting, dict[str, Any]]] - ] = None, - generation_config: Optional[ - Union[genai_types.GenerationConfig, dict[str, Any]] - ] = None, - field_mapping: Optional[dict[str, str]] = None, - ) -> "GeminiRequestReadConfig": - """Constructs a GeminiRequestReadConfig object for single-turn cases. - - Example: - read_config = GeminiRequestReadConfig.single_turn_template( - prompt="Which flower is this {flower_image}?", - response="This is a {label}.", - system_instruction="You are a botanical classifier." - ) - - Args: - prompt: Required. User input. - response: Optional. Model response to user input. - system_instruction: Optional. System instructions for the model. - model: Optional. The model to use for the GeminiExample. - cached_content: Optional. The cached content to use for the GeminiExample. - tools: Optional. The tools to use for the GeminiExample. - tool_config: Optional. The tool config to use for the GeminiExample. - safety_settings: Optional. The safety settings to use for the GeminiExample. - generation_config: Optional. The generation config to use for the GeminiExample. - field_mapping: Optional. Mapping of placeholders to dataset columns. - - Returns: - A GeminiRequestReadConfig object. - """ - contents = [] - contents.append( - genai_types.Content( - role="user", - parts=[ - genai_types.Part.from_text(text=prompt), - ], - ) - ) - if response: - contents.append( - genai_types.Content( - role="model", - parts=[ - genai_types.Part.from_text(text=response), - ], - ) - ) - - system_instruction_content = None - if system_instruction: - system_instruction_content = genai_types.Content( - parts=[ - genai_types.Part.from_text(text=system_instruction), - ], - ) - return cls( - template_config=GeminiTemplateConfig( - gemini_example=GeminiExample( - model=model, - contents=contents, - system_instruction=system_instruction_content, - cached_content=cached_content, - tools=tools, - tool_config=tool_config, - safety_settings=safety_settings, - generation_config=generation_config, - ), - field_mapping=field_mapping, - ), - ) +class QueryAgentEngineRuntimeRevisionConfigDict(TypedDict, total=False): + """Config for querying agent engine runtime revisions.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -class GeminiRequestReadConfigDict(TypedDict, total=False): - """Represents the config for reading Gemini requests.""" + class_method: Optional[str] + """The class method to call.""" - template_config: Optional[GeminiTemplateConfigDict] - """Gemini request template with placeholders.""" + input: Optional[dict[str, Any]] + """The input to the class method.""" - assembled_request_column_name: Optional[str] - """Column name in the underlying BigQuery table that contains already fully assembled Gemini requests.""" + include_all_fields: Optional[bool] + """""" -GeminiRequestReadConfigOrDict = Union[ - GeminiRequestReadConfig, GeminiRequestReadConfigDict +QueryAgentEngineRuntimeRevisionConfigOrDict = Union[ + QueryAgentEngineRuntimeRevisionConfig, QueryAgentEngineRuntimeRevisionConfigDict ] -class AssembleDatasetConfig(_common.BaseModel): - """Config for assembling a multimodal dataset resource.""" +class _QueryAgentEngineRuntimeRevisionRequestParameters(_common.BaseModel): + """Parameters for querying agent engine runtime revisions.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - timeout: Optional[int] = Field( - default=90, - description="""The timeout for the assemble dataset request in seconds. If not - set, the default timeout is 90 seconds.""", + name: Optional[str] = Field( + default=None, description="""Name of the agent engine runtime revision.""" ) - - -class AssembleDatasetConfigDict(TypedDict, total=False): - """Config for assembling a multimodal dataset resource.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - - timeout: Optional[int] - """The timeout for the assemble dataset request in seconds. If not - set, the default timeout is 90 seconds.""" - - -AssembleDatasetConfigOrDict = Union[AssembleDatasetConfig, AssembleDatasetConfigDict] - - -class _AssembleDatasetParameters(_common.BaseModel): - """Parameters for assembling a multimodal dataset resource.""" - - name: Optional[str] = Field(default=None, description="""""") - gemini_request_read_config: Optional[GeminiRequestReadConfig] = Field( + config: Optional[QueryAgentEngineRuntimeRevisionConfig] = Field( default=None, description="""""" ) - config: Optional[AssembleDatasetConfig] = Field(default=None, description="""""") -class _AssembleDatasetParametersDict(TypedDict, total=False): - """Parameters for assembling a multimodal dataset resource.""" +class _QueryAgentEngineRuntimeRevisionRequestParametersDict(TypedDict, total=False): + """Parameters for querying agent engine runtime revisions.""" name: Optional[str] - """""" - - gemini_request_read_config: Optional[GeminiRequestReadConfigDict] - """""" + """Name of the agent engine runtime revision.""" - config: Optional[AssembleDatasetConfigDict] + config: Optional[QueryAgentEngineRuntimeRevisionConfigDict] """""" -_AssembleDatasetParametersOrDict = Union[ - _AssembleDatasetParameters, _AssembleDatasetParametersDict +_QueryAgentEngineRuntimeRevisionRequestParametersOrDict = Union[ + _QueryAgentEngineRuntimeRevisionRequestParameters, + _QueryAgentEngineRuntimeRevisionRequestParametersDict, ] -class MultimodalDatasetOperation(_common.BaseModel): - """Represents the create dataset operation.""" +class SandboxEnvironmentSpecCodeExecutionEnvironment(_common.BaseModel): + """The code execution environment with customized settings.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( + code_language: Optional[Language] = Field( default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + description="""The coding language supported in this environment.""", ) - error: Optional[dict[str, Any]] = Field( + machine_config: Optional[MachineConfig] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", - ) - response: Optional[dict[str, Any]] = Field( - default=None, description="""The result of the dataset operation.""" + description="""The machine config of the code execution environment.""", ) -class MultimodalDatasetOperationDict(TypedDict, total=False): - """Represents the create dataset 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}`.""" - - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" +class SandboxEnvironmentSpecCodeExecutionEnvironmentDict(TypedDict, total=False): + """The code execution environment with customized settings.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + code_language: Optional[Language] + """The coding language supported in this environment.""" - response: Optional[dict[str, Any]] - """The result of the dataset operation.""" + machine_config: Optional[MachineConfig] + """The machine config of the code execution environment.""" -MultimodalDatasetOperationOrDict = Union[ - MultimodalDatasetOperation, MultimodalDatasetOperationDict +SandboxEnvironmentSpecCodeExecutionEnvironmentOrDict = Union[ + SandboxEnvironmentSpecCodeExecutionEnvironment, + SandboxEnvironmentSpecCodeExecutionEnvironmentDict, ] -class TuningResourceUsageAssessmentConfig(_common.BaseModel): - """Config for tuning resource usage assessment.""" +class SandboxEnvironmentSpecComputerUseEnvironment(_common.BaseModel): + """The computer use environment with customized settings.""" - model_name: Optional[str] = Field(default=None, description="""""") + pass -class TuningResourceUsageAssessmentConfigDict(TypedDict, total=False): - """Config for tuning resource usage assessment.""" +class SandboxEnvironmentSpecComputerUseEnvironmentDict(TypedDict, total=False): + """The computer use environment with customized settings.""" - model_name: Optional[str] - """""" + pass -TuningResourceUsageAssessmentConfigOrDict = Union[ - TuningResourceUsageAssessmentConfig, TuningResourceUsageAssessmentConfigDict +SandboxEnvironmentSpecComputerUseEnvironmentOrDict = Union[ + SandboxEnvironmentSpecComputerUseEnvironment, + SandboxEnvironmentSpecComputerUseEnvironmentDict, ] -class TuningValidationAssessmentConfig(_common.BaseModel): - """Config for tuning validation assessment.""" +class SandboxEnvironmentSpec(_common.BaseModel): + """The specification of a sandbox environment.""" - model_name: Optional[str] = Field(default=None, description="""""") - dataset_usage: Optional[str] = Field(default=None, description="""""") + code_execution_environment: Optional[ + SandboxEnvironmentSpecCodeExecutionEnvironment + ] = Field(default=None, description="""Optional. The code execution environment.""") + computer_use_environment: Optional[SandboxEnvironmentSpecComputerUseEnvironment] = ( + Field(default=None, description="""Optional. The computer use environment.""") + ) -class TuningValidationAssessmentConfigDict(TypedDict, total=False): - """Config for tuning validation assessment.""" +class SandboxEnvironmentSpecDict(TypedDict, total=False): + """The specification of a sandbox environment.""" - model_name: Optional[str] - """""" + code_execution_environment: Optional[ + SandboxEnvironmentSpecCodeExecutionEnvironmentDict + ] + """Optional. The code execution environment.""" - dataset_usage: Optional[str] - """""" + computer_use_environment: Optional[SandboxEnvironmentSpecComputerUseEnvironmentDict] + """Optional. The computer use environment.""" -TuningValidationAssessmentConfigOrDict = Union[ - TuningValidationAssessmentConfig, TuningValidationAssessmentConfigDict -] +SandboxEnvironmentSpecOrDict = Union[SandboxEnvironmentSpec, SandboxEnvironmentSpecDict] -class BatchPredictionResourceUsageAssessmentConfig(_common.BaseModel): - """Config for batch prediction resource usage assessment.""" - - model_name: Optional[str] = Field(default=None, description="""""") +class CreateAgentEngineSandboxConfig(_common.BaseModel): + """Config for creating a Sandbox.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + display_name: Optional[str] = Field( + default=None, description="""The display name of the sandbox.""" + ) + description: Optional[str] = Field( + default=None, description="""The description of the sandbox.""" + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Waits for the operation to complete before returning.""", + ) + ttl: Optional[str] = Field( + default=None, + description="""The TTL for this resource. The expiration time is computed: now + TTL.""", + ) + sandbox_environment_template: Optional[str] = Field( + default=None, + description="""The name of the sandbox environment template to create the sandbox from. The sandbox environment template should be in the format: + projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}""", + ) + sandbox_environment_snapshot: Optional[str] = Field( + default=None, + description="""The name of the sandbox environment snapshot to restore the sandbox from. The sandbox environment snapshot should be in the format: + projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}""", + ) + owner: Optional[str] = Field( + default=None, + description="""Owner information for this sandbox environment. A sandbox can only be restored from a snapshot belonging to the same owner.""", + ) -class BatchPredictionResourceUsageAssessmentConfigDict(TypedDict, total=False): - """Config for batch prediction resource usage assessment.""" - model_name: Optional[str] - """""" +class CreateAgentEngineSandboxConfigDict(TypedDict, total=False): + """Config for creating a Sandbox.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -BatchPredictionResourceUsageAssessmentConfigOrDict = Union[ - BatchPredictionResourceUsageAssessmentConfig, - BatchPredictionResourceUsageAssessmentConfigDict, -] + display_name: Optional[str] + """The display name of the sandbox.""" + description: Optional[str] + """The description of the sandbox.""" -class BatchPredictionValidationAssessmentConfig(_common.BaseModel): - """Config for batch prediction validation assessment.""" + wait_for_completion: Optional[bool] + """Waits for the operation to complete before returning.""" - model_name: Optional[str] = Field(default=None, description="""""") + ttl: Optional[str] + """The TTL for this resource. The expiration time is computed: now + TTL.""" + sandbox_environment_template: Optional[str] + """The name of the sandbox environment template to create the sandbox from. The sandbox environment template should be in the format: + projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}""" -class BatchPredictionValidationAssessmentConfigDict(TypedDict, total=False): - """Config for batch prediction validation assessment.""" + sandbox_environment_snapshot: Optional[str] + """The name of the sandbox environment snapshot to restore the sandbox from. The sandbox environment snapshot should be in the format: + projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}""" - model_name: Optional[str] - """""" + owner: Optional[str] + """Owner information for this sandbox environment. A sandbox can only be restored from a snapshot belonging to the same owner.""" -BatchPredictionValidationAssessmentConfigOrDict = Union[ - BatchPredictionValidationAssessmentConfig, - BatchPredictionValidationAssessmentConfigDict, +CreateAgentEngineSandboxConfigOrDict = Union[ + CreateAgentEngineSandboxConfig, CreateAgentEngineSandboxConfigDict ] -class AssessDatasetConfig(_common.BaseModel): - """Config for assessing a multimodal dataset resource.""" +class _CreateAgentEngineSandboxRequestParameters(_common.BaseModel): + """Parameters for creating Agent Engine Sandboxes.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + name: Optional[str] = Field( + default=None, + description="""Name of the agent engine to create the sandbox under.""", ) - timeout: Optional[int] = Field( - default=90, - description="""The timeout for the assess dataset request in seconds. If not set, - the default timeout is 90 seconds.""", + spec: Optional[SandboxEnvironmentSpec] = Field( + default=None, description="""The specification of the sandbox.""" ) - - -class AssessDatasetConfigDict(TypedDict, total=False): - """Config for assessing a multimodal dataset resource.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - - timeout: Optional[int] - """The timeout for the assess dataset request in seconds. If not set, - the default timeout is 90 seconds.""" - - -AssessDatasetConfigOrDict = Union[AssessDatasetConfig, AssessDatasetConfigDict] - - -class _AssessDatasetParameters(_common.BaseModel): - """Parameters for assessing a multimodal dataset resource.""" - - name: Optional[str] = Field(default=None, description="""""") - gemini_request_read_config: Optional[GeminiRequestReadConfig] = Field( + config: Optional[CreateAgentEngineSandboxConfig] = Field( default=None, description="""""" ) - tuning_resource_usage_assessment_config: Optional[ - TuningResourceUsageAssessmentConfig - ] = Field(default=None, description="""""") - tuning_validation_assessment_config: Optional[TuningValidationAssessmentConfig] = ( - Field(default=None, description="""""") - ) - batch_prediction_resource_usage_assessment_config: Optional[ - BatchPredictionResourceUsageAssessmentConfig - ] = Field(default=None, description="""""") - batch_prediction_validation_assessment_config: Optional[ - BatchPredictionValidationAssessmentConfig - ] = Field(default=None, description="""""") - config: Optional[AssessDatasetConfig] = Field(default=None, description="""""") -class _AssessDatasetParametersDict(TypedDict, total=False): - """Parameters for assessing a multimodal dataset resource.""" +class _CreateAgentEngineSandboxRequestParametersDict(TypedDict, total=False): + """Parameters for creating Agent Engine Sandboxes.""" name: Optional[str] - """""" - - gemini_request_read_config: Optional[GeminiRequestReadConfigDict] - """""" - - tuning_resource_usage_assessment_config: Optional[ - TuningResourceUsageAssessmentConfigDict - ] - """""" - - tuning_validation_assessment_config: Optional[TuningValidationAssessmentConfigDict] - """""" - - batch_prediction_resource_usage_assessment_config: Optional[ - BatchPredictionResourceUsageAssessmentConfigDict - ] - """""" + """Name of the agent engine to create the sandbox under.""" - batch_prediction_validation_assessment_config: Optional[ - BatchPredictionValidationAssessmentConfigDict - ] - """""" + spec: Optional[SandboxEnvironmentSpecDict] + """The specification of the sandbox.""" - config: Optional[AssessDatasetConfigDict] + config: Optional[CreateAgentEngineSandboxConfigDict] """""" -_AssessDatasetParametersOrDict = Union[ - _AssessDatasetParameters, _AssessDatasetParametersDict +_CreateAgentEngineSandboxRequestParametersOrDict = Union[ + _CreateAgentEngineSandboxRequestParameters, + _CreateAgentEngineSandboxRequestParametersDict, ] -class SchemaTablesDatasetMetadataBigQuerySource(_common.BaseModel): - """Represents the BigQuery source for multimodal dataset metadata.""" +class SandboxEnvironmentConnectionInfo(_common.BaseModel): + """The connection information of the SandboxEnvironment.""" - uri: Optional[str] = Field( - default=None, - description="""The URI of the BigQuery table. This accepts the table name with or without the bq:// prefix.""", + load_balancer_hostname: Optional[str] = Field( + default=None, description="""Output only. The hostname of the load balancer.""" ) - - -class SchemaTablesDatasetMetadataBigQuerySourceDict(TypedDict, total=False): - """Represents the BigQuery source for multimodal dataset metadata.""" - - uri: Optional[str] - """The URI of the BigQuery table. This accepts the table name with or without the bq:// prefix.""" - - -SchemaTablesDatasetMetadataBigQuerySourceOrDict = Union[ - SchemaTablesDatasetMetadataBigQuerySource, - SchemaTablesDatasetMetadataBigQuerySourceDict, -] - - -class SchemaTablesDatasetMetadataInputConfig(_common.BaseModel): - """Represents the input config for multimodal dataset metadata.""" - - bigquery_source: Optional[SchemaTablesDatasetMetadataBigQuerySource] = Field( + load_balancer_ip: Optional[str] = Field( default=None, - description="""The BigQuery source for multimodal dataset metadata.""", + description="""Output only. The IP address of the load balancer.""", ) - - -class SchemaTablesDatasetMetadataInputConfigDict(TypedDict, total=False): - """Represents the input config for multimodal dataset metadata.""" - - bigquery_source: Optional[SchemaTablesDatasetMetadataBigQuerySourceDict] - """The BigQuery source for multimodal dataset metadata.""" - - -SchemaTablesDatasetMetadataInputConfigOrDict = Union[ - SchemaTablesDatasetMetadataInputConfig, SchemaTablesDatasetMetadataInputConfigDict -] - - -class SchemaTablesDatasetMetadata(_common.BaseModel): - """Represents the metadata schema for multimodal dataset metadata.""" - - input_config: Optional[SchemaTablesDatasetMetadataInputConfig] = Field( + sandbox_internal_ip: Optional[str] = Field( default=None, - description="""The input config for multimodal dataset metadata.""", + description="""Output only. The internal IP address of the SandboxEnvironment.""", ) - gemini_request_read_config: Optional[GeminiRequestReadConfig] = Field( + routing_token: Optional[str] = Field( default=None, - description="""The Gemini request read config for the multimodal dataset.""", + description="""Output only. The routing token for the SandboxEnvironment.""", ) -class SchemaTablesDatasetMetadataDict(TypedDict, total=False): - """Represents the metadata schema for multimodal dataset metadata.""" +class SandboxEnvironmentConnectionInfoDict(TypedDict, total=False): + """The connection information of the SandboxEnvironment.""" - input_config: Optional[SchemaTablesDatasetMetadataInputConfigDict] - """The input config for multimodal dataset metadata.""" + load_balancer_hostname: Optional[str] + """Output only. The hostname of the load balancer.""" - gemini_request_read_config: Optional[GeminiRequestReadConfigDict] - """The Gemini request read config for the multimodal dataset.""" + load_balancer_ip: Optional[str] + """Output only. The IP address of the load balancer.""" + sandbox_internal_ip: Optional[str] + """Output only. The internal IP address of the SandboxEnvironment.""" -SchemaTablesDatasetMetadataOrDict = Union[ - SchemaTablesDatasetMetadata, SchemaTablesDatasetMetadataDict + routing_token: Optional[str] + """Output only. The routing token for the SandboxEnvironment.""" + + +SandboxEnvironmentConnectionInfoOrDict = Union[ + SandboxEnvironmentConnectionInfo, SandboxEnvironmentConnectionInfoDict ] -class CreateMultimodalDatasetConfig(_common.BaseModel): - """Config for creating a dataset resource to store multimodal dataset.""" +class SandboxEnvironment(_common.BaseModel): + """A sandbox environment.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + expire_time: Optional[datetime.datetime] = Field( + default=None, + description="""Expiration time of the sandbox environment. + """, ) - timeout: Optional[int] = Field( - default=90, - description="""The timeout for the create dataset request in seconds. If not set, - the default timeout is 90 seconds.""", + connection_info: Optional[SandboxEnvironmentConnectionInfo] = Field( + default=None, + description="""Output only. The connection information of the SandboxEnvironment.""", + ) + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. The timestamp when this SandboxEnvironment was created.""", + ) + display_name: Optional[str] = Field( + default=None, + description="""Required. The display name of the SandboxEnvironment.""", + ) + name: Optional[str] = Field( + default=None, description="""Identifier. The name of the SandboxEnvironment.""" + ) + spec: Optional[SandboxEnvironmentSpec] = Field( + default=None, + description="""Optional. The configuration of the SandboxEnvironment.""", + ) + state: Optional[SandboxState] = Field( + default=None, + description="""Output only. The runtime state of the SandboxEnvironment.""", + ) + ttl: Optional[str] = Field( + default=None, + description="""Optional. Input only. The TTL for the sandbox environment. The expiration time is computed: now + TTL.""", + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. The timestamp when this SandboxEnvironment was most recently updated.""", + ) + latest_sandbox_environment_snapshot: Optional[str] = Field( + default=None, + description="""Output only. The resource name of the latest snapshot taken for this SandboxEnvironment.""", + ) + owner: Optional[str] = Field( + default=None, + description="""Optional. Owner information for this sandbox environment. A Sandbox can only be restored from a snapshot that belongs to the same owner. If not set, sandbox will be created as the default owner.""", + ) + sandbox_environment_snapshot: Optional[str] = Field( + default=None, + description="""Optional. The resource name of the SandboxEnvironmentSnapshot to use for creating this SandboxEnvironment. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""", + ) + sandbox_environment_template: Optional[str] = Field( + default=None, + description="""Optional. The name of the SandboxEnvironmentTemplate specified in the parent Agent Engine resource that this SandboxEnvironment is created from. Only one of `sandbox_environment_template` and `spec` should be set.""", ) -class CreateMultimodalDatasetConfigDict(TypedDict, total=False): - """Config for creating a dataset resource to store multimodal dataset.""" +class SandboxEnvironmentDict(TypedDict, total=False): + """A sandbox environment.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + expire_time: Optional[datetime.datetime] + """Expiration time of the sandbox environment. + """ - timeout: Optional[int] - """The timeout for the create dataset request in seconds. If not set, - the default timeout is 90 seconds.""" + connection_info: Optional[SandboxEnvironmentConnectionInfoDict] + """Output only. The connection information of the SandboxEnvironment.""" + create_time: Optional[datetime.datetime] + """Output only. The timestamp when this SandboxEnvironment was created.""" -CreateMultimodalDatasetConfigOrDict = Union[ - CreateMultimodalDatasetConfig, CreateMultimodalDatasetConfigDict -] + display_name: Optional[str] + """Required. The display name of the SandboxEnvironment.""" + name: Optional[str] + """Identifier. The name of the SandboxEnvironment.""" -class _CreateMultimodalDatasetParameters(_common.BaseModel): - """Parameters for creating a dataset resource to store multimodal dataset.""" + spec: Optional[SandboxEnvironmentSpecDict] + """Optional. The configuration of the SandboxEnvironment.""" - name: Optional[str] = Field(default=None, description="""""") - display_name: Optional[str] = Field(default=None, description="""""") - metadata_schema_uri: Optional[str] = Field(default=None, description="""""") - metadata: Optional[SchemaTablesDatasetMetadata] = Field( - default=None, description="""""" + state: Optional[SandboxState] + """Output only. The runtime state of the SandboxEnvironment.""" + + ttl: Optional[str] + """Optional. Input only. The TTL for the sandbox environment. The expiration time is computed: now + TTL.""" + + update_time: Optional[datetime.datetime] + """Output only. The timestamp when this SandboxEnvironment was most recently updated.""" + + latest_sandbox_environment_snapshot: Optional[str] + """Output only. The resource name of the latest snapshot taken for this SandboxEnvironment.""" + + owner: Optional[str] + """Optional. Owner information for this sandbox environment. A Sandbox can only be restored from a snapshot that belongs to the same owner. If not set, sandbox will be created as the default owner.""" + + sandbox_environment_snapshot: Optional[str] + """Optional. The resource name of the SandboxEnvironmentSnapshot to use for creating this SandboxEnvironment. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""" + + sandbox_environment_template: Optional[str] + """Optional. The name of the SandboxEnvironmentTemplate specified in the parent Agent Engine resource that this SandboxEnvironment is created from. Only one of `sandbox_environment_template` and `spec` should be set.""" + + +SandboxEnvironmentOrDict = Union[SandboxEnvironment, SandboxEnvironmentDict] + + +class AgentEngineSandboxOperation(_common.BaseModel): + """Operation that has an agent engine sandbox as a response.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", ) - description: Optional[str] = Field(default=None, description="""""") - encryption_spec: Optional[genai_types.EncryptionSpec] = Field( - default=None, description="""""" + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - config: Optional[CreateMultimodalDatasetConfig] = Field( - default=None, description="""""" + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[SandboxEnvironment] = Field( + default=None, description="""The Agent Engine Sandbox.""" ) -class _CreateMultimodalDatasetParametersDict(TypedDict, total=False): - """Parameters for creating a dataset resource to store multimodal dataset.""" +class AgentEngineSandboxOperationDict(TypedDict, total=False): + """Operation that has an agent engine sandbox as a response.""" name: Optional[str] - """""" - - display_name: Optional[str] - """""" - - metadata_schema_uri: 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}`.""" - metadata: Optional[SchemaTablesDatasetMetadataDict] - """""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - description: Optional[str] - """""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - encryption_spec: Optional[genai_types.EncryptionSpecDict] - """""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" - config: Optional[CreateMultimodalDatasetConfigDict] - """""" + response: Optional[SandboxEnvironmentDict] + """The Agent Engine Sandbox.""" -_CreateMultimodalDatasetParametersOrDict = Union[ - _CreateMultimodalDatasetParameters, _CreateMultimodalDatasetParametersDict +AgentEngineSandboxOperationOrDict = Union[ + AgentEngineSandboxOperation, AgentEngineSandboxOperationDict ] -class _DeleteMultimodalDatasetRequestParameters(_common.BaseModel): - """Parameters for deleting a multimodal dataset.""" +class DeleteAgentEngineSandboxConfig(_common.BaseModel): + """Config for deleting an Agent Engine Sandbox.""" - name: Optional[str] = Field( - default=None, description="""ID of the dataset to be deleted.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) - config: Optional[VertexBaseConfig] = Field(default=None, description="""""") - -class _DeleteMultimodalDatasetRequestParametersDict(TypedDict, total=False): - """Parameters for deleting a multimodal dataset.""" - name: Optional[str] - """ID of the dataset to be deleted.""" +class DeleteAgentEngineSandboxConfigDict(TypedDict, total=False): + """Config for deleting an Agent Engine Sandbox.""" - config: Optional[VertexBaseConfigDict] - """""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -_DeleteMultimodalDatasetRequestParametersOrDict = Union[ - _DeleteMultimodalDatasetRequestParameters, - _DeleteMultimodalDatasetRequestParametersDict, +DeleteAgentEngineSandboxConfigOrDict = Union[ + DeleteAgentEngineSandboxConfig, DeleteAgentEngineSandboxConfigDict ] -class _GetMultimodalDatasetParameters(_common.BaseModel): - """Parameters for getting a multimodal dataset resource.""" +class _DeleteAgentEngineSandboxRequestParameters(_common.BaseModel): + """Parameters for deleting agent engines.""" - name: Optional[str] = Field(default=None, description="""""") - config: Optional[VertexBaseConfig] = Field(default=None, description="""""") + name: Optional[str] = Field( + default=None, description="""Name of the agent engine sandbox to delete.""" + ) + config: Optional[DeleteAgentEngineSandboxConfig] = Field( + default=None, description="""""" + ) -class _GetMultimodalDatasetParametersDict(TypedDict, total=False): - """Parameters for getting a multimodal dataset resource.""" +class _DeleteAgentEngineSandboxRequestParametersDict(TypedDict, total=False): + """Parameters for deleting agent engines.""" name: Optional[str] - """""" + """Name of the agent engine sandbox to delete.""" - config: Optional[VertexBaseConfigDict] + config: Optional[DeleteAgentEngineSandboxConfigDict] """""" -_GetMultimodalDatasetParametersOrDict = Union[ - _GetMultimodalDatasetParameters, _GetMultimodalDatasetParametersDict +_DeleteAgentEngineSandboxRequestParametersOrDict = Union[ + _DeleteAgentEngineSandboxRequestParameters, + _DeleteAgentEngineSandboxRequestParametersDict, ] -class MultimodalDataset(_common.BaseModel): - """Represents a multimodal dataset.""" +class DeleteAgentEngineSandboxOperation(_common.BaseModel): + """Operation for deleting agent engines.""" name: Optional[str] = Field( - default=None, description="""The ID of the multimodal dataset.""" + default=None, + description="""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}`.""", ) - display_name: Optional[str] = Field( - default=None, description="""The display name of the multimodal dataset.""" + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - metadata: Optional[SchemaTablesDatasetMetadata] = Field( - default=None, description="""The metadata of the multimodal dataset.""" + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", ) - description: Optional[str] = Field( - default=None, description="""The description of the multimodal dataset.""" + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", ) - @property - def read_config(self) -> Optional[GeminiRequestReadConfig]: - """Gets the read config from the dataset metadata. Returns None if it's not set.""" - if self.metadata is None or self.metadata.gemini_request_read_config is None: - return None - return self.metadata.gemini_request_read_config - def set_read_config( - self, - *, - read_config: GeminiRequestReadConfigOrDict, - ) -> None: - """Sets the read config in the dataset metadata.""" - if isinstance(read_config, dict): - read_config = GeminiRequestReadConfig(**read_config) +class DeleteAgentEngineSandboxOperationDict(TypedDict, total=False): + """Operation for deleting agent engines.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + +DeleteAgentEngineSandboxOperationOrDict = Union[ + DeleteAgentEngineSandboxOperation, DeleteAgentEngineSandboxOperationDict +] + + +class Metadata(_common.BaseModel): + """Metadata for a chunk.""" + + attributes: Optional[dict[str, bytes]] = Field( + default=None, + description="""Optional. Attributes attached to the data. The keys have semantic conventions and the consumers of the attributes should know how to deserialize the value bytes based on the keys.""", + ) + + +class MetadataDict(TypedDict, total=False): + """Metadata for a chunk.""" + + attributes: Optional[dict[str, bytes]] + """Optional. Attributes attached to the data. The keys have semantic conventions and the consumers of the attributes should know how to deserialize the value bytes based on the keys.""" + + +MetadataOrDict = Union[Metadata, MetadataDict] + + +class Chunk(_common.BaseModel): + """A chunk of data.""" + + data: Optional[bytes] = Field( + default=None, description="""Required. The data in the chunk.""" + ) + metadata: Optional[Metadata] = Field( + default=None, + description="""Optional. Metadata that is associated with the data in the payload.""", + ) + mime_type: Optional[str] = Field( + default=None, + description="""Required. Mime type of the chunk data. See https://www.iana.org/assignments/media-types/media-types.xhtml for the full list.""", + ) + + +class ChunkDict(TypedDict, total=False): + """A chunk of data.""" + + data: Optional[bytes] + """Required. The data in the chunk.""" + + metadata: Optional[MetadataDict] + """Optional. Metadata that is associated with the data in the payload.""" + + mime_type: Optional[str] + """Required. Mime type of the chunk data. See https://www.iana.org/assignments/media-types/media-types.xhtml for the full list.""" + + +ChunkOrDict = Union[Chunk, ChunkDict] + + +class ExecuteCodeAgentEngineSandboxConfig(_common.BaseModel): + """Config for executing code in an Agent Engine sandbox.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class ExecuteCodeAgentEngineSandboxConfigDict(TypedDict, total=False): + """Config for executing code in an Agent Engine sandbox.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +ExecuteCodeAgentEngineSandboxConfigOrDict = Union[ + ExecuteCodeAgentEngineSandboxConfig, ExecuteCodeAgentEngineSandboxConfigDict +] + + +class _ExecuteCodeAgentEngineSandboxRequestParameters(_common.BaseModel): + """Parameters for executing code in an agent engine sandbox.""" + + name: Optional[str] = Field( + default=None, + description="""Name of the agent engine sandbox to execute code in.""", + ) + inputs: Optional[list[Chunk]] = Field( + default=None, description="""Inputs to the code execution.""" + ) + config: Optional[ExecuteCodeAgentEngineSandboxConfig] = Field( + default=None, description="""""" + ) + + +class _ExecuteCodeAgentEngineSandboxRequestParametersDict(TypedDict, total=False): + """Parameters for executing code in an agent engine sandbox.""" + + name: Optional[str] + """Name of the agent engine sandbox to execute code in.""" + + inputs: Optional[list[ChunkDict]] + """Inputs to the code execution.""" + + config: Optional[ExecuteCodeAgentEngineSandboxConfigDict] + """""" + + +_ExecuteCodeAgentEngineSandboxRequestParametersOrDict = Union[ + _ExecuteCodeAgentEngineSandboxRequestParameters, + _ExecuteCodeAgentEngineSandboxRequestParametersDict, +] + + +class ExecuteSandboxEnvironmentResponse(_common.BaseModel): + """The response for executing a sandbox environment.""" + + outputs: Optional[list[Chunk]] = Field( + default=None, description="""The outputs from the sandbox environment.""" + ) + + +class ExecuteSandboxEnvironmentResponseDict(TypedDict, total=False): + """The response for executing a sandbox environment.""" + + outputs: Optional[list[ChunkDict]] + """The outputs from the sandbox environment.""" + + +ExecuteSandboxEnvironmentResponseOrDict = Union[ + ExecuteSandboxEnvironmentResponse, ExecuteSandboxEnvironmentResponseDict +] + + +class GetAgentEngineSandboxConfig(_common.BaseModel): + """Config for getting an Agent Engine Memory.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class GetAgentEngineSandboxConfigDict(TypedDict, total=False): + """Config for getting an Agent Engine Memory.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +GetAgentEngineSandboxConfigOrDict = Union[ + GetAgentEngineSandboxConfig, GetAgentEngineSandboxConfigDict +] + + +class _GetAgentEngineSandboxRequestParameters(_common.BaseModel): + """Parameters for getting an agent engine sandbox.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine sandbox.""" + ) + config: Optional[GetAgentEngineSandboxConfig] = Field( + default=None, description="""""" + ) + + +class _GetAgentEngineSandboxRequestParametersDict(TypedDict, total=False): + """Parameters for getting an agent engine sandbox.""" + + name: Optional[str] + """Name of the agent engine sandbox.""" + + config: Optional[GetAgentEngineSandboxConfigDict] + """""" + + +_GetAgentEngineSandboxRequestParametersOrDict = Union[ + _GetAgentEngineSandboxRequestParameters, _GetAgentEngineSandboxRequestParametersDict +] + + +class ListAgentEngineSandboxesConfig(_common.BaseModel): + """Config for listing agent engine sandboxes.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""", + ) + + +class ListAgentEngineSandboxesConfigDict(TypedDict, total=False): + """Config for listing agent engine sandboxes.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + page_size: Optional[int] + """""" + + page_token: Optional[str] + """""" + + filter: Optional[str] + """An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""" + + +ListAgentEngineSandboxesConfigOrDict = Union[ + ListAgentEngineSandboxesConfig, ListAgentEngineSandboxesConfigDict +] + + +class _ListAgentEngineSandboxesRequestParameters(_common.BaseModel): + """Parameters for listing agent engine sandboxes.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine.""" + ) + config: Optional[ListAgentEngineSandboxesConfig] = Field( + default=None, description="""""" + ) + + +class _ListAgentEngineSandboxesRequestParametersDict(TypedDict, total=False): + """Parameters for listing agent engine sandboxes.""" + + name: Optional[str] + """Name of the agent engine.""" + + config: Optional[ListAgentEngineSandboxesConfigDict] + """""" + + +_ListAgentEngineSandboxesRequestParametersOrDict = Union[ + _ListAgentEngineSandboxesRequestParameters, + _ListAgentEngineSandboxesRequestParametersDict, +] + + +class ListAgentEngineSandboxesResponse(_common.BaseModel): + """Response for listing agent engine sandboxes.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + sandbox_environments: Optional[list[SandboxEnvironment]] = Field( + default=None, description="""List of agent engine sandboxes.""" + ) + + +class ListAgentEngineSandboxesResponseDict(TypedDict, total=False): + """Response for listing agent engine sandboxes.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """""" + + sandbox_environments: Optional[list[SandboxEnvironmentDict]] + """List of agent engine sandboxes.""" + + +ListAgentEngineSandboxesResponseOrDict = Union[ + ListAgentEngineSandboxesResponse, ListAgentEngineSandboxesResponseDict +] + + +class _GetAgentEngineSandboxOperationParameters(_common.BaseModel): + """Parameters for getting an operation with a sandbox as a response.""" + + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" + ) + config: Optional[GetAgentEngineOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" + ) + + +class _GetAgentEngineSandboxOperationParametersDict(TypedDict, total=False): + """Parameters for getting an operation with a sandbox as a response.""" + + operation_name: Optional[str] + """The server-assigned name for the operation.""" + + config: Optional[GetAgentEngineOperationConfigDict] + """Used to override the default configuration.""" + + +_GetAgentEngineSandboxOperationParametersOrDict = Union[ + _GetAgentEngineSandboxOperationParameters, + _GetAgentEngineSandboxOperationParametersDict, +] + + +class SandboxEnvironmentTemplateCustomContainerSpec(_common.BaseModel): + """Specification for deploying from a custom container image.""" + + image_uri: Optional[str] = Field( + default=None, + description="""Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to be run on each worker replica.""", + ) + + +class SandboxEnvironmentTemplateCustomContainerSpecDict(TypedDict, total=False): + """Specification for deploying from a custom container image.""" + + image_uri: Optional[str] + """Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to be run on each worker replica.""" + + +SandboxEnvironmentTemplateCustomContainerSpecOrDict = Union[ + SandboxEnvironmentTemplateCustomContainerSpec, + SandboxEnvironmentTemplateCustomContainerSpecDict, +] + + +class SandboxEnvironmentTemplateNetworkPort(_common.BaseModel): + """Represents a network port in a container.""" + + port: Optional[int] = Field( + default=None, + description="""Optional. Port number to expose. This must be a valid port number, between 1 and 65535.""", + ) + protocol: Optional[Protocol] = Field( + default=None, + description="""Optional. Protocol for port. Defaults to TCP if not specified.""", + ) + + +class SandboxEnvironmentTemplateNetworkPortDict(TypedDict, total=False): + """Represents a network port in a container.""" + + port: Optional[int] + """Optional. Port number to expose. This must be a valid port number, between 1 and 65535.""" + + protocol: Optional[Protocol] + """Optional. Protocol for port. Defaults to TCP if not specified.""" + + +SandboxEnvironmentTemplateNetworkPortOrDict = Union[ + SandboxEnvironmentTemplateNetworkPort, SandboxEnvironmentTemplateNetworkPortDict +] + + +class SandboxEnvironmentTemplateResourceRequirements(_common.BaseModel): + """Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.""" + + limits: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").""", + ) + requests: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").""", + ) + + +class SandboxEnvironmentTemplateResourceRequirementsDict(TypedDict, total=False): + """Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.""" + + limits: Optional[dict[str, str]] + """Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").""" + + requests: Optional[dict[str, str]] + """Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").""" + + +SandboxEnvironmentTemplateResourceRequirementsOrDict = Union[ + SandboxEnvironmentTemplateResourceRequirements, + SandboxEnvironmentTemplateResourceRequirementsDict, +] + + +class SandboxEnvironmentTemplateCustomContainerEnvironment(_common.BaseModel): + """The customized sandbox runtime environment for BYOC.""" + + custom_container_spec: Optional[SandboxEnvironmentTemplateCustomContainerSpec] = ( + Field( + default=None, + description="""The specification of the custom container environment.""", + ) + ) + ports: Optional[list[SandboxEnvironmentTemplateNetworkPort]] = Field( + default=None, description="""Ports to expose from the container.""" + ) + resources: Optional[SandboxEnvironmentTemplateResourceRequirements] = Field( + default=None, description="""Resource requests and limits for the container.""" + ) + + +class SandboxEnvironmentTemplateCustomContainerEnvironmentDict(TypedDict, total=False): + """The customized sandbox runtime environment for BYOC.""" + + custom_container_spec: Optional[SandboxEnvironmentTemplateCustomContainerSpecDict] + """The specification of the custom container environment.""" + + ports: Optional[list[SandboxEnvironmentTemplateNetworkPortDict]] + """Ports to expose from the container.""" + + resources: Optional[SandboxEnvironmentTemplateResourceRequirementsDict] + """Resource requests and limits for the container.""" + + +SandboxEnvironmentTemplateCustomContainerEnvironmentOrDict = Union[ + SandboxEnvironmentTemplateCustomContainerEnvironment, + SandboxEnvironmentTemplateCustomContainerEnvironmentDict, +] + + +class SandboxEnvironmentTemplateDefaultContainerEnvironment(_common.BaseModel): + """The default sandbox runtime environment for default container workloads.""" + + default_container_category: Optional[DefaultContainerCategory] = Field( + default=None, + description="""Required. The category of the default container image.""", + ) + + +class SandboxEnvironmentTemplateDefaultContainerEnvironmentDict(TypedDict, total=False): + """The default sandbox runtime environment for default container workloads.""" + + default_container_category: Optional[DefaultContainerCategory] + """Required. The category of the default container image.""" + + +SandboxEnvironmentTemplateDefaultContainerEnvironmentOrDict = Union[ + SandboxEnvironmentTemplateDefaultContainerEnvironment, + SandboxEnvironmentTemplateDefaultContainerEnvironmentDict, +] + + +class SandboxEnvironmentTemplateEgressControlConfig(_common.BaseModel): + """Configuration for egress control of sandbox instances.""" + + internet_access: Optional[bool] = Field( + default=None, description="""Optional. Whether to allow internet access.""" + ) + + +class SandboxEnvironmentTemplateEgressControlConfigDict(TypedDict, total=False): + """Configuration for egress control of sandbox instances.""" + + internet_access: Optional[bool] + """Optional. Whether to allow internet access.""" + + +SandboxEnvironmentTemplateEgressControlConfigOrDict = Union[ + SandboxEnvironmentTemplateEgressControlConfig, + SandboxEnvironmentTemplateEgressControlConfigDict, +] + + +class CreateSandboxEnvironmentTemplateConfig(_common.BaseModel): + """Config for creating a Sandbox Template.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Waits for the operation to complete before returning.""", + ) + custom_container_environment: Optional[ + SandboxEnvironmentTemplateCustomContainerEnvironment + ] = Field( + default=None, + description="""The custom container environment for the sandbox template.""", + ) + default_container_environment: Optional[ + SandboxEnvironmentTemplateDefaultContainerEnvironment + ] = Field( + default=None, + description="""The default container environment for the sandbox template.""", + ) + egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfig] = ( + Field( + default=None, + description="""The egress control config for the sandbox template.""", + ) + ) + + +class CreateSandboxEnvironmentTemplateConfigDict(TypedDict, total=False): + """Config for creating a Sandbox Template.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + wait_for_completion: Optional[bool] + """Waits for the operation to complete before returning.""" + + custom_container_environment: Optional[ + SandboxEnvironmentTemplateCustomContainerEnvironmentDict + ] + """The custom container environment for the sandbox template.""" + + default_container_environment: Optional[ + SandboxEnvironmentTemplateDefaultContainerEnvironmentDict + ] + """The default container environment for the sandbox template.""" + + egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfigDict] + """The egress control config for the sandbox template.""" + + +CreateSandboxEnvironmentTemplateConfigOrDict = Union[ + CreateSandboxEnvironmentTemplateConfig, CreateSandboxEnvironmentTemplateConfigDict +] + + +class _CreateSandboxEnvironmentTemplateRequestParameters(_common.BaseModel): + """Parameters for creating Sandbox Environment Templates.""" + + name: Optional[str] = Field( + default=None, + description="""Name of the agent engine to create the template under.""", + ) + config: Optional[CreateSandboxEnvironmentTemplateConfig] = Field( + default=None, description="""""" + ) + display_name: Optional[str] = Field( + default=None, description="""The display name of the sandbox template.""" + ) + + +class _CreateSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False): + """Parameters for creating Sandbox Environment Templates.""" + + name: Optional[str] + """Name of the agent engine to create the template under.""" + + config: Optional[CreateSandboxEnvironmentTemplateConfigDict] + """""" + + display_name: Optional[str] + """The display name of the sandbox template.""" + + +_CreateSandboxEnvironmentTemplateRequestParametersOrDict = Union[ + _CreateSandboxEnvironmentTemplateRequestParameters, + _CreateSandboxEnvironmentTemplateRequestParametersDict, +] + + +class SandboxEnvironmentTemplate(_common.BaseModel): + """A sandbox environment template.""" + + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. The timestamp when this SandboxEnvironmentTemplate was created.""", + ) + custom_container_environment: Optional[ + SandboxEnvironmentTemplateCustomContainerEnvironment + ] = Field( + default=None, + description="""The sandbox environment for custom container workloads.""", + ) + default_container_environment: Optional[ + SandboxEnvironmentTemplateDefaultContainerEnvironment + ] = Field( + default=None, + description="""The sandbox environment for default container workloads.""", + ) + display_name: Optional[str] = Field( + default=None, + description="""Required. The display name of the SandboxEnvironmentTemplate.""", + ) + egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfig] = ( + Field( + default=None, + description="""Optional. The configuration for egress control of this template.""", + ) + ) + name: Optional[str] = Field( + default=None, + description="""Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`""", + ) + state: Optional[ + Literal[ + "UNSPECIFIED", + "PROVISIONING", + "ACTIVE", + "DEPROVISIONING", + "DELETED", + "FAILED", + ] + ] = Field( + default=None, + description="""Output only. The state of the sandbox environment template.""", + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. The timestamp when this SandboxEnvironmentTemplate was most recently updated.""", + ) + + +class SandboxEnvironmentTemplateDict(TypedDict, total=False): + """A sandbox environment template.""" + + create_time: Optional[datetime.datetime] + """Output only. The timestamp when this SandboxEnvironmentTemplate was created.""" + + custom_container_environment: Optional[ + SandboxEnvironmentTemplateCustomContainerEnvironmentDict + ] + """The sandbox environment for custom container workloads.""" + + default_container_environment: Optional[ + SandboxEnvironmentTemplateDefaultContainerEnvironmentDict + ] + """The sandbox environment for default container workloads.""" + + display_name: Optional[str] + """Required. The display name of the SandboxEnvironmentTemplate.""" + + egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfigDict] + """Optional. The configuration for egress control of this template.""" + + name: Optional[str] + """Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`""" + + state: Optional[ + Literal[ + "UNSPECIFIED", + "PROVISIONING", + "ACTIVE", + "DEPROVISIONING", + "DELETED", + "FAILED", + ] + ] + """Output only. The state of the sandbox environment template.""" + + update_time: Optional[datetime.datetime] + """Output only. The timestamp when this SandboxEnvironmentTemplate was most recently updated.""" + + +SandboxEnvironmentTemplateOrDict = Union[ + SandboxEnvironmentTemplate, SandboxEnvironmentTemplateDict +] + + +class SandboxEnvironmentTemplateOperation(_common.BaseModel): + """Operation that has an agent engine sandbox as a response.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[SandboxEnvironmentTemplate] = Field( + default=None, description="""The Agent Engine Sandbox Template.""" + ) + + +class SandboxEnvironmentTemplateOperationDict(TypedDict, total=False): + """Operation that has an agent engine sandbox as a response.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + response: Optional[SandboxEnvironmentTemplateDict] + """The Agent Engine Sandbox Template.""" + + +SandboxEnvironmentTemplateOperationOrDict = Union[ + SandboxEnvironmentTemplateOperation, SandboxEnvironmentTemplateOperationDict +] + + +class DeleteSandboxEnvironmentTemplateConfig(_common.BaseModel): + """Config for deleting a Sandbox Template.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class DeleteSandboxEnvironmentTemplateConfigDict(TypedDict, total=False): + """Config for deleting a Sandbox Template.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +DeleteSandboxEnvironmentTemplateConfigOrDict = Union[ + DeleteSandboxEnvironmentTemplateConfig, DeleteSandboxEnvironmentTemplateConfigDict +] + + +class _DeleteSandboxEnvironmentTemplateRequestParameters(_common.BaseModel): + """Parameters for deleting sandbox templates.""" + + name: Optional[str] = Field( + default=None, description="""Name of the sandbox template to delete.""" + ) + config: Optional[DeleteSandboxEnvironmentTemplateConfig] = Field( + default=None, description="""""" + ) + + +class _DeleteSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False): + """Parameters for deleting sandbox templates.""" + + name: Optional[str] + """Name of the sandbox template to delete.""" + + config: Optional[DeleteSandboxEnvironmentTemplateConfigDict] + """""" + + +_DeleteSandboxEnvironmentTemplateRequestParametersOrDict = Union[ + _DeleteSandboxEnvironmentTemplateRequestParameters, + _DeleteSandboxEnvironmentTemplateRequestParametersDict, +] + + +class DeleteSandboxEnvironmentTemplateOperation(_common.BaseModel): + """Operation for deleting sandbox templates.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + + +class DeleteSandboxEnvironmentTemplateOperationDict(TypedDict, total=False): + """Operation for deleting sandbox templates.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + +DeleteSandboxEnvironmentTemplateOperationOrDict = Union[ + DeleteSandboxEnvironmentTemplateOperation, + DeleteSandboxEnvironmentTemplateOperationDict, +] + + +class GetSandboxEnvironmentTemplateConfig(_common.BaseModel): + """Config for getting a Sandbox Template.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class GetSandboxEnvironmentTemplateConfigDict(TypedDict, total=False): + """Config for getting a Sandbox Template.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +GetSandboxEnvironmentTemplateConfigOrDict = Union[ + GetSandboxEnvironmentTemplateConfig, GetSandboxEnvironmentTemplateConfigDict +] + + +class _GetSandboxEnvironmentTemplateRequestParameters(_common.BaseModel): + """Parameters for getting a sandbox template.""" + + name: Optional[str] = Field( + default=None, description="""Name of the sandbox template.""" + ) + config: Optional[GetSandboxEnvironmentTemplateConfig] = Field( + default=None, description="""""" + ) + + +class _GetSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False): + """Parameters for getting a sandbox template.""" + + name: Optional[str] + """Name of the sandbox template.""" + + config: Optional[GetSandboxEnvironmentTemplateConfigDict] + """""" + + +_GetSandboxEnvironmentTemplateRequestParametersOrDict = Union[ + _GetSandboxEnvironmentTemplateRequestParameters, + _GetSandboxEnvironmentTemplateRequestParametersDict, +] + + +class ListSandboxEnvironmentTemplatesConfig(_common.BaseModel): + """Config for listing sandbox templates.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request.""", + ) + + +class ListSandboxEnvironmentTemplatesConfigDict(TypedDict, total=False): + """Config for listing sandbox templates.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + page_size: Optional[int] + """""" + + page_token: Optional[str] + """""" + + filter: Optional[str] + """An expression for filtering the results of the request.""" + + +ListSandboxEnvironmentTemplatesConfigOrDict = Union[ + ListSandboxEnvironmentTemplatesConfig, ListSandboxEnvironmentTemplatesConfigDict +] + + +class _ListSandboxEnvironmentTemplatesRequestParameters(_common.BaseModel): + """Parameters for listing sandbox templates.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine.""" + ) + config: Optional[ListSandboxEnvironmentTemplatesConfig] = Field( + default=None, description="""""" + ) + + +class _ListSandboxEnvironmentTemplatesRequestParametersDict(TypedDict, total=False): + """Parameters for listing sandbox templates.""" + + name: Optional[str] + """Name of the agent engine.""" + + config: Optional[ListSandboxEnvironmentTemplatesConfigDict] + """""" + + +_ListSandboxEnvironmentTemplatesRequestParametersOrDict = Union[ + _ListSandboxEnvironmentTemplatesRequestParameters, + _ListSandboxEnvironmentTemplatesRequestParametersDict, +] + + +class ListSandboxEnvironmentTemplatesResponse(_common.BaseModel): + """Response for listing sandbox templates.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + sandbox_environment_templates: Optional[list[SandboxEnvironmentTemplate]] = Field( + default=None, description="""List of sandbox templates.""" + ) + + +class ListSandboxEnvironmentTemplatesResponseDict(TypedDict, total=False): + """Response for listing sandbox templates.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """""" + + sandbox_environment_templates: Optional[list[SandboxEnvironmentTemplateDict]] + """List of sandbox templates.""" + + +ListSandboxEnvironmentTemplatesResponseOrDict = Union[ + ListSandboxEnvironmentTemplatesResponse, ListSandboxEnvironmentTemplatesResponseDict +] + + +class _GetSandboxEnvironmentTemplateOperationParameters(_common.BaseModel): + """Parameters for getting an operation with a sandbox template as a response.""" + + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" + ) + config: Optional[GetAgentEngineOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" + ) + + +class _GetSandboxEnvironmentTemplateOperationParametersDict(TypedDict, total=False): + """Parameters for getting an operation with a sandbox template as a response.""" + + operation_name: Optional[str] + """The server-assigned name for the operation.""" + + config: Optional[GetAgentEngineOperationConfigDict] + """Used to override the default configuration.""" + + +_GetSandboxEnvironmentTemplateOperationParametersOrDict = Union[ + _GetSandboxEnvironmentTemplateOperationParameters, + _GetSandboxEnvironmentTemplateOperationParametersDict, +] + + +class CreateAgentEngineSandboxSnapshotConfig(_common.BaseModel): + """Config for creating a Sandbox Environment Snapshot.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + display_name: Optional[str] = Field( + default=None, description="""The display name of the sandbox snapshot.""" + ) + owner: Optional[str] = Field( + default=None, description="""The owner of the sandbox snapshot.""" + ) + ttl: Optional[str] = Field( + default=None, + description="""The TTL for this resource. The expiration time is computed: now + TTL.""", + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Waits for the operation to complete before returning.""", + ) + + +class CreateAgentEngineSandboxSnapshotConfigDict(TypedDict, total=False): + """Config for creating a Sandbox Environment Snapshot.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + display_name: Optional[str] + """The display name of the sandbox snapshot.""" + + owner: Optional[str] + """The owner of the sandbox snapshot.""" + + ttl: Optional[str] + """The TTL for this resource. The expiration time is computed: now + TTL.""" + + wait_for_completion: Optional[bool] + """Waits for the operation to complete before returning.""" + + +CreateAgentEngineSandboxSnapshotConfigOrDict = Union[ + CreateAgentEngineSandboxSnapshotConfig, CreateAgentEngineSandboxSnapshotConfigDict +] + + +class _CreateSandboxEnvironmentSnapshotRequestParameters(_common.BaseModel): + """Parameters for creating a sandbox environment snapshot.""" + + source_sandbox_environment_name: Optional[str] = Field( + default=None, description="""Name of the sandbox environment to snapshot.""" + ) + config: Optional[CreateAgentEngineSandboxSnapshotConfig] = Field( + default=None, description="""""" + ) + + +class _CreateSandboxEnvironmentSnapshotRequestParametersDict(TypedDict, total=False): + """Parameters for creating a sandbox environment snapshot.""" + + source_sandbox_environment_name: Optional[str] + """Name of the sandbox environment to snapshot.""" + + config: Optional[CreateAgentEngineSandboxSnapshotConfigDict] + """""" + + +_CreateSandboxEnvironmentSnapshotRequestParametersOrDict = Union[ + _CreateSandboxEnvironmentSnapshotRequestParameters, + _CreateSandboxEnvironmentSnapshotRequestParametersDict, +] + + +class SandboxEnvironmentSnapshot(_common.BaseModel): + """A sandbox environment snapshot.""" + + display_name: Optional[str] = Field( + default=None, + description="""The display name of the sandbox environment snapshot.""", + ) + expire_time: Optional[datetime.datetime] = Field( + default=None, + description="""Expiration time of the sandbox environment snapshot. + """, + ) + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. The timestamp when this SandboxEnvironmentSnapshot was created.""", + ) + name: Optional[str] = Field( + default=None, + description="""Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""", + ) + owner: Optional[str] = Field( + default=None, + description="""Optional. Owner information for this sandbox snapshot. Different owners will have isolations on snapshot storage and identity. If not set, snapshot will be created as the default owner.""", + ) + parent_snapshot: Optional[str] = Field( + default=None, + description="""Output only. The resource name of the parent SandboxEnvironmentSnapshot. Empty if this is a root Snapshot (the first snapshot from a newly created sandbox). Can be used to reconstruct the whole ancestry tree of snapshots.""", + ) + post_snapshot_action: Optional[PostSnapshotAction] = Field( + default=None, + description="""Optional. Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource.""", + ) + size_bytes: Optional[int] = Field( + default=None, + description="""Optional. Output only. Size of the snapshot data in bytes.""", + ) + source_sandbox_environment: Optional[str] = Field( + default=None, + description="""Required. The resource name of the source SandboxEnvironment this snapshot was taken from.""", + ) + ttl: Optional[str] = Field( + default=None, + description="""Optional. Input only. The TTL for the sandbox environment snapshot. The expiration time is computed: now + TTL.""", + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. The timestamp when this SandboxEnvironment was most recently updated.""", + ) + + +class SandboxEnvironmentSnapshotDict(TypedDict, total=False): + """A sandbox environment snapshot.""" + + display_name: Optional[str] + """The display name of the sandbox environment snapshot.""" + + expire_time: Optional[datetime.datetime] + """Expiration time of the sandbox environment snapshot. + """ + + create_time: Optional[datetime.datetime] + """Output only. The timestamp when this SandboxEnvironmentSnapshot was created.""" + + name: Optional[str] + """Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`""" + + owner: Optional[str] + """Optional. Owner information for this sandbox snapshot. Different owners will have isolations on snapshot storage and identity. If not set, snapshot will be created as the default owner.""" + + parent_snapshot: Optional[str] + """Output only. The resource name of the parent SandboxEnvironmentSnapshot. Empty if this is a root Snapshot (the first snapshot from a newly created sandbox). Can be used to reconstruct the whole ancestry tree of snapshots.""" + + post_snapshot_action: Optional[PostSnapshotAction] + """Optional. Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource.""" + + size_bytes: Optional[int] + """Optional. Output only. Size of the snapshot data in bytes.""" + + source_sandbox_environment: Optional[str] + """Required. The resource name of the source SandboxEnvironment this snapshot was taken from.""" + + ttl: Optional[str] + """Optional. Input only. The TTL for the sandbox environment snapshot. The expiration time is computed: now + TTL.""" + + update_time: Optional[datetime.datetime] + """Output only. The timestamp when this SandboxEnvironment was most recently updated.""" + + +SandboxEnvironmentSnapshotOrDict = Union[ + SandboxEnvironmentSnapshot, SandboxEnvironmentSnapshotDict +] + + +class AgentEngineSandboxSnapshotOperation(_common.BaseModel): + """Operation that has an agent engine sandbox snapshot as a response.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[SandboxEnvironmentSnapshot] = Field( + default=None, description="""The Agent Engine Sandbox Snapshot.""" + ) + + +class AgentEngineSandboxSnapshotOperationDict(TypedDict, total=False): + """Operation that has an agent engine sandbox snapshot as a response.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + response: Optional[SandboxEnvironmentSnapshotDict] + """The Agent Engine Sandbox Snapshot.""" + + +AgentEngineSandboxSnapshotOperationOrDict = Union[ + AgentEngineSandboxSnapshotOperation, AgentEngineSandboxSnapshotOperationDict +] + + +class DeleteSandboxEnvironmentSnapshotConfig(_common.BaseModel): + """Config for deleting a Sandbox Environment Snapshot.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class DeleteSandboxEnvironmentSnapshotConfigDict(TypedDict, total=False): + """Config for deleting a Sandbox Environment Snapshot.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +DeleteSandboxEnvironmentSnapshotConfigOrDict = Union[ + DeleteSandboxEnvironmentSnapshotConfig, DeleteSandboxEnvironmentSnapshotConfigDict +] + + +class _DeleteSandboxEnvironmentSnapshotRequestParameters(_common.BaseModel): + """Parameters for deleting sandbox environment snapshots.""" + + name: Optional[str] = Field( + default=None, + description="""Name of the sandbox environment snapshot to delete.""", + ) + config: Optional[DeleteSandboxEnvironmentSnapshotConfig] = Field( + default=None, description="""""" + ) + + +class _DeleteSandboxEnvironmentSnapshotRequestParametersDict(TypedDict, total=False): + """Parameters for deleting sandbox environment snapshots.""" + + name: Optional[str] + """Name of the sandbox environment snapshot to delete.""" + + config: Optional[DeleteSandboxEnvironmentSnapshotConfigDict] + """""" + + +_DeleteSandboxEnvironmentSnapshotRequestParametersOrDict = Union[ + _DeleteSandboxEnvironmentSnapshotRequestParameters, + _DeleteSandboxEnvironmentSnapshotRequestParametersDict, +] + + +class DeleteSandboxEnvironmentSnapshotOperation(_common.BaseModel): + """Operation for deleting sandbox environment snapshots.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + + +class DeleteSandboxEnvironmentSnapshotOperationDict(TypedDict, total=False): + """Operation for deleting sandbox environment snapshots.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + +DeleteSandboxEnvironmentSnapshotOperationOrDict = Union[ + DeleteSandboxEnvironmentSnapshotOperation, + DeleteSandboxEnvironmentSnapshotOperationDict, +] + + +class GetSandboxEnvironmentSnapshotConfig(_common.BaseModel): + """Config for getting a Sandbox Environment Snapshot.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class GetSandboxEnvironmentSnapshotConfigDict(TypedDict, total=False): + """Config for getting a Sandbox Environment Snapshot.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +GetSandboxEnvironmentSnapshotConfigOrDict = Union[ + GetSandboxEnvironmentSnapshotConfig, GetSandboxEnvironmentSnapshotConfigDict +] + + +class _GetSandboxEnvironmentSnapshotRequestParameters(_common.BaseModel): + """Parameters for getting a sandbox environment snapshot.""" + + name: Optional[str] = Field( + default=None, description="""Name of the sandbox environment snapshot.""" + ) + config: Optional[GetSandboxEnvironmentSnapshotConfig] = Field( + default=None, description="""""" + ) + + +class _GetSandboxEnvironmentSnapshotRequestParametersDict(TypedDict, total=False): + """Parameters for getting a sandbox environment snapshot.""" + + name: Optional[str] + """Name of the sandbox environment snapshot.""" + + config: Optional[GetSandboxEnvironmentSnapshotConfigDict] + """""" + + +_GetSandboxEnvironmentSnapshotRequestParametersOrDict = Union[ + _GetSandboxEnvironmentSnapshotRequestParameters, + _GetSandboxEnvironmentSnapshotRequestParametersDict, +] + + +class ListSandboxEnvironmentSnapshotsConfig(_common.BaseModel): + """Config for listing sandbox environment snapshots.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request.""", + ) + + +class ListSandboxEnvironmentSnapshotsConfigDict(TypedDict, total=False): + """Config for listing sandbox environment snapshots.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + page_size: Optional[int] + """""" + + page_token: Optional[str] + """""" + + filter: Optional[str] + """An expression for filtering the results of the request.""" + + +ListSandboxEnvironmentSnapshotsConfigOrDict = Union[ + ListSandboxEnvironmentSnapshotsConfig, ListSandboxEnvironmentSnapshotsConfigDict +] + + +class _ListSandboxEnvironmentSnapshotsRequestParameters(_common.BaseModel): + """Parameters for listing sandbox environment snapshots.""" + + name: Optional[str] = Field( + default=None, + description="""Name of the reasoning engine to list snapshots from.""", + ) + config: Optional[ListSandboxEnvironmentSnapshotsConfig] = Field( + default=None, description="""""" + ) + + +class _ListSandboxEnvironmentSnapshotsRequestParametersDict(TypedDict, total=False): + """Parameters for listing sandbox environment snapshots.""" + + name: Optional[str] + """Name of the reasoning engine to list snapshots from.""" + + config: Optional[ListSandboxEnvironmentSnapshotsConfigDict] + """""" + + +_ListSandboxEnvironmentSnapshotsRequestParametersOrDict = Union[ + _ListSandboxEnvironmentSnapshotsRequestParameters, + _ListSandboxEnvironmentSnapshotsRequestParametersDict, +] + + +class ListSandboxEnvironmentSnapshotsResponse(_common.BaseModel): + """Response for listing sandbox environment snapshots.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + sandbox_environment_snapshots: Optional[list[SandboxEnvironmentSnapshot]] = Field( + default=None, description="""List of sandbox environment snapshots.""" + ) + + +class ListSandboxEnvironmentSnapshotsResponseDict(TypedDict, total=False): + """Response for listing sandbox environment snapshots.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """""" + + sandbox_environment_snapshots: Optional[list[SandboxEnvironmentSnapshotDict]] + """List of sandbox environment snapshots.""" + + +ListSandboxEnvironmentSnapshotsResponseOrDict = Union[ + ListSandboxEnvironmentSnapshotsResponse, ListSandboxEnvironmentSnapshotsResponseDict +] + + +class _GetAgentEngineSandboxSnapshotOperationParameters(_common.BaseModel): + """Parameters for getting an operation with a sandbox snapshot as a response.""" + + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" + ) + config: Optional[GetAgentEngineOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" + ) + + +class _GetAgentEngineSandboxSnapshotOperationParametersDict(TypedDict, total=False): + """Parameters for getting an operation with a sandbox snapshot as a response.""" + + operation_name: Optional[str] + """The server-assigned name for the operation.""" + + config: Optional[GetAgentEngineOperationConfigDict] + """Used to override the default configuration.""" + + +_GetAgentEngineSandboxSnapshotOperationParametersOrDict = Union[ + _GetAgentEngineSandboxSnapshotOperationParameters, + _GetAgentEngineSandboxSnapshotOperationParametersDict, +] + + +class CreateAgentEngineSessionConfig(_common.BaseModel): + """Config for creating a Session.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + display_name: Optional[str] = Field( + default=None, description="""The display name of the session.""" + ) + session_state: Optional[dict[str, Any]] = Field( + default=None, + description="""Session state which stores key conversation points.""", + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Waits for the operation to complete before returning.""", + ) + ttl: Optional[str] = Field( + default=None, + description="""Optional. Input only. The TTL for this resource. + + The expiration time is computed: now + TTL.""", + ) + expire_time: Optional[datetime.datetime] = Field( + default=None, + description="""Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""", + ) + labels: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""", + ) + session_id: Optional[str] = Field( + default=None, + description="""Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""", + ) + + +class CreateAgentEngineSessionConfigDict(TypedDict, total=False): + """Config for creating a Session.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + display_name: Optional[str] + """The display name of the session.""" + + session_state: Optional[dict[str, Any]] + """Session state which stores key conversation points.""" + + wait_for_completion: Optional[bool] + """Waits for the operation to complete before returning.""" + + ttl: Optional[str] + """Optional. Input only. The TTL for this resource. + + The expiration time is computed: now + TTL.""" + + expire_time: Optional[datetime.datetime] + """Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""" + + labels: Optional[dict[str, str]] + """Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""" + + session_id: Optional[str] + """Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""" + + +CreateAgentEngineSessionConfigOrDict = Union[ + CreateAgentEngineSessionConfig, CreateAgentEngineSessionConfigDict +] + + +class _CreateAgentEngineSessionRequestParameters(_common.BaseModel): + """Parameters for creating Agent Engine Sessions.""" + + name: Optional[str] = Field( + default=None, + description="""Name of the agent engine to create the session under.""", + ) + user_id: Optional[str] = Field( + default=None, description="""The user ID of the session.""" + ) + config: Optional[CreateAgentEngineSessionConfig] = Field( + default=None, description="""""" + ) + + +class _CreateAgentEngineSessionRequestParametersDict(TypedDict, total=False): + """Parameters for creating Agent Engine Sessions.""" + + name: Optional[str] + """Name of the agent engine to create the session under.""" + + user_id: Optional[str] + """The user ID of the session.""" + + config: Optional[CreateAgentEngineSessionConfigDict] + """""" + + +_CreateAgentEngineSessionRequestParametersOrDict = Union[ + _CreateAgentEngineSessionRequestParameters, + _CreateAgentEngineSessionRequestParametersDict, +] + + +class Session(_common.BaseModel): + """A session.""" + + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when the session was created.""", + ) + display_name: Optional[str] = Field( + default=None, description="""Optional. The display name of the session.""" + ) + expire_time: Optional[datetime.datetime] = Field( + default=None, + description="""Optional. Timestamp of when this session is considered expired. This is *always* provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation.""", + ) + labels: Optional[dict[str, str]] = Field( + default=None, + description="""The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""", + ) + name: Optional[str] = Field( + default=None, + description="""Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.""", + ) + session_state: Optional[dict[str, Any]] = Field( + default=None, + description="""Optional. Session specific memory which stores key conversation points.""", + ) + ttl: Optional[str] = Field( + default=None, + description="""Optional. Input only. The TTL for this session. The minimum value is 24 hours.""", + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when the session was updated.""", + ) + user_id: Optional[str] = Field( + default=None, + description="""Required. Immutable. String id provided by the user""", + ) + + +class SessionDict(TypedDict, total=False): + """A session.""" + + create_time: Optional[datetime.datetime] + """Output only. Timestamp when the session was created.""" + + display_name: Optional[str] + """Optional. The display name of the session.""" + + expire_time: Optional[datetime.datetime] + """Optional. Timestamp of when this session is considered expired. This is *always* provided on output, regardless of what was sent on input. The minimum value is 24 hours from the time of creation.""" + + labels: Optional[dict[str, str]] + """The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""" + + name: Optional[str] + """Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.""" + + session_state: Optional[dict[str, Any]] + """Optional. Session specific memory which stores key conversation points.""" + + ttl: Optional[str] + """Optional. Input only. The TTL for this session. The minimum value is 24 hours.""" + + update_time: Optional[datetime.datetime] + """Output only. Timestamp when the session was updated.""" + + user_id: Optional[str] + """Required. Immutable. String id provided by the user""" + + +SessionOrDict = Union[Session, SessionDict] + + +class AgentEngineSessionOperation(_common.BaseModel): + """Operation that has an agent engine session as a response.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[Session] = Field( + default=None, description="""The Agent Engine Session.""" + ) + + +class AgentEngineSessionOperationDict(TypedDict, total=False): + """Operation that has an agent engine session as a response.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + response: Optional[SessionDict] + """The Agent Engine Session.""" + + +AgentEngineSessionOperationOrDict = Union[ + AgentEngineSessionOperation, AgentEngineSessionOperationDict +] + + +class DeleteAgentEngineSessionConfig(_common.BaseModel): + """Config for deleting an Agent Engine Session.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class DeleteAgentEngineSessionConfigDict(TypedDict, total=False): + """Config for deleting an Agent Engine Session.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +DeleteAgentEngineSessionConfigOrDict = Union[ + DeleteAgentEngineSessionConfig, DeleteAgentEngineSessionConfigDict +] + + +class _DeleteAgentEngineSessionRequestParameters(_common.BaseModel): + """Parameters for deleting agent engine sessions.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine session to delete.""" + ) + config: Optional[DeleteAgentEngineSessionConfig] = Field( + default=None, description="""""" + ) + + +class _DeleteAgentEngineSessionRequestParametersDict(TypedDict, total=False): + """Parameters for deleting agent engine sessions.""" + + name: Optional[str] + """Name of the agent engine session to delete.""" + + config: Optional[DeleteAgentEngineSessionConfigDict] + """""" + + +_DeleteAgentEngineSessionRequestParametersOrDict = Union[ + _DeleteAgentEngineSessionRequestParameters, + _DeleteAgentEngineSessionRequestParametersDict, +] + + +class DeleteAgentEngineSessionOperation(_common.BaseModel): + """Operation for deleting agent engine sessions.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + + +class DeleteAgentEngineSessionOperationDict(TypedDict, total=False): + """Operation for deleting agent engine sessions.""" + + 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + +DeleteAgentEngineSessionOperationOrDict = Union[ + DeleteAgentEngineSessionOperation, DeleteAgentEngineSessionOperationDict +] + + +class GetAgentEngineSessionConfig(_common.BaseModel): + """Config for getting an Agent Engine Session.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class GetAgentEngineSessionConfigDict(TypedDict, total=False): + """Config for getting an Agent Engine Session.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +GetAgentEngineSessionConfigOrDict = Union[ + GetAgentEngineSessionConfig, GetAgentEngineSessionConfigDict +] + + +class _GetAgentEngineSessionRequestParameters(_common.BaseModel): + """Parameters for getting an agent engine session.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine session.""" + ) + config: Optional[GetAgentEngineSessionConfig] = Field( + default=None, description="""""" + ) + + +class _GetAgentEngineSessionRequestParametersDict(TypedDict, total=False): + """Parameters for getting an agent engine session.""" + + name: Optional[str] + """Name of the agent engine session.""" + + config: Optional[GetAgentEngineSessionConfigDict] + """""" + + +_GetAgentEngineSessionRequestParametersOrDict = Union[ + _GetAgentEngineSessionRequestParameters, _GetAgentEngineSessionRequestParametersDict +] + + +class ListAgentEngineSessionsConfig(_common.BaseModel): + """Config for listing agent engine sessions.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""", + ) + + +class ListAgentEngineSessionsConfigDict(TypedDict, total=False): + """Config for listing agent engine sessions.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + page_size: Optional[int] + """""" + + page_token: Optional[str] + """""" + + filter: Optional[str] + """An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""" + + +ListAgentEngineSessionsConfigOrDict = Union[ + ListAgentEngineSessionsConfig, ListAgentEngineSessionsConfigDict +] + + +class _ListAgentEngineSessionsRequestParameters(_common.BaseModel): + """Parameters for listing agent engines.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine.""" + ) + config: Optional[ListAgentEngineSessionsConfig] = Field( + default=None, description="""""" + ) + + +class _ListAgentEngineSessionsRequestParametersDict(TypedDict, total=False): + """Parameters for listing agent engines.""" + + name: Optional[str] + """Name of the agent engine.""" + + config: Optional[ListAgentEngineSessionsConfigDict] + """""" + + +_ListAgentEngineSessionsRequestParametersOrDict = Union[ + _ListAgentEngineSessionsRequestParameters, + _ListAgentEngineSessionsRequestParametersDict, +] + + +class ListReasoningEnginesSessionsResponse(_common.BaseModel): + """Response for listing agent engine sessions.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + sessions: Optional[list[Session]] = Field( + default=None, description="""List of agent engine sessions.""" + ) + + +class ListReasoningEnginesSessionsResponseDict(TypedDict, total=False): + """Response for listing agent engine sessions.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """""" + + sessions: Optional[list[SessionDict]] + """List of agent engine sessions.""" + + +ListReasoningEnginesSessionsResponseOrDict = Union[ + ListReasoningEnginesSessionsResponse, ListReasoningEnginesSessionsResponseDict +] + + +class _GetAgentEngineSessionOperationParameters(_common.BaseModel): + """Parameters for getting an operation with a session as a response.""" + + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" + ) + config: Optional[GetAgentEngineOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" + ) + + +class _GetAgentEngineSessionOperationParametersDict(TypedDict, total=False): + """Parameters for getting an operation with a session as a response.""" + + operation_name: Optional[str] + """The server-assigned name for the operation.""" + + config: Optional[GetAgentEngineOperationConfigDict] + """Used to override the default configuration.""" + + +_GetAgentEngineSessionOperationParametersOrDict = Union[ + _GetAgentEngineSessionOperationParameters, + _GetAgentEngineSessionOperationParametersDict, +] + + +class UpdateAgentEngineSessionConfig(_common.BaseModel): + """Config for updating agent engine session.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + display_name: Optional[str] = Field( + default=None, description="""The display name of the session.""" + ) + session_state: Optional[dict[str, Any]] = Field( + default=None, + description="""Session state which stores key conversation points.""", + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Waits for the operation to complete before returning.""", + ) + ttl: Optional[str] = Field( + default=None, + description="""Optional. Input only. The TTL for this resource. + + The expiration time is computed: now + TTL.""", + ) + expire_time: Optional[datetime.datetime] = Field( + default=None, + description="""Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""", + ) + labels: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""", + ) + session_id: Optional[str] = Field( + default=None, + description="""Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""", + ) + update_mask: Optional[str] = Field( + default=None, + description="""The update mask to apply. For the `FieldMask` definition, see + https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.""", + ) + user_id: Optional[str] = Field( + default=None, description="""User ID of the agent engine session to update.""" + ) + + +class UpdateAgentEngineSessionConfigDict(TypedDict, total=False): + """Config for updating agent engine session.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + display_name: Optional[str] + """The display name of the session.""" + + session_state: Optional[dict[str, Any]] + """Session state which stores key conversation points.""" + + wait_for_completion: Optional[bool] + """Waits for the operation to complete before returning.""" + + ttl: Optional[str] + """Optional. Input only. The TTL for this resource. + + The expiration time is computed: now + TTL.""" + + expire_time: Optional[datetime.datetime] + """Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input.""" + + labels: Optional[dict[str, str]] + """Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""" + + session_id: Optional[str] + """Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""" + + update_mask: Optional[str] + """The update mask to apply. For the `FieldMask` definition, see + https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.""" + + user_id: Optional[str] + """User ID of the agent engine session to update.""" + + +UpdateAgentEngineSessionConfigOrDict = Union[ + UpdateAgentEngineSessionConfig, UpdateAgentEngineSessionConfigDict +] + + +class _UpdateAgentEngineSessionRequestParameters(_common.BaseModel): + """Parameters for updating agent engine sessions.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine session to update.""" + ) + config: Optional[UpdateAgentEngineSessionConfig] = Field( + default=None, description="""""" + ) + + +class _UpdateAgentEngineSessionRequestParametersDict(TypedDict, total=False): + """Parameters for updating agent engine sessions.""" + + name: Optional[str] + """Name of the agent engine session to update.""" + + config: Optional[UpdateAgentEngineSessionConfigDict] + """""" + + +_UpdateAgentEngineSessionRequestParametersOrDict = Union[ + _UpdateAgentEngineSessionRequestParameters, + _UpdateAgentEngineSessionRequestParametersDict, +] + + +class EventActions(_common.BaseModel): + """Actions are parts of events that are executed by the agent.""" + + artifact_delta: Optional[dict[str, int]] = Field( + default=None, + description="""Optional. Indicates that the event is updating an artifact. key is the filename, value is the version.""", + ) + escalate: Optional[bool] = Field( + default=None, + description="""Optional. The agent is escalating to a higher level agent.""", + ) + requested_auth_configs: Optional[dict[str, Any]] = Field( + default=None, + description="""Optional. Will only be set by a tool response indicating tool request euc. Struct key is the function call id since one function call response (from model) could correspond to multiple function calls. Struct value is the required auth config, which can be another struct.""", + ) + skip_summarization: Optional[bool] = Field( + default=None, + description="""Optional. If true, it won't call model to summarize function response. Only used for function_response event.""", + ) + state_delta: Optional[dict[str, Any]] = Field( + default=None, + description="""Optional. Indicates that the event is updating the state with the given delta.""", + ) + transfer_agent: Optional[str] = Field( + default=None, + description="""Optional. If set, the event transfers to the specified agent.""", + ) + + +class EventActionsDict(TypedDict, total=False): + """Actions are parts of events that are executed by the agent.""" + + artifact_delta: Optional[dict[str, int]] + """Optional. Indicates that the event is updating an artifact. key is the filename, value is the version.""" + + escalate: Optional[bool] + """Optional. The agent is escalating to a higher level agent.""" + + requested_auth_configs: Optional[dict[str, Any]] + """Optional. Will only be set by a tool response indicating tool request euc. Struct key is the function call id since one function call response (from model) could correspond to multiple function calls. Struct value is the required auth config, which can be another struct.""" + + skip_summarization: Optional[bool] + """Optional. If true, it won't call model to summarize function response. Only used for function_response event.""" + + state_delta: Optional[dict[str, Any]] + """Optional. Indicates that the event is updating the state with the given delta.""" + + transfer_agent: Optional[str] + """Optional. If set, the event transfers to the specified agent.""" + + +EventActionsOrDict = Union[EventActions, EventActionsDict] + + +class EventMetadata(_common.BaseModel): + """Metadata relating to a LLM response event.""" + + grounding_metadata: Optional[genai_types.GroundingMetadata] = Field( + default=None, + description="""Optional. Metadata returned to client when grounding is enabled.""", + ) + branch: Optional[str] = Field( + default=None, + description="""Optional. The branch of the event. The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple child agents shouldn't see their siblings' conversation history.""", + ) + custom_metadata: Optional[dict[str, Any]] = Field( + default=None, description="""The custom metadata of the LlmResponse.""" + ) + interrupted: Optional[bool] = Field( + default=None, + description="""Optional. Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.""", + ) + long_running_tool_ids: Optional[list[str]] = Field( + default=None, + description="""Optional. Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. Only valid for function call event.""", + ) + partial: Optional[bool] = Field( + default=None, + description="""Optional. Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.""", + ) + turn_complete: Optional[bool] = Field( + default=None, + description="""Optional. Indicates whether the response from the model is complete. Only used for streaming mode.""", + ) + input_transcription: Optional[genai_types.Transcription] = Field( + default=None, description="""Optional. Audio transcription of user input.""" + ) + output_transcription: Optional[genai_types.Transcription] = Field( + default=None, description="""Optional. Audio transcription of model output.""" + ) + + +class EventMetadataDict(TypedDict, total=False): + """Metadata relating to a LLM response event.""" + + grounding_metadata: Optional[genai_types.GroundingMetadataDict] + """Optional. Metadata returned to client when grounding is enabled.""" + + branch: Optional[str] + """Optional. The branch of the event. The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple child agents shouldn't see their siblings' conversation history.""" + + custom_metadata: Optional[dict[str, Any]] + """The custom metadata of the LlmResponse.""" + + interrupted: Optional[bool] + """Optional. Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.""" + + long_running_tool_ids: Optional[list[str]] + """Optional. Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. Only valid for function call event.""" + + partial: Optional[bool] + """Optional. Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.""" + + turn_complete: Optional[bool] + """Optional. Indicates whether the response from the model is complete. Only used for streaming mode.""" + + input_transcription: Optional[genai_types.TranscriptionDict] + """Optional. Audio transcription of user input.""" + + output_transcription: Optional[genai_types.TranscriptionDict] + """Optional. Audio transcription of model output.""" + + +EventMetadataOrDict = Union[EventMetadata, EventMetadataDict] + + +class AppendAgentEngineSessionEventConfig(_common.BaseModel): + """Config for appending agent engine session event.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + content: Optional[genai_types.Content] = Field( + default=None, description="""The content of the session event.""" + ) + actions: Optional[EventActions] = Field( + default=None, + description="""Actions are parts of events that are related to the session event.""", + ) + error_code: Optional[str] = Field( + default=None, description="""The error code of the session event.""" + ) + error_message: Optional[str] = Field( + default=None, description="""The error message of the session event.""" + ) + event_metadata: Optional[EventMetadata] = Field( + default=None, description="""Metadata relating to the session event.""" + ) + raw_event: Optional[dict[str, Any]] = Field( + default=None, + description="""Weakly typed raw event data in proto struct format.""", + ) + + +class AppendAgentEngineSessionEventConfigDict(TypedDict, total=False): + """Config for appending agent engine session event.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + content: Optional[genai_types.ContentDict] + """The content of the session event.""" + + actions: Optional[EventActionsDict] + """Actions are parts of events that are related to the session event.""" + + error_code: Optional[str] + """The error code of the session event.""" + + error_message: Optional[str] + """The error message of the session event.""" + + event_metadata: Optional[EventMetadataDict] + """Metadata relating to the session event.""" + + raw_event: Optional[dict[str, Any]] + """Weakly typed raw event data in proto struct format.""" + + +AppendAgentEngineSessionEventConfigOrDict = Union[ + AppendAgentEngineSessionEventConfig, AppendAgentEngineSessionEventConfigDict +] + + +class _AppendAgentEngineSessionEventRequestParameters(_common.BaseModel): + """Parameters for appending agent engines.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine session.""" + ) + author: Optional[str] = Field( + default=None, description="""Author of the agent engine session event.""" + ) + invocation_id: Optional[str] = Field( + default=None, description="""Invocation ID of the agent engine.""" + ) + timestamp: Optional[datetime.datetime] = Field( + default=None, description="""Timestamp indicating when the event was created.""" + ) + config: Optional[AppendAgentEngineSessionEventConfig] = Field( + default=None, description="""""" + ) + + +class _AppendAgentEngineSessionEventRequestParametersDict(TypedDict, total=False): + """Parameters for appending agent engines.""" + + name: Optional[str] + """Name of the agent engine session.""" + + author: Optional[str] + """Author of the agent engine session event.""" + + invocation_id: Optional[str] + """Invocation ID of the agent engine.""" + + timestamp: Optional[datetime.datetime] + """Timestamp indicating when the event was created.""" + + config: Optional[AppendAgentEngineSessionEventConfigDict] + """""" + + +_AppendAgentEngineSessionEventRequestParametersOrDict = Union[ + _AppendAgentEngineSessionEventRequestParameters, + _AppendAgentEngineSessionEventRequestParametersDict, +] + + +class AppendAgentEngineSessionEventResponse(_common.BaseModel): + """Response for appending agent engine session event.""" + + pass + + +class AppendAgentEngineSessionEventResponseDict(TypedDict, total=False): + """Response for appending agent engine session event.""" + + pass + + +AppendAgentEngineSessionEventResponseOrDict = Union[ + AppendAgentEngineSessionEventResponse, AppendAgentEngineSessionEventResponseDict +] + + +class ListAgentEngineSessionEventsConfig(_common.BaseModel): + """Config for listing agent engine session events.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""", + ) + + +class ListAgentEngineSessionEventsConfigDict(TypedDict, total=False): + """Config for listing agent engine session events.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + page_size: Optional[int] + """""" + + page_token: Optional[str] + """""" + + filter: Optional[str] + """An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""" + + +ListAgentEngineSessionEventsConfigOrDict = Union[ + ListAgentEngineSessionEventsConfig, ListAgentEngineSessionEventsConfigDict +] + + +class _ListAgentEngineSessionEventsRequestParameters(_common.BaseModel): + """Parameters for listing agent engine session events.""" + + name: Optional[str] = Field( + default=None, description="""Name of the agent engine session.""" + ) + config: Optional[ListAgentEngineSessionEventsConfig] = Field( + default=None, description="""""" + ) + + +class _ListAgentEngineSessionEventsRequestParametersDict(TypedDict, total=False): + """Parameters for listing agent engine session events.""" + + name: Optional[str] + """Name of the agent engine session.""" + + config: Optional[ListAgentEngineSessionEventsConfigDict] + """""" + + +_ListAgentEngineSessionEventsRequestParametersOrDict = Union[ + _ListAgentEngineSessionEventsRequestParameters, + _ListAgentEngineSessionEventsRequestParametersDict, +] + + +class SessionEvent(_common.BaseModel): + """A session event.""" + + content: Optional[genai_types.Content] = Field( + default=None, + description="""Optional. Content of the event provided by the author.""", + ) + actions: Optional[EventActions] = Field( + default=None, description="""Optional. Actions executed by the agent.""" + ) + author: Optional[str] = Field( + default=None, + description="""Required. The name of the agent that sent the event, or user.""", + ) + error_code: Optional[str] = Field( + default=None, + description="""Optional. Error code if the response is an error. Code varies by model.""", + ) + error_message: Optional[str] = Field( + default=None, + description="""Optional. Error message if the response is an error.""", + ) + event_metadata: Optional[EventMetadata] = Field( + default=None, description="""Optional. Metadata relating to this event.""" + ) + invocation_id: Optional[str] = Field( + default=None, + description="""Required. The invocation id of the event, multiple events can have the same invocation id.""", + ) + name: Optional[str] = Field( + default=None, + description="""Identifier. The resource name of the event. Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.""", + ) + timestamp: Optional[datetime.datetime] = Field( + default=None, + description="""Required. Timestamp when the event was created on client side.""", + ) + raw_event: Optional[dict[str, Any]] = Field( + default=None, + description="""Optional. Weakly typed raw event data in proto struct format.""", + ) + + +class SessionEventDict(TypedDict, total=False): + """A session event.""" + + content: Optional[genai_types.ContentDict] + """Optional. Content of the event provided by the author.""" + + actions: Optional[EventActionsDict] + """Optional. Actions executed by the agent.""" + + author: Optional[str] + """Required. The name of the agent that sent the event, or user.""" + + error_code: Optional[str] + """Optional. Error code if the response is an error. Code varies by model.""" + + error_message: Optional[str] + """Optional. Error message if the response is an error.""" + + event_metadata: Optional[EventMetadataDict] + """Optional. Metadata relating to this event.""" + + invocation_id: Optional[str] + """Required. The invocation id of the event, multiple events can have the same invocation id.""" + + name: Optional[str] + """Identifier. The resource name of the event. Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.""" + + timestamp: Optional[datetime.datetime] + """Required. Timestamp when the event was created on client side.""" + + raw_event: Optional[dict[str, Any]] + """Optional. Weakly typed raw event data in proto struct format.""" + + +SessionEventOrDict = Union[SessionEvent, SessionEventDict] + + +class ListAgentEngineSessionEventsResponse(_common.BaseModel): + """Response for listing agent engine session events.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + session_events: Optional[list[SessionEvent]] = Field( + default=None, description="""List of session events.""" + ) + + +class ListAgentEngineSessionEventsResponseDict(TypedDict, total=False): + """Response for listing agent engine session events.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """""" + + session_events: Optional[list[SessionEventDict]] + """List of session events.""" + + +ListAgentEngineSessionEventsResponseOrDict = Union[ + ListAgentEngineSessionEventsResponse, ListAgentEngineSessionEventsResponseDict +] + + +class GeminiExample(_common.BaseModel): + """Represents a Gemini example.""" + + model: Optional[str] = Field( + default=None, description="""The model used to generate the Gemini example.""" + ) + contents: Optional[list[genai_types.Content]] = Field( + default=None, description="""Contents of the Gemini example.""" + ) + system_instruction: Optional[genai_types.Content] = Field( + default=None, description="""System instruction for the Gemini example.""" + ) + cached_content: Optional[str] = Field( + default=None, description="""Cached content for the Gemini example.""" + ) + tools: Optional[list[genai_types.Tool]] = Field( + default=None, description="""Tools for the Gemini example.""" + ) + tool_config: Optional[genai_types.ToolConfig] = Field( + default=None, description="""Tools for the Gemini example.""" + ) + safety_settings: Optional[list[genai_types.SafetySetting]] = Field( + default=None, description="""Safety settings for the Gemini example.""" + ) + generation_config: Optional[genai_types.GenerationConfig] = Field( + default=None, description="""Generation config for the Gemini example.""" + ) + model_armor_config: Optional[genai_types.ModelArmorConfig] = Field( + default=None, + description="""Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.""", + ) + + +class GeminiExampleDict(TypedDict, total=False): + """Represents a Gemini example.""" + + model: Optional[str] + """The model used to generate the Gemini example.""" + + contents: Optional[list[genai_types.ContentDict]] + """Contents of the Gemini example.""" + + system_instruction: Optional[genai_types.ContentDict] + """System instruction for the Gemini example.""" + + cached_content: Optional[str] + """Cached content for the Gemini example.""" + + tools: Optional[list[genai_types.ToolDict]] + """Tools for the Gemini example.""" + + tool_config: Optional[genai_types.ToolConfigDict] + """Tools for the Gemini example.""" + + safety_settings: Optional[list[genai_types.SafetySettingDict]] + """Safety settings for the Gemini example.""" + + generation_config: Optional[genai_types.GenerationConfigDict] + """Generation config for the Gemini example.""" + + model_armor_config: Optional[genai_types.ModelArmorConfigDict] + """Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.""" + + +GeminiExampleOrDict = Union[GeminiExample, GeminiExampleDict] + + +class GeminiTemplateConfig(_common.BaseModel): + """Represents a Gemini template config.""" + + gemini_example: Optional[GeminiExample] = Field( + default=None, + description="""Required. The template that will be used for assembling the request to use for downstream applications.""", + ) + field_mapping: Optional[dict[str, str]] = Field( + default=None, + description="""Required. Map of template parameters to the columns in the dataset table.""", + ) + + +class GeminiTemplateConfigDict(TypedDict, total=False): + """Represents a Gemini template config.""" + + gemini_example: Optional[GeminiExampleDict] + """Required. The template that will be used for assembling the request to use for downstream applications.""" + + field_mapping: Optional[dict[str, str]] + """Required. Map of template parameters to the columns in the dataset table.""" + + +GeminiTemplateConfigOrDict = Union[GeminiTemplateConfig, GeminiTemplateConfigDict] + + +class GeminiRequestReadConfig(_common.BaseModel): + """Represents the config for reading Gemini requests.""" + + template_config: Optional[GeminiTemplateConfig] = Field( + default=None, description="""Gemini request template with placeholders.""" + ) + assembled_request_column_name: Optional[str] = Field( + default=None, + description="""Column name in the underlying BigQuery table that contains already fully assembled Gemini requests.""", + ) + + @classmethod + def single_turn_template( + cls, + *, + prompt: str, + response: Optional[str] = None, + system_instruction: Optional[str] = None, + model: Optional[str] = None, + cached_content: Optional[str] = None, + tools: Optional[list[Union[genai_types.Tool, dict[str, Any]]]] = None, + tool_config: Optional[Union[genai_types.ToolConfig, dict[str, Any]]] = None, + safety_settings: Optional[ + list[Union[genai_types.SafetySetting, dict[str, Any]]] + ] = None, + generation_config: Optional[ + Union[genai_types.GenerationConfig, dict[str, Any]] + ] = None, + field_mapping: Optional[dict[str, str]] = None, + ) -> "GeminiRequestReadConfig": + """Constructs a GeminiRequestReadConfig object for single-turn cases. + + Example: + read_config = GeminiRequestReadConfig.single_turn_template( + prompt="Which flower is this {flower_image}?", + response="This is a {label}.", + system_instruction="You are a botanical classifier." + ) + + Args: + prompt: Required. User input. + response: Optional. Model response to user input. + system_instruction: Optional. System instructions for the model. + model: Optional. The model to use for the GeminiExample. + cached_content: Optional. The cached content to use for the GeminiExample. + tools: Optional. The tools to use for the GeminiExample. + tool_config: Optional. The tool config to use for the GeminiExample. + safety_settings: Optional. The safety settings to use for the GeminiExample. + generation_config: Optional. The generation config to use for the GeminiExample. + field_mapping: Optional. Mapping of placeholders to dataset columns. + + Returns: + A GeminiRequestReadConfig object. + """ + contents = [] + contents.append( + genai_types.Content( + role="user", + parts=[ + genai_types.Part.from_text(text=prompt), + ], + ) + ) + if response: + contents.append( + genai_types.Content( + role="model", + parts=[ + genai_types.Part.from_text(text=response), + ], + ) + ) + + system_instruction_content = None + if system_instruction: + system_instruction_content = genai_types.Content( + parts=[ + genai_types.Part.from_text(text=system_instruction), + ], + ) + + return cls( + template_config=GeminiTemplateConfig( + gemini_example=GeminiExample( + model=model, + contents=contents, + system_instruction=system_instruction_content, + cached_content=cached_content, + tools=tools, + tool_config=tool_config, + safety_settings=safety_settings, + generation_config=generation_config, + ), + field_mapping=field_mapping, + ), + ) + + +class GeminiRequestReadConfigDict(TypedDict, total=False): + """Represents the config for reading Gemini requests.""" + + template_config: Optional[GeminiTemplateConfigDict] + """Gemini request template with placeholders.""" + + assembled_request_column_name: Optional[str] + """Column name in the underlying BigQuery table that contains already fully assembled Gemini requests.""" + + +GeminiRequestReadConfigOrDict = Union[ + GeminiRequestReadConfig, GeminiRequestReadConfigDict +] + + +class AssembleDatasetConfig(_common.BaseModel): + """Config for assembling a multimodal dataset resource.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + timeout: Optional[int] = Field( + default=90, + description="""The timeout for the assemble dataset request in seconds. If not + set, the default timeout is 90 seconds.""", + ) + + +class AssembleDatasetConfigDict(TypedDict, total=False): + """Config for assembling a multimodal dataset resource.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + timeout: Optional[int] + """The timeout for the assemble dataset request in seconds. If not + set, the default timeout is 90 seconds.""" + + +AssembleDatasetConfigOrDict = Union[AssembleDatasetConfig, AssembleDatasetConfigDict] + + +class _AssembleDatasetParameters(_common.BaseModel): + """Parameters for assembling a multimodal dataset resource.""" + + name: Optional[str] = Field(default=None, description="""""") + gemini_request_read_config: Optional[GeminiRequestReadConfig] = Field( + default=None, description="""""" + ) + config: Optional[AssembleDatasetConfig] = Field(default=None, description="""""") + + +class _AssembleDatasetParametersDict(TypedDict, total=False): + """Parameters for assembling a multimodal dataset resource.""" + + name: Optional[str] + """""" + + gemini_request_read_config: Optional[GeminiRequestReadConfigDict] + """""" + + config: Optional[AssembleDatasetConfigDict] + """""" + + +_AssembleDatasetParametersOrDict = Union[ + _AssembleDatasetParameters, _AssembleDatasetParametersDict +] + + +class MultimodalDatasetOperation(_common.BaseModel): + """Represents the create dataset operation.""" + + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[dict[str, Any]] = Field( + default=None, description="""The result of the dataset operation.""" + ) + + +class MultimodalDatasetOperationDict(TypedDict, total=False): + """Represents the create dataset 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}`.""" + + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" + + response: Optional[dict[str, Any]] + """The result of the dataset operation.""" + + +MultimodalDatasetOperationOrDict = Union[ + MultimodalDatasetOperation, MultimodalDatasetOperationDict +] + + +class TuningResourceUsageAssessmentConfig(_common.BaseModel): + """Config for tuning resource usage assessment.""" + + model_name: Optional[str] = Field(default=None, description="""""") + + +class TuningResourceUsageAssessmentConfigDict(TypedDict, total=False): + """Config for tuning resource usage assessment.""" + + model_name: Optional[str] + """""" + + +TuningResourceUsageAssessmentConfigOrDict = Union[ + TuningResourceUsageAssessmentConfig, TuningResourceUsageAssessmentConfigDict +] + + +class TuningValidationAssessmentConfig(_common.BaseModel): + """Config for tuning validation assessment.""" + + model_name: Optional[str] = Field(default=None, description="""""") + dataset_usage: Optional[str] = Field(default=None, description="""""") + + +class TuningValidationAssessmentConfigDict(TypedDict, total=False): + """Config for tuning validation assessment.""" + + model_name: Optional[str] + """""" + + dataset_usage: Optional[str] + """""" + + +TuningValidationAssessmentConfigOrDict = Union[ + TuningValidationAssessmentConfig, TuningValidationAssessmentConfigDict +] + + +class BatchPredictionResourceUsageAssessmentConfig(_common.BaseModel): + """Config for batch prediction resource usage assessment.""" + + model_name: Optional[str] = Field(default=None, description="""""") + + +class BatchPredictionResourceUsageAssessmentConfigDict(TypedDict, total=False): + """Config for batch prediction resource usage assessment.""" + + model_name: Optional[str] + """""" + + +BatchPredictionResourceUsageAssessmentConfigOrDict = Union[ + BatchPredictionResourceUsageAssessmentConfig, + BatchPredictionResourceUsageAssessmentConfigDict, +] + + +class BatchPredictionValidationAssessmentConfig(_common.BaseModel): + """Config for batch prediction validation assessment.""" + + model_name: Optional[str] = Field(default=None, description="""""") + + +class BatchPredictionValidationAssessmentConfigDict(TypedDict, total=False): + """Config for batch prediction validation assessment.""" + + model_name: Optional[str] + """""" + + +BatchPredictionValidationAssessmentConfigOrDict = Union[ + BatchPredictionValidationAssessmentConfig, + BatchPredictionValidationAssessmentConfigDict, +] + + +class AssessDatasetConfig(_common.BaseModel): + """Config for assessing a multimodal dataset resource.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + timeout: Optional[int] = Field( + default=90, + description="""The timeout for the assess dataset request in seconds. If not set, + the default timeout is 90 seconds.""", + ) + + +class AssessDatasetConfigDict(TypedDict, total=False): + """Config for assessing a multimodal dataset resource.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + timeout: Optional[int] + """The timeout for the assess dataset request in seconds. If not set, + the default timeout is 90 seconds.""" + + +AssessDatasetConfigOrDict = Union[AssessDatasetConfig, AssessDatasetConfigDict] + + +class _AssessDatasetParameters(_common.BaseModel): + """Parameters for assessing a multimodal dataset resource.""" + + name: Optional[str] = Field(default=None, description="""""") + gemini_request_read_config: Optional[GeminiRequestReadConfig] = Field( + default=None, description="""""" + ) + tuning_resource_usage_assessment_config: Optional[ + TuningResourceUsageAssessmentConfig + ] = Field(default=None, description="""""") + tuning_validation_assessment_config: Optional[TuningValidationAssessmentConfig] = ( + Field(default=None, description="""""") + ) + batch_prediction_resource_usage_assessment_config: Optional[ + BatchPredictionResourceUsageAssessmentConfig + ] = Field(default=None, description="""""") + batch_prediction_validation_assessment_config: Optional[ + BatchPredictionValidationAssessmentConfig + ] = Field(default=None, description="""""") + config: Optional[AssessDatasetConfig] = Field(default=None, description="""""") + + +class _AssessDatasetParametersDict(TypedDict, total=False): + """Parameters for assessing a multimodal dataset resource.""" + + name: Optional[str] + """""" + + gemini_request_read_config: Optional[GeminiRequestReadConfigDict] + """""" + + tuning_resource_usage_assessment_config: Optional[ + TuningResourceUsageAssessmentConfigDict + ] + """""" + + tuning_validation_assessment_config: Optional[TuningValidationAssessmentConfigDict] + """""" + + batch_prediction_resource_usage_assessment_config: Optional[ + BatchPredictionResourceUsageAssessmentConfigDict + ] + """""" + + batch_prediction_validation_assessment_config: Optional[ + BatchPredictionValidationAssessmentConfigDict + ] + """""" + + config: Optional[AssessDatasetConfigDict] + """""" + + +_AssessDatasetParametersOrDict = Union[ + _AssessDatasetParameters, _AssessDatasetParametersDict +] + + +class SchemaTablesDatasetMetadataBigQuerySource(_common.BaseModel): + """Represents the BigQuery source for multimodal dataset metadata.""" + + uri: Optional[str] = Field( + default=None, + description="""The URI of the BigQuery table. This accepts the table name with or without the bq:// prefix.""", + ) + + +class SchemaTablesDatasetMetadataBigQuerySourceDict(TypedDict, total=False): + """Represents the BigQuery source for multimodal dataset metadata.""" + + uri: Optional[str] + """The URI of the BigQuery table. This accepts the table name with or without the bq:// prefix.""" + + +SchemaTablesDatasetMetadataBigQuerySourceOrDict = Union[ + SchemaTablesDatasetMetadataBigQuerySource, + SchemaTablesDatasetMetadataBigQuerySourceDict, +] + + +class SchemaTablesDatasetMetadataInputConfig(_common.BaseModel): + """Represents the input config for multimodal dataset metadata.""" + + bigquery_source: Optional[SchemaTablesDatasetMetadataBigQuerySource] = Field( + default=None, + description="""The BigQuery source for multimodal dataset metadata.""", + ) + + +class SchemaTablesDatasetMetadataInputConfigDict(TypedDict, total=False): + """Represents the input config for multimodal dataset metadata.""" + + bigquery_source: Optional[SchemaTablesDatasetMetadataBigQuerySourceDict] + """The BigQuery source for multimodal dataset metadata.""" + + +SchemaTablesDatasetMetadataInputConfigOrDict = Union[ + SchemaTablesDatasetMetadataInputConfig, SchemaTablesDatasetMetadataInputConfigDict +] + + +class SchemaTablesDatasetMetadata(_common.BaseModel): + """Represents the metadata schema for multimodal dataset metadata.""" + + input_config: Optional[SchemaTablesDatasetMetadataInputConfig] = Field( + default=None, + description="""The input config for multimodal dataset metadata.""", + ) + gemini_request_read_config: Optional[GeminiRequestReadConfig] = Field( + default=None, + description="""The Gemini request read config for the multimodal dataset.""", + ) + + +class SchemaTablesDatasetMetadataDict(TypedDict, total=False): + """Represents the metadata schema for multimodal dataset metadata.""" + + input_config: Optional[SchemaTablesDatasetMetadataInputConfigDict] + """The input config for multimodal dataset metadata.""" + + gemini_request_read_config: Optional[GeminiRequestReadConfigDict] + """The Gemini request read config for the multimodal dataset.""" + + +SchemaTablesDatasetMetadataOrDict = Union[ + SchemaTablesDatasetMetadata, SchemaTablesDatasetMetadataDict +] + + +class CreateMultimodalDatasetConfig(_common.BaseModel): + """Config for creating a dataset resource to store multimodal dataset.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + timeout: Optional[int] = Field( + default=90, + description="""The timeout for the create dataset request in seconds. If not set, + the default timeout is 90 seconds.""", + ) + + +class CreateMultimodalDatasetConfigDict(TypedDict, total=False): + """Config for creating a dataset resource to store multimodal dataset.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + timeout: Optional[int] + """The timeout for the create dataset request in seconds. If not set, + the default timeout is 90 seconds.""" + + +CreateMultimodalDatasetConfigOrDict = Union[ + CreateMultimodalDatasetConfig, CreateMultimodalDatasetConfigDict +] + + +class _CreateMultimodalDatasetParameters(_common.BaseModel): + """Parameters for creating a dataset resource to store multimodal dataset.""" + + name: Optional[str] = Field(default=None, description="""""") + display_name: Optional[str] = Field(default=None, description="""""") + metadata_schema_uri: Optional[str] = Field(default=None, description="""""") + metadata: Optional[SchemaTablesDatasetMetadata] = Field( + default=None, description="""""" + ) + description: Optional[str] = Field(default=None, description="""""") + encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + default=None, description="""""" + ) + config: Optional[CreateMultimodalDatasetConfig] = Field( + default=None, description="""""" + ) + + +class _CreateMultimodalDatasetParametersDict(TypedDict, total=False): + """Parameters for creating a dataset resource to store multimodal dataset.""" + + name: Optional[str] + """""" + + display_name: Optional[str] + """""" + + metadata_schema_uri: Optional[str] + """""" + + metadata: Optional[SchemaTablesDatasetMetadataDict] + """""" + + description: Optional[str] + """""" + + encryption_spec: Optional[genai_types.EncryptionSpecDict] + """""" + + config: Optional[CreateMultimodalDatasetConfigDict] + """""" + + +_CreateMultimodalDatasetParametersOrDict = Union[ + _CreateMultimodalDatasetParameters, _CreateMultimodalDatasetParametersDict +] + + +class _DeleteMultimodalDatasetRequestParameters(_common.BaseModel): + """Parameters for deleting a multimodal dataset.""" + + name: Optional[str] = Field( + default=None, description="""ID of the dataset to be deleted.""" + ) + config: Optional[VertexBaseConfig] = Field(default=None, description="""""") + + +class _DeleteMultimodalDatasetRequestParametersDict(TypedDict, total=False): + """Parameters for deleting a multimodal dataset.""" + + name: Optional[str] + """ID of the dataset to be deleted.""" + + config: Optional[VertexBaseConfigDict] + """""" + + +_DeleteMultimodalDatasetRequestParametersOrDict = Union[ + _DeleteMultimodalDatasetRequestParameters, + _DeleteMultimodalDatasetRequestParametersDict, +] + + +class _GetMultimodalDatasetParameters(_common.BaseModel): + """Parameters for getting a multimodal dataset resource.""" + + name: Optional[str] = Field(default=None, description="""""") + config: Optional[VertexBaseConfig] = Field(default=None, description="""""") + + +class _GetMultimodalDatasetParametersDict(TypedDict, total=False): + """Parameters for getting a multimodal dataset resource.""" + + name: Optional[str] + """""" + + config: Optional[VertexBaseConfigDict] + """""" + + +_GetMultimodalDatasetParametersOrDict = Union[ + _GetMultimodalDatasetParameters, _GetMultimodalDatasetParametersDict +] + + +class MultimodalDataset(_common.BaseModel): + """Represents a multimodal dataset.""" + + name: Optional[str] = Field( + default=None, description="""The ID of the multimodal dataset.""" + ) + display_name: Optional[str] = Field( + default=None, description="""The display name of the multimodal dataset.""" + ) + metadata: Optional[SchemaTablesDatasetMetadata] = Field( + default=None, description="""The metadata of the multimodal dataset.""" + ) + description: Optional[str] = Field( + default=None, description="""The description of the multimodal dataset.""" + ) + + @property + def read_config(self) -> Optional[GeminiRequestReadConfig]: + """Gets the read config from the dataset metadata. Returns None if it's not set.""" + if self.metadata is None or self.metadata.gemini_request_read_config is None: + return None + return self.metadata.gemini_request_read_config + + def set_read_config( + self, + *, + read_config: GeminiRequestReadConfigOrDict, + ) -> None: + """Sets the read config in the dataset metadata.""" + if isinstance(read_config, dict): + read_config = GeminiRequestReadConfig(**read_config) + + if self.metadata is None: + self.metadata = SchemaTablesDatasetMetadata() + self.metadata.gemini_request_read_config = read_config + + @property + def bigquery_uri( + self, + ) -> Optional[str]: + """Gets the bigquery uri from the dataset metadata. Returns None if it's not set.""" + if ( + self.metadata is None + or self.metadata.input_config is None + or self.metadata.input_config.bigquery_source is None + ): + return None + return str(self.metadata.input_config.bigquery_source.uri) + + def set_bigquery_uri( + self, + bigquery_uri: str, + ) -> None: + """Sets the bigquery uri in the dataset metadata. Prepends 'bq://' if it's not already present.""" + if not bigquery_uri.startswith("bq://"): + bigquery_uri = f"bq://{bigquery_uri}" + metadata = ( + SchemaTablesDatasetMetadata() if self.metadata is None else self.metadata + ) + input_config = ( + SchemaTablesDatasetMetadataInputConfig() + if metadata.input_config is None + else metadata.input_config + ) + bigquery_source = ( + SchemaTablesDatasetMetadataBigQuerySource() + if input_config.bigquery_source is None + else input_config.bigquery_source + ) + bigquery_source.uri = bigquery_uri + input_config.bigquery_source = bigquery_source + metadata.input_config = input_config + self.metadata = metadata + + def to_bigframes( + self, + ) -> "bigframes.pandas.DataFrame": # type: ignore # noqa: F821 + """Converts the multimodal dataset to a BigFrames dataframe. + + This is the preferred method to inspect the multimodal dataset in a + notebook. + + Returns: + A BigFrames dataframe. + """ + from .. import _datasets_utils + + bigframes = _datasets_utils._try_import_bigframes() + + if self.bigquery_uri is None: + raise ValueError("Multimodal dataset bigquery source uri is not set.") + return bigframes.pandas.read_gbq_table(self.bigquery_uri.removeprefix("bq://")) + + def to_batch_job_source(self) -> "genai_types.BatchJobSource": + """Converts the dataset to a BatchJobSource.""" + return genai_types.BatchJobSource( + vertex_dataset_name=self.name, + ) + + def get_batch_job_destination(self) -> "genai_types.BatchJobDestination": + """Converts the dataset to a BatchJobDestination.""" + from .. import _datasets_utils + + unique_name = _datasets_utils.get_batch_job_unique_name() + bigquery_uri = self.bigquery_uri + if bigquery_uri is None: + raise ValueError("Multimodal dataset bigquery source uri is not set.") + curr_display_name = self.display_name or "genai_batch_job" + return genai_types.BatchJobDestination( + vertex_dataset=genai_types.VertexMultimodalDatasetDestination( + display_name=f"{curr_display_name}_batch_output_{unique_name}", + bigquery_destination=f"{bigquery_uri}_batch_output_{unique_name}", + ) + ) + + +class MultimodalDatasetDict(TypedDict, total=False): + """Represents a multimodal dataset.""" + + name: Optional[str] + """The ID of the multimodal dataset.""" + + display_name: Optional[str] + """The display name of the multimodal dataset.""" + + metadata: Optional[SchemaTablesDatasetMetadataDict] + """The metadata of the multimodal dataset.""" + + description: Optional[str] + """The description of the multimodal dataset.""" + + +MultimodalDatasetOrDict = Union[MultimodalDataset, MultimodalDatasetDict] + + +class GetMultimodalDatasetOperationConfig(_common.BaseModel): + """Config for getting a multimodal dataset operation.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + + +class GetMultimodalDatasetOperationConfigDict(TypedDict, total=False): + """Config for getting a multimodal dataset operation.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +GetMultimodalDatasetOperationConfigOrDict = Union[ + GetMultimodalDatasetOperationConfig, GetMultimodalDatasetOperationConfigDict +] + + +class _GetMultimodalDatasetOperationParameters(_common.BaseModel): + """Parameters for getting a dataset operation.""" + + dataset_id: Optional[str] = Field(default=None, description="""""") + operation_id: Optional[str] = Field(default=None, description="""""") + config: Optional[GetMultimodalDatasetOperationConfig] = Field( + default=None, description="""""" + ) + + +class _GetMultimodalDatasetOperationParametersDict(TypedDict, total=False): + """Parameters for getting a dataset operation.""" + + dataset_id: Optional[str] + """""" + + operation_id: Optional[str] + """""" + + config: Optional[GetMultimodalDatasetOperationConfigDict] + """""" + + +_GetMultimodalDatasetOperationParametersOrDict = Union[ + _GetMultimodalDatasetOperationParameters, + _GetMultimodalDatasetOperationParametersDict, +] + + +class ListMultimodalDatasetsConfig(_common.BaseModel): + """Config for listing multimodal datasets.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""", + ) + + +class ListMultimodalDatasetsConfigDict(TypedDict, total=False): + """Config for listing multimodal datasets.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + page_size: Optional[int] + """""" + + page_token: Optional[str] + """""" + + filter: Optional[str] + """An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""" + + +ListMultimodalDatasetsConfigOrDict = Union[ + ListMultimodalDatasetsConfig, ListMultimodalDatasetsConfigDict +] + + +class _ListMultimodalDatasetsRequestParameters(_common.BaseModel): + """Parameters for listing multimodal datasets.""" + + config: Optional[ListMultimodalDatasetsConfig] = Field( + default=None, description="""""" + ) + + +class _ListMultimodalDatasetsRequestParametersDict(TypedDict, total=False): + """Parameters for listing multimodal datasets.""" + + config: Optional[ListMultimodalDatasetsConfigDict] + """""" + + +_ListMultimodalDatasetsRequestParametersOrDict = Union[ + _ListMultimodalDatasetsRequestParameters, + _ListMultimodalDatasetsRequestParametersDict, +] + + +class ListMultimodalDatasetsResponse(_common.BaseModel): + """Response for listing multimodal datasets.""" + + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + timeout: Optional[int] = Field( + default=90, + description="""The timeout for the list datasets request in seconds. If not set, + the default timeout is 90 seconds.""", + ) + datasets: Optional[list[MultimodalDataset]] = Field( + default=None, + description="""List of datasets for the project. + """, + ) + + +class ListMultimodalDatasetsResponseDict(TypedDict, total=False): + """Response for listing multimodal datasets.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + + next_page_token: Optional[str] + """""" + + timeout: Optional[int] + """The timeout for the list datasets request in seconds. If not set, + the default timeout is 90 seconds.""" + + datasets: Optional[list[MultimodalDatasetDict]] + """List of datasets for the project. + """ + + +ListMultimodalDatasetsResponseOrDict = Union[ + ListMultimodalDatasetsResponse, ListMultimodalDatasetsResponseDict +] + + +class _UpdateMultimodalDatasetParameters(_common.BaseModel): + """Parameters for updating a multimodal dataset resource.""" + + name: Optional[str] = Field(default=None, description="""""") + display_name: Optional[str] = Field(default=None, description="""""") + metadata: Optional[SchemaTablesDatasetMetadata] = Field( + default=None, description="""""" + ) + description: Optional[str] = Field(default=None, description="""""") + encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + default=None, description="""""" + ) + config: Optional[VertexBaseConfig] = Field(default=None, description="""""") + + +class _UpdateMultimodalDatasetParametersDict(TypedDict, total=False): + """Parameters for updating a multimodal dataset resource.""" + + name: Optional[str] + """""" + + display_name: Optional[str] + """""" + + metadata: Optional[SchemaTablesDatasetMetadataDict] + """""" + + description: Optional[str] + """""" + + encryption_spec: Optional[genai_types.EncryptionSpecDict] + """""" + + config: Optional[VertexBaseConfigDict] + """""" + + +_UpdateMultimodalDatasetParametersOrDict = Union[ + _UpdateMultimodalDatasetParameters, _UpdateMultimodalDatasetParametersDict +] + + +class SchemaPredictParamsGroundingConfigSourceEntry(_common.BaseModel): + """Single source entry for the grounding checking.""" + + enterprise_datastore: Optional[str] = Field( + default=None, + description="""The uri of the Vertex AI Search data source. Deprecated. Use vertex_ai_search_datastore instead.""", + ) + inline_context: Optional[str] = Field( + default=None, + description="""The grounding text passed inline with the Predict API. It can support up to 1 million bytes.""", + ) + type: Optional[ + Literal["UNSPECIFIED", "WEB", "ENTERPRISE", "VERTEX_AI_SEARCH", "INLINE"] + ] = Field( + default=None, description="""The type of the grounding checking source.""" + ) + vertex_ai_search_datastore: Optional[str] = Field( + default=None, description="""The uri of the Vertex AI Search data source.""" + ) + + +class SchemaPredictParamsGroundingConfigSourceEntryDict(TypedDict, total=False): + """Single source entry for the grounding checking.""" + + enterprise_datastore: Optional[str] + """The uri of the Vertex AI Search data source. Deprecated. Use vertex_ai_search_datastore instead.""" + + inline_context: Optional[str] + """The grounding text passed inline with the Predict API. It can support up to 1 million bytes.""" + + type: Optional[ + Literal["UNSPECIFIED", "WEB", "ENTERPRISE", "VERTEX_AI_SEARCH", "INLINE"] + ] + """The type of the grounding checking source.""" + + vertex_ai_search_datastore: Optional[str] + """The uri of the Vertex AI Search data source.""" + + +SchemaPredictParamsGroundingConfigSourceEntryOrDict = Union[ + SchemaPredictParamsGroundingConfigSourceEntry, + SchemaPredictParamsGroundingConfigSourceEntryDict, +] + + +class SchemaPredictParamsGroundingConfig(_common.BaseModel): + """The configuration for grounding checking.""" + + disable_attribution: Optional[bool] = Field( + default=None, + description="""If set, skip finding claim attributions (i.e not generate grounding citation).""", + ) + sources: Optional[list[SchemaPredictParamsGroundingConfigSourceEntry]] = Field( + default=None, description="""The sources for the grounding checking.""" + ) + + +class SchemaPredictParamsGroundingConfigDict(TypedDict, total=False): + """The configuration for grounding checking.""" + + disable_attribution: Optional[bool] + """If set, skip finding claim attributions (i.e not generate grounding citation).""" + + sources: Optional[list[SchemaPredictParamsGroundingConfigSourceEntryDict]] + """The sources for the grounding checking.""" + + +SchemaPredictParamsGroundingConfigOrDict = Union[ + SchemaPredictParamsGroundingConfig, SchemaPredictParamsGroundingConfigDict +] + + +class SchemaPromptInstancePromptExecution(_common.BaseModel): + """A prompt instance's parameters set that contains a set of variable values.""" + + arguments: Optional[dict[str, "SchemaPromptInstanceVariableValue"]] = Field( + default=None, description="""Maps variable names to their value.""" + ) + + +class SchemaPromptInstancePromptExecutionDict(TypedDict, total=False): + """A prompt instance's parameters set that contains a set of variable values.""" + + arguments: Optional[dict[str, "SchemaPromptInstanceVariableValueDict"]] + """Maps variable names to their value.""" + + +SchemaPromptInstancePromptExecutionOrDict = Union[ + SchemaPromptInstancePromptExecution, SchemaPromptInstancePromptExecutionDict +] + + +class SchemaPromptSpecPromptMessage(_common.BaseModel): + """Represents a prompt message.""" + + generation_config: Optional[genai_types.GenerationConfig] = Field( + default=None, description="""Generation config.""" + ) + tool_config: Optional[genai_types.FunctionCallingConfig] = Field( + default=None, + description="""Tool config. This config is shared for all tools provided in the request.""", + ) + tools: Optional[list[genai_types.Tool]] = Field( + default=None, + description="""A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.""", + ) + safety_settings: Optional[list[genai_types.SafetySetting]] = Field( + default=None, + description="""Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.""", + ) + contents: Optional[list[genai_types.Content]] = Field( + default=None, + description="""The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.""", + ) + system_instruction: Optional[genai_types.Content] = Field( + default=None, + description="""The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.""", + ) + variables: Optional[list[dict[str, genai_types.Part]]] = Field( + default=None, description="""""" + ) + model: Optional[str] = Field(default=None, description="""The model name.""") + + +class SchemaPromptSpecPromptMessageDict(TypedDict, total=False): + """Represents a prompt message.""" + + generation_config: Optional[genai_types.GenerationConfigDict] + """Generation config.""" + + tool_config: Optional[genai_types.FunctionCallingConfigDict] + """Tool config. This config is shared for all tools provided in the request.""" + + tools: Optional[list[genai_types.ToolDict]] + """A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.""" + + safety_settings: Optional[list[genai_types.SafetySettingDict]] + """Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.""" + + contents: Optional[list[genai_types.ContentDict]] + """The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.""" + + system_instruction: Optional[genai_types.ContentDict] + """The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.""" + + variables: Optional[list[dict[str, genai_types.PartDict]]] + """""" + + model: Optional[str] + """The model name.""" + + +SchemaPromptSpecPromptMessageOrDict = Union[ + SchemaPromptSpecPromptMessage, SchemaPromptSpecPromptMessageDict +] + + +class SchemaPromptSpecMultimodalPrompt(_common.BaseModel): + """Prompt variation that embeds preambles to prompt string.""" + + prompt_message: Optional[SchemaPromptSpecPromptMessage] = Field( + default=None, description="""The prompt message.""" + ) + + +class SchemaPromptSpecMultimodalPromptDict(TypedDict, total=False): + """Prompt variation that embeds preambles to prompt string.""" + + prompt_message: Optional[SchemaPromptSpecPromptMessageDict] + """The prompt message.""" + + +SchemaPromptSpecMultimodalPromptOrDict = Union[ + SchemaPromptSpecMultimodalPrompt, SchemaPromptSpecMultimodalPromptDict +] + + +class SchemaPromptSpecAppBuilderDataLinkedResource(_common.BaseModel): + """A linked resource attached to the application by the user.""" + + display_name: Optional[str] = Field( + default=None, + description="""A user-friendly name for the data source shown in the UI.""", + ) + name: Optional[str] = Field( + default=None, + description="""The unique resource name of the data source. The format is determined by the 'type' field. For type "SAVED_PROMPT": projects/{project}/locations/{location}/datasets/{dataset} For type "AI_AGENT": projects/{project}/locations/{location}/agents/{agent}""", + ) + type: Optional[str] = Field( + default=None, + description="""The type of the linked resource. e.g., "SAVED_PROMPT", "AI_AGENT" This string corresponds to the name of the LinkedResourceType enum member. See: google3/cloud/console/web/ai/platform/llm/prompts/build/services/specs_repository_service/linked_resources/linked_resource.ts""", + ) + + +class SchemaPromptSpecAppBuilderDataLinkedResourceDict(TypedDict, total=False): + """A linked resource attached to the application by the user.""" + + display_name: Optional[str] + """A user-friendly name for the data source shown in the UI.""" + + name: Optional[str] + """The unique resource name of the data source. The format is determined by the 'type' field. For type "SAVED_PROMPT": projects/{project}/locations/{location}/datasets/{dataset} For type "AI_AGENT": projects/{project}/locations/{location}/agents/{agent}""" + + type: Optional[str] + """The type of the linked resource. e.g., "SAVED_PROMPT", "AI_AGENT" This string corresponds to the name of the LinkedResourceType enum member. See: google3/cloud/console/web/ai/platform/llm/prompts/build/services/specs_repository_service/linked_resources/linked_resource.ts""" + + +SchemaPromptSpecAppBuilderDataLinkedResourceOrDict = Union[ + SchemaPromptSpecAppBuilderDataLinkedResource, + SchemaPromptSpecAppBuilderDataLinkedResourceDict, +] + + +class SchemaPromptSpecAppBuilderData(_common.BaseModel): + """Defines data for an application builder.""" + + code_repository_state: Optional[str] = Field( + default=None, + description="""Serialized state of the code repository. This string will typically contain a JSON representation of the UI's CodeRepositoryService state (files, folders, content, and any metadata). The UI is responsible for serialization and deserialization.""", + ) + framework: Optional[Framework] = Field( + default=None, + description="""Optional. Framework used to build the application.""", + ) + linked_resources: Optional[list[SchemaPromptSpecAppBuilderDataLinkedResource]] = ( + Field( + default=None, + description="""Linked resources attached to the application by the user.""", + ) + ) + + +class SchemaPromptSpecAppBuilderDataDict(TypedDict, total=False): + """Defines data for an application builder.""" + + code_repository_state: Optional[str] + """Serialized state of the code repository. This string will typically contain a JSON representation of the UI's CodeRepositoryService state (files, folders, content, and any metadata). The UI is responsible for serialization and deserialization.""" + + framework: Optional[Framework] + """Optional. Framework used to build the application.""" + + linked_resources: Optional[list[SchemaPromptSpecAppBuilderDataLinkedResourceDict]] + """Linked resources attached to the application by the user.""" + + +SchemaPromptSpecAppBuilderDataOrDict = Union[ + SchemaPromptSpecAppBuilderData, SchemaPromptSpecAppBuilderDataDict +] + + +class SchemaPromptSpecPartList(_common.BaseModel): + """Represents a prompt spec part list.""" + + parts: Optional[list[genai_types.Part]] = Field( + default=None, description="""A list of elements that can be part of a prompt.""" + ) + + +class SchemaPromptSpecPartListDict(TypedDict, total=False): + """Represents a prompt spec part list.""" + + parts: Optional[list[genai_types.PartDict]] + """A list of elements that can be part of a prompt.""" + + +SchemaPromptSpecPartListOrDict = Union[ + SchemaPromptSpecPartList, SchemaPromptSpecPartListDict +] + + +class SchemaPromptSpecInteractionData(_common.BaseModel): + """Defines data for an interaction prompt.""" + + interaction_ids: Optional[list[str]] = Field( + default=None, + description="""Optional. Lists interaction IDs associated with the prompt. This maps 1:1 to PromptMessage.contents. If InteractionData is present, every prompt message has an interaction ID.""", + ) + + +class SchemaPromptSpecInteractionDataDict(TypedDict, total=False): + """Defines data for an interaction prompt.""" + + interaction_ids: Optional[list[str]] + """Optional. Lists interaction IDs associated with the prompt. This maps 1:1 to PromptMessage.contents. If InteractionData is present, every prompt message has an interaction ID.""" + + +SchemaPromptSpecInteractionDataOrDict = Union[ + SchemaPromptSpecInteractionData, SchemaPromptSpecInteractionDataDict +] + + +class SchemaPromptSpecStructuredPrompt(_common.BaseModel): + """Represents a structured prompt.""" + + context: Optional[genai_types.Content] = Field( + default=None, description="""Preamble: The context of the prompt.""" + ) + app_builder_data: Optional[SchemaPromptSpecAppBuilderData] = Field( + default=None, description="""Data for app builder use case.""" + ) + examples: Optional[list[SchemaPromptSpecPartList]] = Field( + default=None, + description="""Preamble: A set of examples for expected model response.""", + ) + infill_prefix: Optional[str] = Field( + default=None, + description="""Preamble: For infill prompt, the prefix before expected model response.""", + ) + infill_suffix: Optional[str] = Field( + default=None, + description="""Preamble: For infill prompt, the suffix after expected model response.""", + ) + input_prefixes: Optional[list[str]] = Field( + default=None, + description="""Preamble: The input prefixes before each example input.""", + ) + output_prefixes: Optional[list[str]] = Field( + default=None, + description="""Preamble: The output prefixes before each example output.""", + ) + prediction_inputs: Optional[list[SchemaPromptSpecPartList]] = Field( + default=None, + description="""Preamble: The input test data for prediction. Each PartList in this field represents one text-only input set for a single model request.""", + ) + prompt_message: Optional[SchemaPromptSpecPromptMessage] = Field( + default=None, description="""The prompt message.""" + ) + interaction_data: Optional[SchemaPromptSpecInteractionData] = Field( + default=None, description="""Data for interaction use case.""" + ) + + +class SchemaPromptSpecStructuredPromptDict(TypedDict, total=False): + """Represents a structured prompt.""" + + context: Optional[genai_types.ContentDict] + """Preamble: The context of the prompt.""" + + app_builder_data: Optional[SchemaPromptSpecAppBuilderDataDict] + """Data for app builder use case.""" + + examples: Optional[list[SchemaPromptSpecPartListDict]] + """Preamble: A set of examples for expected model response.""" + + infill_prefix: Optional[str] + """Preamble: For infill prompt, the prefix before expected model response.""" + + infill_suffix: Optional[str] + """Preamble: For infill prompt, the suffix after expected model response.""" + + input_prefixes: Optional[list[str]] + """Preamble: The input prefixes before each example input.""" + + output_prefixes: Optional[list[str]] + """Preamble: The output prefixes before each example output.""" + + prediction_inputs: Optional[list[SchemaPromptSpecPartListDict]] + """Preamble: The input test data for prediction. Each PartList in this field represents one text-only input set for a single model request.""" + + prompt_message: Optional[SchemaPromptSpecPromptMessageDict] + """The prompt message.""" + + interaction_data: Optional[SchemaPromptSpecInteractionDataDict] + """Data for interaction use case.""" + + +SchemaPromptSpecStructuredPromptOrDict = Union[ + SchemaPromptSpecStructuredPrompt, SchemaPromptSpecStructuredPromptDict +] + + +class SchemaPromptSpecReferenceSentencePair(_common.BaseModel): + """A pair of sentences used as reference in source and target languages.""" + + source_sentence: Optional[str] = Field( + default=None, description="""Source sentence in the sentence pair.""" + ) + target_sentence: Optional[str] = Field( + default=None, description="""Target sentence in the sentence pair.""" + ) + + +class SchemaPromptSpecReferenceSentencePairDict(TypedDict, total=False): + """A pair of sentences used as reference in source and target languages.""" + + source_sentence: Optional[str] + """Source sentence in the sentence pair.""" + + target_sentence: Optional[str] + """Target sentence in the sentence pair.""" + + +SchemaPromptSpecReferenceSentencePairOrDict = Union[ + SchemaPromptSpecReferenceSentencePair, SchemaPromptSpecReferenceSentencePairDict +] + + +class SchemaPromptSpecReferenceSentencePairList(_common.BaseModel): + """A list of reference sentence pairs.""" + + reference_sentence_pairs: Optional[list[SchemaPromptSpecReferenceSentencePair]] = ( + Field(default=None, description="""Reference sentence pairs.""") + ) + + +class SchemaPromptSpecReferenceSentencePairListDict(TypedDict, total=False): + """A list of reference sentence pairs.""" + + reference_sentence_pairs: Optional[list[SchemaPromptSpecReferenceSentencePairDict]] + """Reference sentence pairs.""" + + +SchemaPromptSpecReferenceSentencePairListOrDict = Union[ + SchemaPromptSpecReferenceSentencePairList, + SchemaPromptSpecReferenceSentencePairListDict, +] + + +class SchemaPromptSpecTranslationFileInputSource(_common.BaseModel): + + content: Optional[str] = Field(default=None, description="""The file's contents.""") + display_name: Optional[str] = Field( + default=None, description="""The file's display name.""" + ) + mime_type: Optional[str] = Field( + default=None, description="""The file's mime type.""" + ) + + +class SchemaPromptSpecTranslationFileInputSourceDict(TypedDict, total=False): + + content: Optional[str] + """The file's contents.""" + + display_name: Optional[str] + """The file's display name.""" + + mime_type: Optional[str] + """The file's mime type.""" + + +SchemaPromptSpecTranslationFileInputSourceOrDict = Union[ + SchemaPromptSpecTranslationFileInputSource, + SchemaPromptSpecTranslationFileInputSourceDict, +] + + +class SchemaPromptSpecTranslationGcsInputSource(_common.BaseModel): + + input_uri: Optional[str] = Field( + default=None, + description="""Source data URI. For example, `gs://my_bucket/my_object`.""", + ) + + +class SchemaPromptSpecTranslationGcsInputSourceDict(TypedDict, total=False): + + input_uri: Optional[str] + """Source data URI. For example, `gs://my_bucket/my_object`.""" + + +SchemaPromptSpecTranslationGcsInputSourceOrDict = Union[ + SchemaPromptSpecTranslationGcsInputSource, + SchemaPromptSpecTranslationGcsInputSourceDict, +] + + +class SchemaPromptSpecTranslationSentenceFileInput(_common.BaseModel): + + file_input_source: Optional[SchemaPromptSpecTranslationFileInputSource] = Field( + default=None, description="""Inlined file source.""" + ) + gcs_input_source: Optional[SchemaPromptSpecTranslationGcsInputSource] = Field( + default=None, description="""Cloud Storage file source.""" + ) + + +class SchemaPromptSpecTranslationSentenceFileInputDict(TypedDict, total=False): + + file_input_source: Optional[SchemaPromptSpecTranslationFileInputSourceDict] + """Inlined file source.""" + + gcs_input_source: Optional[SchemaPromptSpecTranslationGcsInputSourceDict] + """Cloud Storage file source.""" + + +SchemaPromptSpecTranslationSentenceFileInputOrDict = Union[ + SchemaPromptSpecTranslationSentenceFileInput, + SchemaPromptSpecTranslationSentenceFileInputDict, +] + + +class SchemaPromptSpecTranslationExample(_common.BaseModel): + """The translation example that contains reference sentences from various sources.""" + + reference_sentence_pair_lists: Optional[ + list[SchemaPromptSpecReferenceSentencePairList] + ] = Field(default=None, description="""The reference sentences from inline text.""") + reference_sentences_file_inputs: Optional[ + list[SchemaPromptSpecTranslationSentenceFileInput] + ] = Field(default=None, description="""The reference sentences from file.""") + + +class SchemaPromptSpecTranslationExampleDict(TypedDict, total=False): + """The translation example that contains reference sentences from various sources.""" + + reference_sentence_pair_lists: Optional[ + list[SchemaPromptSpecReferenceSentencePairListDict] + ] + """The reference sentences from inline text.""" + + reference_sentences_file_inputs: Optional[ + list[SchemaPromptSpecTranslationSentenceFileInputDict] + ] + """The reference sentences from file.""" + + +SchemaPromptSpecTranslationExampleOrDict = Union[ + SchemaPromptSpecTranslationExample, SchemaPromptSpecTranslationExampleDict +] + + +class SchemaPromptSpecTranslationOption(_common.BaseModel): + """Optional settings for translation prompt.""" + + number_of_shots: Optional[int] = Field( + default=None, description="""How many shots to use.""" + ) + + +class SchemaPromptSpecTranslationOptionDict(TypedDict, total=False): + """Optional settings for translation prompt.""" + + number_of_shots: Optional[int] + """How many shots to use.""" + + +SchemaPromptSpecTranslationOptionOrDict = Union[ + SchemaPromptSpecTranslationOption, SchemaPromptSpecTranslationOptionDict +] + + +class SchemaPromptSpecTranslationPrompt(_common.BaseModel): + """Prompt variation for Translation use case.""" + + example: Optional[SchemaPromptSpecTranslationExample] = Field( + default=None, description="""The translation example.""" + ) + option: Optional[SchemaPromptSpecTranslationOption] = Field( + default=None, description="""The translation option.""" + ) + prompt_message: Optional[SchemaPromptSpecPromptMessage] = Field( + default=None, description="""The prompt message.""" + ) + source_language_code: Optional[str] = Field( + default=None, description="""The source language code.""" + ) + target_language_code: Optional[str] = Field( + default=None, description="""The target language code.""" + ) + + +class SchemaPromptSpecTranslationPromptDict(TypedDict, total=False): + """Prompt variation for Translation use case.""" + + example: Optional[SchemaPromptSpecTranslationExampleDict] + """The translation example.""" + + option: Optional[SchemaPromptSpecTranslationOptionDict] + """The translation option.""" + + prompt_message: Optional[SchemaPromptSpecPromptMessageDict] + """The prompt message.""" + + source_language_code: Optional[str] + """The source language code.""" + + target_language_code: Optional[str] + """The target language code.""" + + +SchemaPromptSpecTranslationPromptOrDict = Union[ + SchemaPromptSpecTranslationPrompt, SchemaPromptSpecTranslationPromptDict +] + + +class SchemaPromptApiSchema(_common.BaseModel): + """The A2 schema of a prompt.""" + + api_schema_version: Optional[str] = Field( + default=None, + description="""The Schema version that represents changes to the API behavior.""", + ) + executions: Optional[list[SchemaPromptInstancePromptExecution]] = Field( + default=None, + description="""A list of execution instances for constructing a ready-to-use prompt.""", + ) + multimodal_prompt: Optional[SchemaPromptSpecMultimodalPrompt] = Field( + default=None, + description="""Multimodal prompt which embeds preambles to prompt string.""", + ) + structured_prompt: Optional[SchemaPromptSpecStructuredPrompt] = Field( + default=None, + description="""The prompt variation that stores preambles in separate fields.""", + ) + translation_prompt: Optional[SchemaPromptSpecTranslationPrompt] = Field( + default=None, description="""The prompt variation for Translation use case.""" + ) + + +class SchemaPromptApiSchemaDict(TypedDict, total=False): + """The A2 schema of a prompt.""" + + api_schema_version: Optional[str] + """The Schema version that represents changes to the API behavior.""" + + executions: Optional[list[SchemaPromptInstancePromptExecutionDict]] + """A list of execution instances for constructing a ready-to-use prompt.""" + + multimodal_prompt: Optional[SchemaPromptSpecMultimodalPromptDict] + """Multimodal prompt which embeds preambles to prompt string.""" + + structured_prompt: Optional[SchemaPromptSpecStructuredPromptDict] + """The prompt variation that stores preambles in separate fields.""" + + translation_prompt: Optional[SchemaPromptSpecTranslationPromptDict] + """The prompt variation for Translation use case.""" + + +SchemaPromptApiSchemaOrDict = Union[SchemaPromptApiSchema, SchemaPromptApiSchemaDict] + + +class SchemaTextPromptDatasetMetadata(_common.BaseModel): + """Represents the text prompt dataset metadata.""" + + candidate_count: Optional[int] = Field( + default=None, description="""Number of candidates.""" + ) + gcs_uri: Optional[str] = Field( + default=None, + description="""The Google Cloud Storage URI that stores the prompt data.""", + ) + grounding_config: Optional[SchemaPredictParamsGroundingConfig] = Field( + default=None, description="""Grounding checking configuration.""" + ) + has_prompt_variable: Optional[bool] = Field( + default=None, description="""Whether the prompt dataset has prompt variable.""" + ) + logprobs: Optional[bool] = Field( + default=None, + description="""Whether or not the user has enabled logit probabilities in the model parameters.""", + ) + max_output_tokens: Optional[int] = Field( + default=None, + description="""Value of the maximum number of tokens generated set when the dataset was saved.""", + ) + note: Optional[str] = Field( + default=None, + description="""User-created prompt note. Note size limit is 2KB.""", + ) + prompt_api_schema: Optional[SchemaPromptApiSchema] = Field( + default=None, + description="""The API schema of the prompt to support both UI and SDK usages.""", + ) + prompt_type: Optional[str] = Field( + default=None, description="""Type of the prompt dataset.""" + ) + seed_enabled: Optional[bool] = Field( + default=None, + description="""Seeding enables model to return a deterministic response on a best effort basis. Determinism isn't guaranteed. This field determines whether or not seeding is enabled.""", + ) + seed_value: Optional[int] = Field( + default=None, description="""The actual value of the seed.""" + ) + stop_sequences: Optional[list[str]] = Field( + default=None, description="""Customized stop sequences.""" + ) + system_instruction: Optional[str] = Field( + default=None, + description="""The content of the prompt dataset system instruction.""", + ) + system_instruction_gcs_uri: Optional[str] = Field( + default=None, + description="""The Google Cloud Storage URI that stores the system instruction, starting with gs://.""", + ) + temperature: Optional[float] = Field( + default=None, + description="""Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.""", + ) + text: Optional[str] = Field( + default=None, description="""The content of the prompt dataset.""" + ) + top_k: Optional[int] = Field( + default=None, + description="""Top K value set when the dataset was saved. This value determines how many candidates with highest probability from the vocab would be selected for each decoding step.""", + ) + top_p: Optional[float] = Field( + default=None, + description="""Top P value set when the dataset was saved. Given topK tokens for decoding, top candidates will be selected until the sum of their probabilities is topP.""", + ) + + +class SchemaTextPromptDatasetMetadataDict(TypedDict, total=False): + """Represents the text prompt dataset metadata.""" + + candidate_count: Optional[int] + """Number of candidates.""" + + gcs_uri: Optional[str] + """The Google Cloud Storage URI that stores the prompt data.""" + + grounding_config: Optional[SchemaPredictParamsGroundingConfigDict] + """Grounding checking configuration.""" + + has_prompt_variable: Optional[bool] + """Whether the prompt dataset has prompt variable.""" - if self.metadata is None: - self.metadata = SchemaTablesDatasetMetadata() - self.metadata.gemini_request_read_config = read_config + logprobs: Optional[bool] + """Whether or not the user has enabled logit probabilities in the model parameters.""" - @property - def bigquery_uri( - self, - ) -> Optional[str]: - """Gets the bigquery uri from the dataset metadata. Returns None if it's not set.""" - if ( - self.metadata is None - or self.metadata.input_config is None - or self.metadata.input_config.bigquery_source is None - ): - return None - return str(self.metadata.input_config.bigquery_source.uri) + max_output_tokens: Optional[int] + """Value of the maximum number of tokens generated set when the dataset was saved.""" - def set_bigquery_uri( - self, - bigquery_uri: str, - ) -> None: - """Sets the bigquery uri in the dataset metadata. Prepends 'bq://' if it's not already present.""" - if not bigquery_uri.startswith("bq://"): - bigquery_uri = f"bq://{bigquery_uri}" - metadata = ( - SchemaTablesDatasetMetadata() if self.metadata is None else self.metadata - ) - input_config = ( - SchemaTablesDatasetMetadataInputConfig() - if metadata.input_config is None - else metadata.input_config - ) - bigquery_source = ( - SchemaTablesDatasetMetadataBigQuerySource() - if input_config.bigquery_source is None - else input_config.bigquery_source - ) - bigquery_source.uri = bigquery_uri - input_config.bigquery_source = bigquery_source - metadata.input_config = input_config - self.metadata = metadata + note: Optional[str] + """User-created prompt note. Note size limit is 2KB.""" - def to_bigframes( - self, - ) -> "bigframes.pandas.DataFrame": # type: ignore # noqa: F821 - """Converts the multimodal dataset to a BigFrames dataframe. + prompt_api_schema: Optional[SchemaPromptApiSchemaDict] + """The API schema of the prompt to support both UI and SDK usages.""" - This is the preferred method to inspect the multimodal dataset in a - notebook. + prompt_type: Optional[str] + """Type of the prompt dataset.""" - Returns: - A BigFrames dataframe. - """ - from .. import _datasets_utils + seed_enabled: Optional[bool] + """Seeding enables model to return a deterministic response on a best effort basis. Determinism isn't guaranteed. This field determines whether or not seeding is enabled.""" - bigframes = _datasets_utils._try_import_bigframes() + seed_value: Optional[int] + """The actual value of the seed.""" - if self.bigquery_uri is None: - raise ValueError("Multimodal dataset bigquery source uri is not set.") - return bigframes.pandas.read_gbq_table(self.bigquery_uri.removeprefix("bq://")) + stop_sequences: Optional[list[str]] + """Customized stop sequences.""" + system_instruction: Optional[str] + """The content of the prompt dataset system instruction.""" -class MultimodalDatasetDict(TypedDict, total=False): - """Represents a multimodal dataset.""" + system_instruction_gcs_uri: Optional[str] + """The Google Cloud Storage URI that stores the system instruction, starting with gs://.""" - name: Optional[str] - """The ID of the multimodal dataset.""" + temperature: Optional[float] + """Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.""" - display_name: Optional[str] - """The display name of the multimodal dataset.""" + text: Optional[str] + """The content of the prompt dataset.""" - metadata: Optional[SchemaTablesDatasetMetadataDict] - """The metadata of the multimodal dataset.""" + top_k: Optional[int] + """Top K value set when the dataset was saved. This value determines how many candidates with highest probability from the vocab would be selected for each decoding step.""" - description: Optional[str] - """The description of the multimodal dataset.""" + top_p: Optional[float] + """Top P value set when the dataset was saved. Given topK tokens for decoding, top candidates will be selected until the sum of their probabilities is topP.""" -MultimodalDatasetOrDict = Union[MultimodalDataset, MultimodalDatasetDict] +SchemaTextPromptDatasetMetadataOrDict = Union[ + SchemaTextPromptDatasetMetadata, SchemaTextPromptDatasetMetadataDict +] -class GetMultimodalDatasetOperationConfig(_common.BaseModel): - """Config for getting a multimodal dataset operation.""" +class CreateDatasetConfig(_common.BaseModel): + """Config for creating a dataset resource to store prompts.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) -class GetMultimodalDatasetOperationConfigDict(TypedDict, total=False): - """Config for getting a multimodal dataset operation.""" +class CreateDatasetConfigDict(TypedDict, total=False): + """Config for creating a dataset resource to store prompts.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" -GetMultimodalDatasetOperationConfigOrDict = Union[ - GetMultimodalDatasetOperationConfig, GetMultimodalDatasetOperationConfigDict -] +CreateDatasetConfigOrDict = Union[CreateDatasetConfig, CreateDatasetConfigDict] -class _GetMultimodalDatasetOperationParameters(_common.BaseModel): - """Parameters for getting a dataset operation.""" +class _CreateDatasetParameters(_common.BaseModel): + """Parameters for creating a dataset resource to store prompts.""" - dataset_id: Optional[str] = Field(default=None, description="""""") - operation_id: Optional[str] = Field(default=None, description="""""") - config: Optional[GetMultimodalDatasetOperationConfig] = Field( + name: Optional[str] = Field(default=None, description="""""") + display_name: Optional[str] = Field(default=None, description="""""") + metadata_schema_uri: Optional[str] = Field(default=None, description="""""") + metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( + default=None, description="""""" + ) + description: Optional[str] = Field(default=None, description="""""") + encryption_spec: Optional[genai_types.EncryptionSpec] = Field( default=None, description="""""" ) + model_reference: Optional[str] = Field(default=None, description="""""") + config: Optional[CreateDatasetConfig] = Field(default=None, description="""""") -class _GetMultimodalDatasetOperationParametersDict(TypedDict, total=False): - """Parameters for getting a dataset operation.""" +class _CreateDatasetParametersDict(TypedDict, total=False): + """Parameters for creating a dataset resource to store prompts.""" - dataset_id: Optional[str] + name: Optional[str] """""" - operation_id: Optional[str] + display_name: Optional[str] """""" - config: Optional[GetMultimodalDatasetOperationConfigDict] + metadata_schema_uri: Optional[str] """""" + metadata: Optional[SchemaTextPromptDatasetMetadataDict] + """""" -_GetMultimodalDatasetOperationParametersOrDict = Union[ - _GetMultimodalDatasetOperationParameters, - _GetMultimodalDatasetOperationParametersDict, -] - - -class ListMultimodalDatasetsConfig(_common.BaseModel): - """Config for listing multimodal datasets.""" - - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( - default=None, - description="""An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""", - ) - - -class ListMultimodalDatasetsConfigDict(TypedDict, total=False): - """Config for listing multimodal datasets.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + description: Optional[str] + """""" - page_size: Optional[int] + encryption_spec: Optional[genai_types.EncryptionSpecDict] """""" - page_token: Optional[str] + model_reference: Optional[str] """""" - filter: Optional[str] - """An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""" + config: Optional[CreateDatasetConfigDict] + """""" -ListMultimodalDatasetsConfigOrDict = Union[ - ListMultimodalDatasetsConfig, ListMultimodalDatasetsConfigDict +_CreateDatasetParametersOrDict = Union[ + _CreateDatasetParameters, _CreateDatasetParametersDict ] -class _ListMultimodalDatasetsRequestParameters(_common.BaseModel): - """Parameters for listing multimodal datasets.""" +class DatasetOperation(_common.BaseModel): + """Represents the create dataset operation.""" - config: Optional[ListMultimodalDatasetsConfig] = Field( - default=None, description="""""" + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) + response: Optional[dict[str, Any]] = Field( + default=None, description="""The result of the dataset operation.""" ) -class _ListMultimodalDatasetsRequestParametersDict(TypedDict, total=False): - """Parameters for listing multimodal datasets.""" +class DatasetOperationDict(TypedDict, total=False): + """Represents the create dataset operation.""" - config: Optional[ListMultimodalDatasetsConfigDict] - """""" + 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}`.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" -_ListMultimodalDatasetsRequestParametersOrDict = Union[ - _ListMultimodalDatasetsRequestParameters, - _ListMultimodalDatasetsRequestParametersDict, -] + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -class ListMultimodalDatasetsResponse(_common.BaseModel): - """Response for listing multimodal datasets.""" + response: Optional[dict[str, Any]] + """The result of the dataset operation.""" - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" - ) - next_page_token: Optional[str] = Field(default=None, description="""""") - timeout: Optional[int] = Field( - default=90, - description="""The timeout for the list datasets request in seconds. If not set, - the default timeout is 90 seconds.""", - ) - datasets: Optional[list[MultimodalDataset]] = Field( - default=None, - description="""List of datasets for the project. - """, - ) +DatasetOperationOrDict = Union[DatasetOperation, DatasetOperationDict] -class ListMultimodalDatasetsResponseDict(TypedDict, total=False): - """Response for listing multimodal datasets.""" - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" +class CreateDatasetVersionConfig(_common.BaseModel): + """Config for creating a dataset version resource to store prompts.""" - next_page_token: Optional[str] - """""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) - timeout: Optional[int] - """The timeout for the list datasets request in seconds. If not set, - the default timeout is 90 seconds.""" - datasets: Optional[list[MultimodalDatasetDict]] - """List of datasets for the project. - """ +class CreateDatasetVersionConfigDict(TypedDict, total=False): + """Config for creating a dataset version resource to store prompts.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -ListMultimodalDatasetsResponseOrDict = Union[ - ListMultimodalDatasetsResponse, ListMultimodalDatasetsResponseDict +CreateDatasetVersionConfigOrDict = Union[ + CreateDatasetVersionConfig, CreateDatasetVersionConfigDict ] -class _UpdateMultimodalDatasetParameters(_common.BaseModel): - """Parameters for updating a multimodal dataset resource.""" +class _CreateDatasetVersionParameters(_common.BaseModel): + """Represents the create dataset version parameters.""" - name: Optional[str] = Field(default=None, description="""""") - display_name: Optional[str] = Field(default=None, description="""""") - metadata: Optional[SchemaTablesDatasetMetadata] = Field( + dataset_name: Optional[str] = Field(default=None, description="""""") + metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( default=None, description="""""" ) - description: Optional[str] = Field(default=None, description="""""") - encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + model_reference: Optional[str] = Field(default=None, description="""""") + parent: Optional[str] = Field(default=None, description="""""") + display_name: Optional[str] = Field(default=None, description="""""") + config: Optional[CreateDatasetVersionConfig] = Field( default=None, description="""""" ) - config: Optional[VertexBaseConfig] = Field(default=None, description="""""") -class _UpdateMultimodalDatasetParametersDict(TypedDict, total=False): - """Parameters for updating a multimodal dataset resource.""" +class _CreateDatasetVersionParametersDict(TypedDict, total=False): + """Represents the create dataset version parameters.""" - name: Optional[str] + dataset_name: Optional[str] """""" - display_name: Optional[str] + metadata: Optional[SchemaTextPromptDatasetMetadataDict] """""" - metadata: Optional[SchemaTablesDatasetMetadataDict] + model_reference: Optional[str] """""" - description: Optional[str] + parent: Optional[str] """""" - encryption_spec: Optional[genai_types.EncryptionSpecDict] + display_name: Optional[str] """""" - config: Optional[VertexBaseConfigDict] + config: Optional[CreateDatasetVersionConfigDict] """""" -_UpdateMultimodalDatasetParametersOrDict = Union[ - _UpdateMultimodalDatasetParameters, _UpdateMultimodalDatasetParametersDict +_CreateDatasetVersionParametersOrDict = Union[ + _CreateDatasetVersionParameters, _CreateDatasetVersionParametersDict ] -class SchemaPredictParamsGroundingConfigSourceEntry(_common.BaseModel): - """Single source entry for the grounding checking.""" - - enterprise_datastore: Optional[str] = Field( - default=None, - description="""The uri of the Vertex AI Search data source. Deprecated. Use vertex_ai_search_datastore instead.""", - ) - inline_context: Optional[str] = Field( - default=None, - description="""The grounding text passed inline with the Predict API. It can support up to 1 million bytes.""", - ) - type: Optional[ - Literal["UNSPECIFIED", "WEB", "ENTERPRISE", "VERTEX_AI_SEARCH", "INLINE"] - ] = Field( - default=None, description="""The type of the grounding checking source.""" - ) - vertex_ai_search_datastore: Optional[str] = Field( - default=None, description="""The uri of the Vertex AI Search data source.""" - ) - +class _GetDatasetParameters(_common.BaseModel): + """Parameters for getting a dataset resource to store prompts.""" -class SchemaPredictParamsGroundingConfigSourceEntryDict(TypedDict, total=False): - """Single source entry for the grounding checking.""" + name: Optional[str] = Field(default=None, description="""""") + config: Optional[VertexBaseConfig] = Field(default=None, description="""""") - enterprise_datastore: Optional[str] - """The uri of the Vertex AI Search data source. Deprecated. Use vertex_ai_search_datastore instead.""" - inline_context: Optional[str] - """The grounding text passed inline with the Predict API. It can support up to 1 million bytes.""" +class _GetDatasetParametersDict(TypedDict, total=False): + """Parameters for getting a dataset resource to store prompts.""" - type: Optional[ - Literal["UNSPECIFIED", "WEB", "ENTERPRISE", "VERTEX_AI_SEARCH", "INLINE"] - ] - """The type of the grounding checking source.""" + name: Optional[str] + """""" - vertex_ai_search_datastore: Optional[str] - """The uri of the Vertex AI Search data source.""" + config: Optional[VertexBaseConfigDict] + """""" -SchemaPredictParamsGroundingConfigSourceEntryOrDict = Union[ - SchemaPredictParamsGroundingConfigSourceEntry, - SchemaPredictParamsGroundingConfigSourceEntryDict, -] +_GetDatasetParametersOrDict = Union[_GetDatasetParameters, _GetDatasetParametersDict] -class SchemaPredictParamsGroundingConfig(_common.BaseModel): - """The configuration for grounding checking.""" +class SavedQuery(_common.BaseModel): + """A SavedQuery is a view of the dataset. It references a subset of annotations by problem type and filters.""" - disable_attribution: Optional[bool] = Field( + annotation_filter: Optional[str] = Field( default=None, - description="""If set, skip finding claim attributions (i.e not generate grounding citation).""", - ) - sources: Optional[list[SchemaPredictParamsGroundingConfigSourceEntry]] = Field( - default=None, description="""The sources for the grounding checking.""" + description="""Output only. Filters on the Annotations in the dataset.""", ) - - -class SchemaPredictParamsGroundingConfigDict(TypedDict, total=False): - """The configuration for grounding checking.""" - - disable_attribution: Optional[bool] - """If set, skip finding claim attributions (i.e not generate grounding citation).""" - - sources: Optional[list[SchemaPredictParamsGroundingConfigSourceEntryDict]] - """The sources for the grounding checking.""" - - -SchemaPredictParamsGroundingConfigOrDict = Union[ - SchemaPredictParamsGroundingConfig, SchemaPredictParamsGroundingConfigDict -] - - -class SchemaPromptInstancePromptExecution(_common.BaseModel): - """A prompt instance's parameters set that contains a set of variable values.""" - - arguments: Optional[dict[str, "SchemaPromptInstanceVariableValue"]] = Field( - default=None, description="""Maps variable names to their value.""" + annotation_spec_count: Optional[int] = Field( + default=None, + description="""Output only. Number of AnnotationSpecs in the context of the SavedQuery.""", ) - - -class SchemaPromptInstancePromptExecutionDict(TypedDict, total=False): - """A prompt instance's parameters set that contains a set of variable values.""" - - arguments: Optional[dict[str, "SchemaPromptInstanceVariableValueDict"]] - """Maps variable names to their value.""" - - -SchemaPromptInstancePromptExecutionOrDict = Union[ - SchemaPromptInstancePromptExecution, SchemaPromptInstancePromptExecutionDict -] - - -class SchemaPromptSpecPromptMessage(_common.BaseModel): - """Represents a prompt message.""" - - generation_config: Optional[genai_types.GenerationConfig] = Field( - default=None, description="""Generation config.""" + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this SavedQuery was created.""", ) - tool_config: Optional[genai_types.FunctionCallingConfig] = Field( + display_name: Optional[str] = Field( default=None, - description="""Tool config. This config is shared for all tools provided in the request.""", + description="""Required. The user-defined name of the SavedQuery. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", ) - tools: Optional[list[genai_types.Tool]] = Field( + etag: Optional[str] = Field( default=None, - description="""A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.""", + description="""Used to perform a consistent read-modify-write update. If not set, a blind "overwrite" update happens.""", ) - safety_settings: Optional[list[genai_types.SafetySetting]] = Field( + metadata: Optional[Any] = Field( default=None, - description="""Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.""", + description="""Some additional information about the SavedQuery.""", ) - contents: Optional[list[genai_types.Content]] = Field( + name: Optional[str] = Field( + default=None, description="""Output only. Resource name of the SavedQuery.""" + ) + problem_type: Optional[str] = Field( default=None, - description="""The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.""", + description="""Required. Problem type of the SavedQuery. Allowed values: * IMAGE_CLASSIFICATION_SINGLE_LABEL * IMAGE_CLASSIFICATION_MULTI_LABEL * IMAGE_BOUNDING_POLY * IMAGE_BOUNDING_BOX * TEXT_CLASSIFICATION_SINGLE_LABEL * TEXT_CLASSIFICATION_MULTI_LABEL * TEXT_EXTRACTION * TEXT_SENTIMENT * VIDEO_CLASSIFICATION * VIDEO_OBJECT_TRACKING""", ) - system_instruction: Optional[genai_types.Content] = Field( + support_automl_training: Optional[bool] = Field( default=None, - description="""The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.""", + description="""Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training.""", ) - variables: Optional[list[dict[str, genai_types.Part]]] = Field( - default=None, description="""""" + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when SavedQuery was last updated.""", ) - model: Optional[str] = Field(default=None, description="""The model name.""") - - -class SchemaPromptSpecPromptMessageDict(TypedDict, total=False): - """Represents a prompt message.""" - - generation_config: Optional[genai_types.GenerationConfigDict] - """Generation config.""" - - tool_config: Optional[genai_types.FunctionCallingConfigDict] - """Tool config. This config is shared for all tools provided in the request.""" - - tools: Optional[list[genai_types.ToolDict]] - """A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.""" - safety_settings: Optional[list[genai_types.SafetySettingDict]] - """Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.""" - - contents: Optional[list[genai_types.ContentDict]] - """The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.""" - system_instruction: Optional[genai_types.ContentDict] - """The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.""" +class SavedQueryDict(TypedDict, total=False): + """A SavedQuery is a view of the dataset. It references a subset of annotations by problem type and filters.""" - variables: Optional[list[dict[str, genai_types.PartDict]]] - """""" + annotation_filter: Optional[str] + """Output only. Filters on the Annotations in the dataset.""" - model: Optional[str] - """The model name.""" + annotation_spec_count: Optional[int] + """Output only. Number of AnnotationSpecs in the context of the SavedQuery.""" + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this SavedQuery was created.""" -SchemaPromptSpecPromptMessageOrDict = Union[ - SchemaPromptSpecPromptMessage, SchemaPromptSpecPromptMessageDict -] + display_name: Optional[str] + """Required. The user-defined name of the SavedQuery. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" + etag: Optional[str] + """Used to perform a consistent read-modify-write update. If not set, a blind "overwrite" update happens.""" -class SchemaPromptSpecMultimodalPrompt(_common.BaseModel): - """Prompt variation that embeds preambles to prompt string.""" + metadata: Optional[Any] + """Some additional information about the SavedQuery.""" - prompt_message: Optional[SchemaPromptSpecPromptMessage] = Field( - default=None, description="""The prompt message.""" - ) + name: Optional[str] + """Output only. Resource name of the SavedQuery.""" + problem_type: Optional[str] + """Required. Problem type of the SavedQuery. Allowed values: * IMAGE_CLASSIFICATION_SINGLE_LABEL * IMAGE_CLASSIFICATION_MULTI_LABEL * IMAGE_BOUNDING_POLY * IMAGE_BOUNDING_BOX * TEXT_CLASSIFICATION_SINGLE_LABEL * TEXT_CLASSIFICATION_MULTI_LABEL * TEXT_EXTRACTION * TEXT_SENTIMENT * VIDEO_CLASSIFICATION * VIDEO_OBJECT_TRACKING""" -class SchemaPromptSpecMultimodalPromptDict(TypedDict, total=False): - """Prompt variation that embeds preambles to prompt string.""" + support_automl_training: Optional[bool] + """Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training.""" - prompt_message: Optional[SchemaPromptSpecPromptMessageDict] - """The prompt message.""" + update_time: Optional[datetime.datetime] + """Output only. Timestamp when SavedQuery was last updated.""" -SchemaPromptSpecMultimodalPromptOrDict = Union[ - SchemaPromptSpecMultimodalPrompt, SchemaPromptSpecMultimodalPromptDict -] +SavedQueryOrDict = Union[SavedQuery, SavedQueryDict] -class SchemaPromptSpecAppBuilderDataLinkedResource(_common.BaseModel): - """A linked resource attached to the application by the user.""" +class Dataset(_common.BaseModel): + """Represents a dataset resource to store prompts.""" + metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( + default=None, + description="""Required. Additional information about the Dataset.""", + ) + encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + default=None, + description="""Customer-managed encryption key spec for a Dataset. If set, this Dataset and all sub-resources of this Dataset will be secured by this key.""", + ) + create_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this Dataset was created.""", + ) + data_item_count: Optional[int] = Field( + default=None, + description="""Output only. The number of DataItems in this Dataset. Only apply for non-structured Dataset.""", + ) + description: Optional[str] = Field( + default=None, description="""The description of the Dataset.""" + ) display_name: Optional[str] = Field( default=None, - description="""A user-friendly name for the data source shown in the UI.""", + description="""Required. The user-defined name of the Dataset. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", + ) + etag: Optional[str] = Field( + default=None, + description="""Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""", + ) + labels: Optional[dict[str, str]] = Field( + default=None, + description="""The labels with user-defined metadata to organize your Datasets. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one Dataset (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. Following system labels exist for each Dataset: * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its value is the metadata_schema's title.""", + ) + metadata_artifact: Optional[str] = Field( + default=None, + description="""Output only. The resource name of the Artifact that was created in MetadataStore when creating the Dataset. The Artifact resource name pattern is `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.""", + ) + metadata_schema_uri: Optional[str] = Field( + default=None, + description="""Required. Points to a YAML file stored on Google Cloud Storage describing additional information about the Dataset. The schema is defined as an OpenAPI 3.0.2 Schema Object. The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/metadata/.""", + ) + model_reference: Optional[str] = Field( + default=None, + description="""Optional. Reference to the public base model last used by the dataset. Only set for prompt datasets.""", ) name: Optional[str] = Field( default=None, - description="""The unique resource name of the data source. The format is determined by the 'type' field. For type "SAVED_PROMPT": projects/{project}/locations/{location}/datasets/{dataset} For type "AI_AGENT": projects/{project}/locations/{location}/agents/{agent}""", + description="""Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`""", ) - type: Optional[str] = Field( + satisfies_pzi: Optional[bool] = Field( + default=None, description="""Output only. Reserved for future use.""" + ) + satisfies_pzs: Optional[bool] = Field( + default=None, description="""Output only. Reserved for future use.""" + ) + saved_queries: Optional[list[SavedQuery]] = Field( default=None, - description="""The type of the linked resource. e.g., "SAVED_PROMPT", "AI_AGENT" This string corresponds to the name of the LinkedResourceType enum member. See: google3/cloud/console/web/ai/platform/llm/prompts/build/services/specs_repository_service/linked_resources/linked_resource.ts""", + description="""All SavedQueries belong to the Dataset will be returned in List/Get Dataset response. The annotation_specs field will not be populated except for UI cases which will only use annotation_spec_count. In CreateDataset request, a SavedQuery is created together if this field is set, up to one SavedQuery can be set in CreateDatasetRequest. The SavedQuery should not contain any AnnotationSpec.""", + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this Dataset was last updated.""", ) + # TODO(b/448806531): Remove all the overridden _from_response methods once the + # ticket is resolved and published. + @classmethod + def _from_response( + cls: typing.Type["Dataset"], + *, + response: dict[str, object], + kwargs: dict[str, object], + ) -> "Dataset": + """Converts a dictionary response into a Dataset object.""" -class SchemaPromptSpecAppBuilderDataLinkedResourceDict(TypedDict, total=False): - """A linked resource attached to the application by the user.""" - - display_name: Optional[str] - """A user-friendly name for the data source shown in the UI.""" + response = _camel_key_to_snake(response) + result = super()._from_response(response=response, kwargs=kwargs) + return result - name: Optional[str] - """The unique resource name of the data source. The format is determined by the 'type' field. For type "SAVED_PROMPT": projects/{project}/locations/{location}/datasets/{dataset} For type "AI_AGENT": projects/{project}/locations/{location}/agents/{agent}""" - type: Optional[str] - """The type of the linked resource. e.g., "SAVED_PROMPT", "AI_AGENT" This string corresponds to the name of the LinkedResourceType enum member. See: google3/cloud/console/web/ai/platform/llm/prompts/build/services/specs_repository_service/linked_resources/linked_resource.ts""" +class DatasetDict(TypedDict, total=False): + """Represents a dataset resource to store prompts.""" + metadata: Optional[SchemaTextPromptDatasetMetadataDict] + """Required. Additional information about the Dataset.""" -SchemaPromptSpecAppBuilderDataLinkedResourceOrDict = Union[ - SchemaPromptSpecAppBuilderDataLinkedResource, - SchemaPromptSpecAppBuilderDataLinkedResourceDict, -] + encryption_spec: Optional[genai_types.EncryptionSpecDict] + """Customer-managed encryption key spec for a Dataset. If set, this Dataset and all sub-resources of this Dataset will be secured by this key.""" + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this Dataset was created.""" -class SchemaPromptSpecAppBuilderData(_common.BaseModel): - """Defines data for an application builder.""" + data_item_count: Optional[int] + """Output only. The number of DataItems in this Dataset. Only apply for non-structured Dataset.""" - code_repository_state: Optional[str] = Field( - default=None, - description="""Serialized state of the code repository. This string will typically contain a JSON representation of the UI's CodeRepositoryService state (files, folders, content, and any metadata). The UI is responsible for serialization and deserialization.""", - ) - framework: Optional[Framework] = Field( - default=None, - description="""Optional. Framework used to build the application.""", - ) - linked_resources: Optional[list[SchemaPromptSpecAppBuilderDataLinkedResource]] = ( - Field( - default=None, - description="""Linked resources attached to the application by the user.""", - ) - ) + description: Optional[str] + """The description of the Dataset.""" + display_name: Optional[str] + """Required. The user-defined name of the Dataset. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" -class SchemaPromptSpecAppBuilderDataDict(TypedDict, total=False): - """Defines data for an application builder.""" + etag: Optional[str] + """Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""" - code_repository_state: Optional[str] - """Serialized state of the code repository. This string will typically contain a JSON representation of the UI's CodeRepositoryService state (files, folders, content, and any metadata). The UI is responsible for serialization and deserialization.""" + labels: Optional[dict[str, str]] + """The labels with user-defined metadata to organize your Datasets. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one Dataset (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. Following system labels exist for each Dataset: * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its value is the metadata_schema's title.""" - framework: Optional[Framework] - """Optional. Framework used to build the application.""" + metadata_artifact: Optional[str] + """Output only. The resource name of the Artifact that was created in MetadataStore when creating the Dataset. The Artifact resource name pattern is `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.""" - linked_resources: Optional[list[SchemaPromptSpecAppBuilderDataLinkedResourceDict]] - """Linked resources attached to the application by the user.""" + metadata_schema_uri: Optional[str] + """Required. Points to a YAML file stored on Google Cloud Storage describing additional information about the Dataset. The schema is defined as an OpenAPI 3.0.2 Schema Object. The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/metadata/.""" + model_reference: Optional[str] + """Optional. Reference to the public base model last used by the dataset. Only set for prompt datasets.""" -SchemaPromptSpecAppBuilderDataOrDict = Union[ - SchemaPromptSpecAppBuilderData, SchemaPromptSpecAppBuilderDataDict -] + name: Optional[str] + """Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`""" + satisfies_pzi: Optional[bool] + """Output only. Reserved for future use.""" -class SchemaPromptSpecPartList(_common.BaseModel): - """Represents a prompt spec part list.""" + satisfies_pzs: Optional[bool] + """Output only. Reserved for future use.""" - parts: Optional[list[genai_types.Part]] = Field( - default=None, description="""A list of elements that can be part of a prompt.""" - ) + saved_queries: Optional[list[SavedQueryDict]] + """All SavedQueries belong to the Dataset will be returned in List/Get Dataset response. The annotation_specs field will not be populated except for UI cases which will only use annotation_spec_count. In CreateDataset request, a SavedQuery is created together if this field is set, up to one SavedQuery can be set in CreateDatasetRequest. The SavedQuery should not contain any AnnotationSpec.""" + update_time: Optional[datetime.datetime] + """Output only. Timestamp when this Dataset was last updated.""" -class SchemaPromptSpecPartListDict(TypedDict, total=False): - """Represents a prompt spec part list.""" - parts: Optional[list[genai_types.PartDict]] - """A list of elements that can be part of a prompt.""" +DatasetOrDict = Union[Dataset, DatasetDict] -SchemaPromptSpecPartListOrDict = Union[ - SchemaPromptSpecPartList, SchemaPromptSpecPartListDict -] +class _GetDatasetVersionParameters(_common.BaseModel): + """Parameters for getting a dataset resource to store prompts.""" + dataset_id: Optional[str] = Field(default=None, description="""""") + dataset_version_id: Optional[str] = Field(default=None, description="""""") + config: Optional[VertexBaseConfig] = Field(default=None, description="""""") -class SchemaPromptSpecInteractionData(_common.BaseModel): - """Defines data for an interaction prompt.""" - interaction_ids: Optional[list[str]] = Field( - default=None, - description="""Optional. Lists interaction IDs associated with the prompt. This maps 1:1 to PromptMessage.contents. If InteractionData is present, every prompt message has an interaction ID.""", - ) +class _GetDatasetVersionParametersDict(TypedDict, total=False): + """Parameters for getting a dataset resource to store prompts.""" + dataset_id: Optional[str] + """""" -class SchemaPromptSpecInteractionDataDict(TypedDict, total=False): - """Defines data for an interaction prompt.""" + dataset_version_id: Optional[str] + """""" - interaction_ids: Optional[list[str]] - """Optional. Lists interaction IDs associated with the prompt. This maps 1:1 to PromptMessage.contents. If InteractionData is present, every prompt message has an interaction ID.""" + config: Optional[VertexBaseConfigDict] + """""" -SchemaPromptSpecInteractionDataOrDict = Union[ - SchemaPromptSpecInteractionData, SchemaPromptSpecInteractionDataDict +_GetDatasetVersionParametersOrDict = Union[ + _GetDatasetVersionParameters, _GetDatasetVersionParametersDict ] -class SchemaPromptSpecStructuredPrompt(_common.BaseModel): - """Represents a structured prompt.""" +class DatasetVersion(_common.BaseModel): + """Represents a dataset version resource to store prompts.""" - context: Optional[genai_types.Content] = Field( - default=None, description="""Preamble: The context of the prompt.""" - ) - app_builder_data: Optional[SchemaPromptSpecAppBuilderData] = Field( - default=None, description="""Data for app builder use case.""" + metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( + default=None, + description="""Required. Output only. Additional information about the DatasetVersion.""", ) - examples: Optional[list[SchemaPromptSpecPartList]] = Field( + big_query_dataset_name: Optional[str] = Field( default=None, - description="""Preamble: A set of examples for expected model response.""", + description="""Output only. Name of the associated BigQuery dataset.""", ) - infill_prefix: Optional[str] = Field( + create_time: Optional[datetime.datetime] = Field( default=None, - description="""Preamble: For infill prompt, the prefix before expected model response.""", + description="""Output only. Timestamp when this DatasetVersion was created.""", ) - infill_suffix: Optional[str] = Field( + display_name: Optional[str] = Field( default=None, - description="""Preamble: For infill prompt, the suffix after expected model response.""", + description="""The user-defined name of the DatasetVersion. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", ) - input_prefixes: Optional[list[str]] = Field( + etag: Optional[str] = Field( default=None, - description="""Preamble: The input prefixes before each example input.""", + description="""Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""", ) - output_prefixes: Optional[list[str]] = Field( + model_reference: Optional[str] = Field( default=None, - description="""Preamble: The output prefixes before each example output.""", + description="""Output only. Reference to the public base model last used by the dataset version. Only set for prompt dataset versions.""", ) - prediction_inputs: Optional[list[SchemaPromptSpecPartList]] = Field( + name: Optional[str] = Field( default=None, - description="""Preamble: The input test data for prediction. Each PartList in this field represents one text-only input set for a single model request.""", + description="""Output only. Identifier. The resource name of the DatasetVersion. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`""", ) - prompt_message: Optional[SchemaPromptSpecPromptMessage] = Field( - default=None, description="""The prompt message.""" + satisfies_pzi: Optional[bool] = Field( + default=None, description="""Output only. Reserved for future use.""" ) - interaction_data: Optional[SchemaPromptSpecInteractionData] = Field( - default=None, description="""Data for interaction use case.""" + satisfies_pzs: Optional[bool] = Field( + default=None, description="""Output only. Reserved for future use.""" + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this DatasetVersion was last updated.""", ) + # TODO(b/448806531): Remove all the overridden _from_response methods once the + # ticket is resolved and published. + @classmethod + def _from_response( + cls: typing.Type["DatasetVersion"], + *, + response: dict[str, object], + kwargs: dict[str, object], + ) -> "DatasetVersion": + """Converts a dictionary response into a DatasetVersion object.""" + + response = _camel_key_to_snake(response) + result = super()._from_response(response=response, kwargs=kwargs) + return result + + +class DatasetVersionDict(TypedDict, total=False): + """Represents a dataset version resource to store prompts.""" + + metadata: Optional[SchemaTextPromptDatasetMetadataDict] + """Required. Output only. Additional information about the DatasetVersion.""" + + big_query_dataset_name: Optional[str] + """Output only. Name of the associated BigQuery dataset.""" + + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this DatasetVersion was created.""" + + display_name: Optional[str] + """The user-defined name of the DatasetVersion. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" + + etag: Optional[str] + """Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""" + + model_reference: Optional[str] + """Output only. Reference to the public base model last used by the dataset version. Only set for prompt dataset versions.""" + + name: Optional[str] + """Output only. Identifier. The resource name of the DatasetVersion. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`""" -class SchemaPromptSpecStructuredPromptDict(TypedDict, total=False): - """Represents a structured prompt.""" + satisfies_pzi: Optional[bool] + """Output only. Reserved for future use.""" - context: Optional[genai_types.ContentDict] - """Preamble: The context of the prompt.""" + satisfies_pzs: Optional[bool] + """Output only. Reserved for future use.""" - app_builder_data: Optional[SchemaPromptSpecAppBuilderDataDict] - """Data for app builder use case.""" + update_time: Optional[datetime.datetime] + """Output only. Timestamp when this DatasetVersion was last updated.""" - examples: Optional[list[SchemaPromptSpecPartListDict]] - """Preamble: A set of examples for expected model response.""" - infill_prefix: Optional[str] - """Preamble: For infill prompt, the prefix before expected model response.""" +DatasetVersionOrDict = Union[DatasetVersion, DatasetVersionDict] - infill_suffix: Optional[str] - """Preamble: For infill prompt, the suffix after expected model response.""" - input_prefixes: Optional[list[str]] - """Preamble: The input prefixes before each example input.""" +class GetDatasetOperationConfig(_common.BaseModel): + """Config for getting a dataset version operation.""" - output_prefixes: Optional[list[str]] - """Preamble: The output prefixes before each example output.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) - prediction_inputs: Optional[list[SchemaPromptSpecPartListDict]] - """Preamble: The input test data for prediction. Each PartList in this field represents one text-only input set for a single model request.""" - prompt_message: Optional[SchemaPromptSpecPromptMessageDict] - """The prompt message.""" +class GetDatasetOperationConfigDict(TypedDict, total=False): + """Config for getting a dataset version operation.""" - interaction_data: Optional[SchemaPromptSpecInteractionDataDict] - """Data for interaction use case.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -SchemaPromptSpecStructuredPromptOrDict = Union[ - SchemaPromptSpecStructuredPrompt, SchemaPromptSpecStructuredPromptDict +GetDatasetOperationConfigOrDict = Union[ + GetDatasetOperationConfig, GetDatasetOperationConfigDict ] -class SchemaPromptSpecReferenceSentencePair(_common.BaseModel): - """A pair of sentences used as reference in source and target languages.""" +class _GetDatasetOperationParameters(_common.BaseModel): + """Parameters for getting a dataset operation.""" - source_sentence: Optional[str] = Field( - default=None, description="""Source sentence in the sentence pair.""" - ) - target_sentence: Optional[str] = Field( - default=None, description="""Target sentence in the sentence pair.""" + dataset_id: Optional[str] = Field(default=None, description="""""") + operation_id: Optional[str] = Field(default=None, description="""""") + config: Optional[GetDatasetOperationConfig] = Field( + default=None, description="""""" ) -class SchemaPromptSpecReferenceSentencePairDict(TypedDict, total=False): - """A pair of sentences used as reference in source and target languages.""" +class _GetDatasetOperationParametersDict(TypedDict, total=False): + """Parameters for getting a dataset operation.""" - source_sentence: Optional[str] - """Source sentence in the sentence pair.""" + dataset_id: Optional[str] + """""" - target_sentence: Optional[str] - """Target sentence in the sentence pair.""" + operation_id: Optional[str] + """""" + + config: Optional[GetDatasetOperationConfigDict] + """""" -SchemaPromptSpecReferenceSentencePairOrDict = Union[ - SchemaPromptSpecReferenceSentencePair, SchemaPromptSpecReferenceSentencePairDict +_GetDatasetOperationParametersOrDict = Union[ + _GetDatasetOperationParameters, _GetDatasetOperationParametersDict ] -class SchemaPromptSpecReferenceSentencePairList(_common.BaseModel): - """A list of reference sentence pairs.""" +class ListPromptsConfig(_common.BaseModel): + """Config for listing prompt datasets and dataset versions.""" - reference_sentence_pairs: Optional[list[SchemaPromptSpecReferenceSentencePair]] = ( - Field(default=None, description="""Reference sentence pairs.""") + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, + description="""An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""", ) -class SchemaPromptSpecReferenceSentencePairListDict(TypedDict, total=False): - """A list of reference sentence pairs.""" +class ListPromptsConfigDict(TypedDict, total=False): + """Config for listing prompt datasets and dataset versions.""" - reference_sentence_pairs: Optional[list[SchemaPromptSpecReferenceSentencePairDict]] - """Reference sentence pairs.""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + page_size: Optional[int] + """""" -SchemaPromptSpecReferenceSentencePairListOrDict = Union[ - SchemaPromptSpecReferenceSentencePairList, - SchemaPromptSpecReferenceSentencePairListDict, -] + page_token: Optional[str] + """""" + filter: Optional[str] + """An expression for filtering the results of the request. + For field names both snake_case and camelCase are supported.""" -class SchemaPromptSpecTranslationFileInputSource(_common.BaseModel): - content: Optional[str] = Field(default=None, description="""The file's contents.""") - display_name: Optional[str] = Field( - default=None, description="""The file's display name.""" - ) - mime_type: Optional[str] = Field( - default=None, description="""The file's mime type.""" - ) +ListPromptsConfigOrDict = Union[ListPromptsConfig, ListPromptsConfigDict] -class SchemaPromptSpecTranslationFileInputSourceDict(TypedDict, total=False): +class _ListDatasetsRequestParameters(_common.BaseModel): + """Parameters for listing prompt datasets.""" - content: Optional[str] - """The file's contents.""" + config: Optional[ListPromptsConfig] = Field(default=None, description="""""") - display_name: Optional[str] - """The file's display name.""" - mime_type: Optional[str] - """The file's mime type.""" +class _ListDatasetsRequestParametersDict(TypedDict, total=False): + """Parameters for listing prompt datasets.""" + config: Optional[ListPromptsConfigDict] + """""" -SchemaPromptSpecTranslationFileInputSourceOrDict = Union[ - SchemaPromptSpecTranslationFileInputSource, - SchemaPromptSpecTranslationFileInputSourceDict, + +_ListDatasetsRequestParametersOrDict = Union[ + _ListDatasetsRequestParameters, _ListDatasetsRequestParametersDict ] -class SchemaPromptSpecTranslationGcsInputSource(_common.BaseModel): +class ListDatasetsResponse(_common.BaseModel): + """Response for listing prompt datasets.""" - input_uri: Optional[str] = Field( + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + datasets: Optional[list[Dataset]] = Field( default=None, - description="""Source data URI. For example, `gs://my_bucket/my_object`.""", + description="""List of datasets for the project. + """, ) + # TODO(b/448806531): Remove all the overridden _from_response methods once the + # ticket is resolved and published. + @classmethod + def _from_response( + cls: typing.Type["ListDatasetsResponse"], + *, + response: dict[str, object], + kwargs: dict[str, object], + ) -> "ListDatasetsResponse": + """Converts a dictionary response into a ListDatasetsResponse object.""" -class SchemaPromptSpecTranslationGcsInputSourceDict(TypedDict, total=False): + response = _camel_key_to_snake(response) + result = super()._from_response(response=response, kwargs=kwargs) + return result - input_uri: Optional[str] - """Source data URI. For example, `gs://my_bucket/my_object`.""" +class ListDatasetsResponseDict(TypedDict, total=False): + """Response for listing prompt datasets.""" -SchemaPromptSpecTranslationGcsInputSourceOrDict = Union[ - SchemaPromptSpecTranslationGcsInputSource, - SchemaPromptSpecTranslationGcsInputSourceDict, -] + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" + next_page_token: Optional[str] + """""" -class SchemaPromptSpecTranslationSentenceFileInput(_common.BaseModel): + datasets: Optional[list[DatasetDict]] + """List of datasets for the project. + """ - file_input_source: Optional[SchemaPromptSpecTranslationFileInputSource] = Field( - default=None, description="""Inlined file source.""" - ) - gcs_input_source: Optional[SchemaPromptSpecTranslationGcsInputSource] = Field( - default=None, description="""Cloud Storage file source.""" - ) +ListDatasetsResponseOrDict = Union[ListDatasetsResponse, ListDatasetsResponseDict] -class SchemaPromptSpecTranslationSentenceFileInputDict(TypedDict, total=False): - file_input_source: Optional[SchemaPromptSpecTranslationFileInputSourceDict] - """Inlined file source.""" +class _ListDatasetVersionsRequestParameters(_common.BaseModel): + """Parameters for listing dataset versions.""" - gcs_input_source: Optional[SchemaPromptSpecTranslationGcsInputSourceDict] - """Cloud Storage file source.""" + read_mask: Optional[str] = Field(default=None, description="""""") + dataset_id: Optional[str] = Field(default=None, description="""""") + config: Optional[ListPromptsConfig] = Field(default=None, description="""""") -SchemaPromptSpecTranslationSentenceFileInputOrDict = Union[ - SchemaPromptSpecTranslationSentenceFileInput, - SchemaPromptSpecTranslationSentenceFileInputDict, +class _ListDatasetVersionsRequestParametersDict(TypedDict, total=False): + """Parameters for listing dataset versions.""" + + read_mask: Optional[str] + """""" + + dataset_id: Optional[str] + """""" + + config: Optional[ListPromptsConfigDict] + """""" + + +_ListDatasetVersionsRequestParametersOrDict = Union[ + _ListDatasetVersionsRequestParameters, _ListDatasetVersionsRequestParametersDict ] -class SchemaPromptSpecTranslationExample(_common.BaseModel): - """The translation example that contains reference sentences from various sources.""" +class ListDatasetVersionsResponse(_common.BaseModel): + """Response for listing prompt datasets.""" - reference_sentence_pair_lists: Optional[ - list[SchemaPromptSpecReferenceSentencePairList] - ] = Field(default=None, description="""The reference sentences from inline text.""") - reference_sentences_file_inputs: Optional[ - list[SchemaPromptSpecTranslationSentenceFileInput] - ] = Field(default=None, description="""The reference sentences from file.""") + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" + ) + next_page_token: Optional[str] = Field(default=None, description="""""") + dataset_versions: Optional[list[DatasetVersion]] = Field( + default=None, + description="""List of datasets for the project. + """, + ) + + # TODO(b/448806531): Remove all the overridden _from_response methods once the + # ticket is resolved and published. + @classmethod + def _from_response( + cls: typing.Type["ListDatasetVersionsResponse"], + *, + response: dict[str, object], + kwargs: dict[str, object], + ) -> "ListDatasetVersionsResponse": + """Converts a dictionary response into a ListDatasetVersionsResponse object.""" + response = _camel_key_to_snake(response) + result = super()._from_response(response=response, kwargs=kwargs) + return result -class SchemaPromptSpecTranslationExampleDict(TypedDict, total=False): - """The translation example that contains reference sentences from various sources.""" - reference_sentence_pair_lists: Optional[ - list[SchemaPromptSpecReferenceSentencePairListDict] - ] - """The reference sentences from inline text.""" +class ListDatasetVersionsResponseDict(TypedDict, total=False): + """Response for listing prompt datasets.""" + + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" - reference_sentences_file_inputs: Optional[ - list[SchemaPromptSpecTranslationSentenceFileInputDict] - ] - """The reference sentences from file.""" + next_page_token: Optional[str] + """""" + dataset_versions: Optional[list[DatasetVersionDict]] + """List of datasets for the project. + """ -SchemaPromptSpecTranslationExampleOrDict = Union[ - SchemaPromptSpecTranslationExample, SchemaPromptSpecTranslationExampleDict + +ListDatasetVersionsResponseOrDict = Union[ + ListDatasetVersionsResponse, ListDatasetVersionsResponseDict ] -class SchemaPromptSpecTranslationOption(_common.BaseModel): - """Optional settings for translation prompt.""" +class DeletePromptConfig(_common.BaseModel): + """Config for deleting a prompt.""" - number_of_shots: Optional[int] = Field( - default=None, description="""How many shots to use.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + timeout: Optional[int] = Field( + default=90, + description="""Timeout for the delete prompt operation in seconds. Defaults to 90.""", ) -class SchemaPromptSpecTranslationOptionDict(TypedDict, total=False): - """Optional settings for translation prompt.""" - - number_of_shots: Optional[int] - """How many shots to use.""" - +class DeletePromptConfigDict(TypedDict, total=False): + """Config for deleting a prompt.""" -SchemaPromptSpecTranslationOptionOrDict = Union[ - SchemaPromptSpecTranslationOption, SchemaPromptSpecTranslationOptionDict -] + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + timeout: Optional[int] + """Timeout for the delete prompt operation in seconds. Defaults to 90.""" -class SchemaPromptSpecTranslationPrompt(_common.BaseModel): - """Prompt variation for Translation use case.""" - example: Optional[SchemaPromptSpecTranslationExample] = Field( - default=None, description="""The translation example.""" - ) - option: Optional[SchemaPromptSpecTranslationOption] = Field( - default=None, description="""The translation option.""" - ) - prompt_message: Optional[SchemaPromptSpecPromptMessage] = Field( - default=None, description="""The prompt message.""" - ) - source_language_code: Optional[str] = Field( - default=None, description="""The source language code.""" - ) - target_language_code: Optional[str] = Field( - default=None, description="""The target language code.""" - ) +DeletePromptConfigOrDict = Union[DeletePromptConfig, DeletePromptConfigDict] -class SchemaPromptSpecTranslationPromptDict(TypedDict, total=False): - """Prompt variation for Translation use case.""" +class _DeleteDatasetRequestParameters(_common.BaseModel): + """Parameters for deleting a prompt dataset.""" - example: Optional[SchemaPromptSpecTranslationExampleDict] - """The translation example.""" + prompt_id: Optional[str] = Field( + default=None, description="""ID of the prompt dataset to be deleted.""" + ) + config: Optional[DeletePromptConfig] = Field(default=None, description="""""") - option: Optional[SchemaPromptSpecTranslationOptionDict] - """The translation option.""" - prompt_message: Optional[SchemaPromptSpecPromptMessageDict] - """The prompt message.""" +class _DeleteDatasetRequestParametersDict(TypedDict, total=False): + """Parameters for deleting a prompt dataset.""" - source_language_code: Optional[str] - """The source language code.""" + prompt_id: Optional[str] + """ID of the prompt dataset to be deleted.""" - target_language_code: Optional[str] - """The target language code.""" + config: Optional[DeletePromptConfigDict] + """""" -SchemaPromptSpecTranslationPromptOrDict = Union[ - SchemaPromptSpecTranslationPrompt, SchemaPromptSpecTranslationPromptDict +_DeleteDatasetRequestParametersOrDict = Union[ + _DeleteDatasetRequestParameters, _DeleteDatasetRequestParametersDict ] -class SchemaPromptApiSchema(_common.BaseModel): - """The A2 schema of a prompt.""" +class DeletePromptOperation(_common.BaseModel): + """Operation for deleting prompts.""" - api_schema_version: Optional[str] = Field( + name: Optional[str] = Field( default=None, - description="""The Schema version that represents changes to the API behavior.""", + description="""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}`.""", ) - executions: Optional[list[SchemaPromptInstancePromptExecution]] = Field( + metadata: Optional[dict[str, Any]] = Field( default=None, - description="""A list of execution instances for constructing a ready-to-use prompt.""", + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - multimodal_prompt: Optional[SchemaPromptSpecMultimodalPrompt] = Field( + done: Optional[bool] = Field( default=None, - description="""Multimodal prompt which embeds preambles to prompt string.""", + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", ) - structured_prompt: Optional[SchemaPromptSpecStructuredPrompt] = Field( + error: Optional[dict[str, Any]] = Field( default=None, - description="""The prompt variation that stores preambles in separate fields.""", - ) - translation_prompt: Optional[SchemaPromptSpecTranslationPrompt] = Field( - default=None, description="""The prompt variation for Translation use case.""" + description="""The error result of the operation in case of failure or cancellation.""", ) -class SchemaPromptApiSchemaDict(TypedDict, total=False): - """The A2 schema of a prompt.""" - - api_schema_version: Optional[str] - """The Schema version that represents changes to the API behavior.""" +class DeletePromptOperationDict(TypedDict, total=False): + """Operation for deleting prompts.""" - executions: Optional[list[SchemaPromptInstancePromptExecutionDict]] - """A list of execution instances for constructing a ready-to-use prompt.""" + 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}`.""" - multimodal_prompt: Optional[SchemaPromptSpecMultimodalPromptDict] - """Multimodal prompt which embeds preambles to prompt string.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - structured_prompt: Optional[SchemaPromptSpecStructuredPromptDict] - """The prompt variation that stores preambles in separate fields.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - translation_prompt: Optional[SchemaPromptSpecTranslationPromptDict] - """The prompt variation for Translation use case.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -SchemaPromptApiSchemaOrDict = Union[SchemaPromptApiSchema, SchemaPromptApiSchemaDict] +DeletePromptOperationOrDict = Union[DeletePromptOperation, DeletePromptOperationDict] -class SchemaTextPromptDatasetMetadata(_common.BaseModel): - """Represents the text prompt dataset metadata.""" +class _DeletePromptVersionRequestParameters(_common.BaseModel): + """Parameters for deleting a prompt version.""" - candidate_count: Optional[int] = Field( - default=None, description="""Number of candidates.""" - ) - gcs_uri: Optional[str] = Field( - default=None, - description="""The Google Cloud Storage URI that stores the prompt data.""", - ) - grounding_config: Optional[SchemaPredictParamsGroundingConfig] = Field( - default=None, description="""Grounding checking configuration.""" - ) - has_prompt_variable: Optional[bool] = Field( - default=None, description="""Whether the prompt dataset has prompt variable.""" - ) - logprobs: Optional[bool] = Field( - default=None, - description="""Whether or not the user has enabled logit probabilities in the model parameters.""", - ) - max_output_tokens: Optional[int] = Field( - default=None, - description="""Value of the maximum number of tokens generated set when the dataset was saved.""", - ) - note: Optional[str] = Field( - default=None, - description="""User-created prompt note. Note size limit is 2KB.""", - ) - prompt_api_schema: Optional[SchemaPromptApiSchema] = Field( - default=None, - description="""The API schema of the prompt to support both UI and SDK usages.""", - ) - prompt_type: Optional[str] = Field( - default=None, description="""Type of the prompt dataset.""" - ) - seed_enabled: Optional[bool] = Field( - default=None, - description="""Seeding enables model to return a deterministic response on a best effort basis. Determinism isn't guaranteed. This field determines whether or not seeding is enabled.""", - ) - seed_value: Optional[int] = Field( - default=None, description="""The actual value of the seed.""" - ) - stop_sequences: Optional[list[str]] = Field( - default=None, description="""Customized stop sequences.""" - ) - system_instruction: Optional[str] = Field( - default=None, - description="""The content of the prompt dataset system instruction.""", - ) - system_instruction_gcs_uri: Optional[str] = Field( - default=None, - description="""The Google Cloud Storage URI that stores the system instruction, starting with gs://.""", - ) - temperature: Optional[float] = Field( - default=None, - description="""Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.""", - ) - text: Optional[str] = Field( - default=None, description="""The content of the prompt dataset.""" - ) - top_k: Optional[int] = Field( - default=None, - description="""Top K value set when the dataset was saved. This value determines how many candidates with highest probability from the vocab would be selected for each decoding step.""", + prompt_id: Optional[str] = Field( + default=None, description="""ID of the prompt to be deleted.""" ) - top_p: Optional[float] = Field( + version_id: Optional[str] = Field( default=None, - description="""Top P value set when the dataset was saved. Given topK tokens for decoding, top candidates will be selected until the sum of their probabilities is topP.""", + description="""ID of the prompt version to be deleted within the provided prompt_id.""", ) + config: Optional[DeletePromptConfig] = Field(default=None, description="""""") -class SchemaTextPromptDatasetMetadataDict(TypedDict, total=False): - """Represents the text prompt dataset metadata.""" - - candidate_count: Optional[int] - """Number of candidates.""" - - gcs_uri: Optional[str] - """The Google Cloud Storage URI that stores the prompt data.""" - - grounding_config: Optional[SchemaPredictParamsGroundingConfigDict] - """Grounding checking configuration.""" - - has_prompt_variable: Optional[bool] - """Whether the prompt dataset has prompt variable.""" - - logprobs: Optional[bool] - """Whether or not the user has enabled logit probabilities in the model parameters.""" +class _DeletePromptVersionRequestParametersDict(TypedDict, total=False): + """Parameters for deleting a prompt version.""" - max_output_tokens: Optional[int] - """Value of the maximum number of tokens generated set when the dataset was saved.""" + prompt_id: Optional[str] + """ID of the prompt to be deleted.""" - note: Optional[str] - """User-created prompt note. Note size limit is 2KB.""" + version_id: Optional[str] + """ID of the prompt version to be deleted within the provided prompt_id.""" - prompt_api_schema: Optional[SchemaPromptApiSchemaDict] - """The API schema of the prompt to support both UI and SDK usages.""" + config: Optional[DeletePromptConfigDict] + """""" - prompt_type: Optional[str] - """Type of the prompt dataset.""" - seed_enabled: Optional[bool] - """Seeding enables model to return a deterministic response on a best effort basis. Determinism isn't guaranteed. This field determines whether or not seeding is enabled.""" +_DeletePromptVersionRequestParametersOrDict = Union[ + _DeletePromptVersionRequestParameters, _DeletePromptVersionRequestParametersDict +] - seed_value: Optional[int] - """The actual value of the seed.""" - stop_sequences: Optional[list[str]] - """Customized stop sequences.""" +class DeletePromptVersionOperation(_common.BaseModel): + """Operation for deleting prompt versions.""" - system_instruction: Optional[str] - """The content of the prompt dataset system instruction.""" + name: Optional[str] = Field( + default=None, + description="""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}`.""", + ) + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", + ) - system_instruction_gcs_uri: Optional[str] - """The Google Cloud Storage URI that stores the system instruction, starting with gs://.""" - temperature: Optional[float] - """Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.""" +class DeletePromptVersionOperationDict(TypedDict, total=False): + """Operation for deleting prompt versions.""" - text: Optional[str] - """The content of the prompt dataset.""" + 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}`.""" - top_k: Optional[int] - """Top K value set when the dataset was saved. This value determines how many candidates with highest probability from the vocab would be selected for each decoding step.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - top_p: Optional[float] - """Top P value set when the dataset was saved. Given topK tokens for decoding, top candidates will be selected until the sum of their probabilities is topP.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -SchemaTextPromptDatasetMetadataOrDict = Union[ - SchemaTextPromptDatasetMetadata, SchemaTextPromptDatasetMetadataDict + +DeletePromptVersionOperationOrDict = Union[ + DeletePromptVersionOperation, DeletePromptVersionOperationDict ] -class CreateDatasetConfig(_common.BaseModel): - """Config for creating a dataset resource to store prompts.""" +class RestoreVersionConfig(_common.BaseModel): + """Config for restoring a prompt version.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) -class CreateDatasetConfigDict(TypedDict, total=False): - """Config for creating a dataset resource to store prompts.""" +class RestoreVersionConfigDict(TypedDict, total=False): + """Config for restoring a prompt version.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" -CreateDatasetConfigOrDict = Union[CreateDatasetConfig, CreateDatasetConfigDict] +RestoreVersionConfigOrDict = Union[RestoreVersionConfig, RestoreVersionConfigDict] -class _CreateDatasetParameters(_common.BaseModel): - """Parameters for creating a dataset resource to store prompts.""" +class _RestoreVersionRequestParameters(_common.BaseModel): + """Parameters for restoring a prompt version.""" - name: Optional[str] = Field(default=None, description="""""") - display_name: Optional[str] = Field(default=None, description="""""") - metadata_schema_uri: Optional[str] = Field(default=None, description="""""") - metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( - default=None, description="""""" + dataset_id: Optional[str] = Field( + default=None, description="""ID of the prompt dataset to be restored.""" ) - description: Optional[str] = Field(default=None, description="""""") - encryption_spec: Optional[genai_types.EncryptionSpec] = Field( - default=None, description="""""" + version_id: Optional[str] = Field( + default=None, description="""ID of the prompt dataset version to be restored.""" ) - model_reference: Optional[str] = Field(default=None, description="""""") - config: Optional[CreateDatasetConfig] = Field(default=None, description="""""") - - -class _CreateDatasetParametersDict(TypedDict, total=False): - """Parameters for creating a dataset resource to store prompts.""" - - name: Optional[str] - """""" - - display_name: Optional[str] - """""" - - metadata_schema_uri: Optional[str] - """""" + config: Optional[RestoreVersionConfig] = Field(default=None, description="""""") - metadata: Optional[SchemaTextPromptDatasetMetadataDict] - """""" - description: Optional[str] - """""" +class _RestoreVersionRequestParametersDict(TypedDict, total=False): + """Parameters for restoring a prompt version.""" - encryption_spec: Optional[genai_types.EncryptionSpecDict] - """""" + dataset_id: Optional[str] + """ID of the prompt dataset to be restored.""" - model_reference: Optional[str] - """""" + version_id: Optional[str] + """ID of the prompt dataset version to be restored.""" - config: Optional[CreateDatasetConfigDict] + config: Optional[RestoreVersionConfigDict] """""" -_CreateDatasetParametersOrDict = Union[ - _CreateDatasetParameters, _CreateDatasetParametersDict +_RestoreVersionRequestParametersOrDict = Union[ + _RestoreVersionRequestParameters, _RestoreVersionRequestParametersDict ] -class DatasetOperation(_common.BaseModel): - """Represents the create dataset operation.""" +class RestoreVersionOperation(_common.BaseModel): + """Represents the restore version operation.""" name: Optional[str] = Field( default=None, @@ -17012,13 +20819,10 @@ class DatasetOperation(_common.BaseModel): default=None, description="""The error result of the operation in case of failure or cancellation.""", ) - response: Optional[dict[str, Any]] = Field( - default=None, description="""The result of the dataset operation.""" - ) -class DatasetOperationDict(TypedDict, total=False): - """Represents the create dataset operation.""" +class RestoreVersionOperationDict(TypedDict, total=False): + """Represents the restore version 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}`.""" @@ -17032,483 +20836,563 @@ class DatasetOperationDict(TypedDict, total=False): error: Optional[dict[str, Any]] """The error result of the operation in case of failure or cancellation.""" - response: Optional[dict[str, Any]] - """The result of the dataset operation.""" - -DatasetOperationOrDict = Union[DatasetOperation, DatasetOperationDict] +RestoreVersionOperationOrDict = Union[ + RestoreVersionOperation, RestoreVersionOperationDict +] -class CreateDatasetVersionConfig(_common.BaseModel): - """Config for creating a dataset version resource to store prompts.""" +class UpdatePromptConfig(_common.BaseModel): + """Config for creating a dataset resource to store prompts.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) + prompt_display_name: Optional[str] = Field( + default=None, description="""The updated display name for the prompt.""" + ) + version_display_name: Optional[str] = Field( + default=None, + description="""The updated display name for the prompt version. If not set, a default name with a timestamp will be used.""", + ) + timeout: Optional[int] = Field( + default=90, + description="""The timeout for the update_dataset_resource request in seconds. If not set, the default timeout is 90 seconds.""", + ) + encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + default=None, + description="""Customer-managed encryption key spec for a prompt dataset. If set, this prompt dataset and all sub-resources of this prompt dataset will be secured by this key.""", + ) -class CreateDatasetVersionConfigDict(TypedDict, total=False): - """Config for creating a dataset version resource to store prompts.""" +class UpdatePromptConfigDict(TypedDict, total=False): + """Config for creating a dataset resource to store prompts.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" + prompt_display_name: Optional[str] + """The updated display name for the prompt.""" -CreateDatasetVersionConfigOrDict = Union[ - CreateDatasetVersionConfig, CreateDatasetVersionConfigDict -] + version_display_name: Optional[str] + """The updated display name for the prompt version. If not set, a default name with a timestamp will be used.""" + timeout: Optional[int] + """The timeout for the update_dataset_resource request in seconds. If not set, the default timeout is 90 seconds.""" -class _CreateDatasetVersionParameters(_common.BaseModel): - """Represents the create dataset version parameters.""" + encryption_spec: Optional[genai_types.EncryptionSpecDict] + """Customer-managed encryption key spec for a prompt dataset. If set, this prompt dataset and all sub-resources of this prompt dataset will be secured by this key.""" - dataset_name: Optional[str] = Field(default=None, description="""""") + +UpdatePromptConfigOrDict = Union[UpdatePromptConfig, UpdatePromptConfigDict] + + +class _UpdateDatasetParameters(_common.BaseModel): + """Parameters for creating a dataset resource to store prompts.""" + + name: Optional[str] = Field(default=None, description="""""") + dataset_id: Optional[str] = Field(default=None, description="""""") + display_name: Optional[str] = Field(default=None, description="""""") metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( default=None, description="""""" ) - model_reference: Optional[str] = Field(default=None, description="""""") - parent: Optional[str] = Field(default=None, description="""""") - display_name: Optional[str] = Field(default=None, description="""""") - config: Optional[CreateDatasetVersionConfig] = Field( + description: Optional[str] = Field(default=None, description="""""") + encryption_spec: Optional[genai_types.EncryptionSpec] = Field( default=None, description="""""" ) + model_reference: Optional[str] = Field(default=None, description="""""") + config: Optional[UpdatePromptConfig] = Field(default=None, description="""""") -class _CreateDatasetVersionParametersDict(TypedDict, total=False): - """Represents the create dataset version parameters.""" +class _UpdateDatasetParametersDict(TypedDict, total=False): + """Parameters for creating a dataset resource to store prompts.""" - dataset_name: Optional[str] + name: Optional[str] + """""" + + dataset_id: Optional[str] + """""" + + display_name: Optional[str] """""" metadata: Optional[SchemaTextPromptDatasetMetadataDict] """""" - model_reference: Optional[str] + description: Optional[str] """""" - parent: Optional[str] + encryption_spec: Optional[genai_types.EncryptionSpecDict] """""" - display_name: Optional[str] + model_reference: Optional[str] """""" - config: Optional[CreateDatasetVersionConfigDict] + config: Optional[UpdatePromptConfigDict] """""" -_CreateDatasetVersionParametersOrDict = Union[ - _CreateDatasetVersionParameters, _CreateDatasetVersionParametersDict +_UpdateDatasetParametersOrDict = Union[ + _UpdateDatasetParameters, _UpdateDatasetParametersDict ] -class _GetDatasetParameters(_common.BaseModel): - """Parameters for getting a dataset resource to store prompts.""" +class GetSkillConfig(_common.BaseModel): + """Config for getting a skill.""" - name: Optional[str] = Field(default=None, description="""""") - config: Optional[VertexBaseConfig] = Field(default=None, description="""""") + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) -class _GetDatasetParametersDict(TypedDict, total=False): - """Parameters for getting a dataset resource to store prompts.""" +class GetSkillConfigDict(TypedDict, total=False): + """Config for getting a skill.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + +GetSkillConfigOrDict = Union[GetSkillConfig, GetSkillConfigDict] + + +class _GetSkillRequestParameters(_common.BaseModel): + """Parameters for GetSkillRequest.""" + + name: Optional[str] = Field( + default=None, + description="""The resource name of the Skill to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}""", + ) + config: Optional[GetSkillConfig] = Field(default=None, description="""""") + + +class _GetSkillRequestParametersDict(TypedDict, total=False): + """Parameters for GetSkillRequest.""" name: Optional[str] - """""" + """The resource name of the Skill to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}""" - config: Optional[VertexBaseConfigDict] + config: Optional[GetSkillConfigDict] """""" -_GetDatasetParametersOrDict = Union[_GetDatasetParameters, _GetDatasetParametersDict] +_GetSkillRequestParametersOrDict = Union[ + _GetSkillRequestParameters, _GetSkillRequestParametersDict +] -class SavedQuery(_common.BaseModel): - """A SavedQuery is a view of the dataset. It references a subset of annotations by problem type and filters.""" +class Skill(_common.BaseModel): + """Represents a Skill resource. - annotation_filter: Optional[str] = Field( - default=None, - description="""Output only. Filters on the Annotations in the dataset.""", - ) - annotation_spec_count: Optional[int] = Field( + Patches the type from the discovery document. + """ + + name: Optional[str] = Field( default=None, - description="""Output only. Number of AnnotationSpecs in the context of the SavedQuery.""", + description="""Identifier. The resource name of the Skill. Format: `projects/{project}/locations/{location}/skills/{skill}`""", ) create_time: Optional[datetime.datetime] = Field( default=None, - description="""Output only. Timestamp when this SavedQuery was created.""", + description="""Output only. Timestamp when this Skill was created.""", + ) + update_time: Optional[datetime.datetime] = Field( + default=None, + description="""Output only. Timestamp when this Skill was most recently updated.""", ) display_name: Optional[str] = Field( default=None, - description="""Required. The user-defined name of the SavedQuery. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", + description="""Required. Provides the display name of the Skill. This should align with `name` in the `SKILL.md` file.""", ) - etag: Optional[str] = Field( + description: Optional[str] = Field( default=None, - description="""Used to perform a consistent read-modify-write update. If not set, a blind "overwrite" update happens.""", + description="""Required. Describes the Skill. Should describe both what the skill does and when to use it. Should include specific keywords that help agents identify relevant tasks. This should align with `description` in the `SKILL.md` file.""", ) - metadata: Optional[Any] = Field( + license: Optional[str] = Field( default=None, - description="""Some additional information about the SavedQuery.""", + description="""Optional. Specifies the license of the Skill. This should be an SPDX license identifier (e.g., "MIT", "Apache-2.0"). See https://spdx.org/licenses/. This should align with `license` in the `SKILL.md` file.""", ) - name: Optional[str] = Field( - default=None, description="""Output only. Resource name of the SavedQuery.""" + compatibility: Optional[str] = Field( + default=None, + description="""Optional. Specifies the compatibility of the Skill. Indicates environment requirements (intended product, system packages, network access, etc.). This should align with `compatibility` in the `SKILL.md` file.""", ) - problem_type: Optional[str] = Field( + zipped_filesystem: Optional[str] = Field( default=None, - description="""Required. Problem type of the SavedQuery. Allowed values: * IMAGE_CLASSIFICATION_SINGLE_LABEL * IMAGE_CLASSIFICATION_MULTI_LABEL * IMAGE_BOUNDING_POLY * IMAGE_BOUNDING_BOX * TEXT_CLASSIFICATION_SINGLE_LABEL * TEXT_CLASSIFICATION_MULTI_LABEL * TEXT_EXTRACTION * TEXT_SENTIMENT * VIDEO_CLASSIFICATION * VIDEO_OBJECT_TRACKING""", + description="""Required. Provides the zipped filesystem of the Skill. This should contain the `SKILL.md` file at the root of the zip and optional directories for scripts, references, and assets. Directory should align with the directory structure specified at https://agentskills.io/specification#directory-structure.""", ) - support_automl_training: Optional[bool] = Field( + state: Optional[SkillState] = Field( + default=None, description="""Output only. The state of the Skill.""" + ) + labels: Optional[dict[str, str]] = Field( default=None, - description="""Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training.""", + description="""The labels with user-defined metadata to organize Skills.""", ) - update_time: Optional[datetime.datetime] = Field( + sha256: Optional[str] = Field( default=None, - description="""Output only. Timestamp when SavedQuery was last updated.""", + description="""Output only. The SHA256 checksum of the zipped filesystem.""", + ) + skill_source: Optional[SkillSource] = Field( + default=None, description="""Output only. The source of the Skill.""" ) -class SavedQueryDict(TypedDict, total=False): - """A SavedQuery is a view of the dataset. It references a subset of annotations by problem type and filters.""" +class SkillDict(TypedDict, total=False): + """Represents a Skill resource. - annotation_filter: Optional[str] - """Output only. Filters on the Annotations in the dataset.""" + Patches the type from the discovery document. + """ - annotation_spec_count: Optional[int] - """Output only. Number of AnnotationSpecs in the context of the SavedQuery.""" + name: Optional[str] + """Identifier. The resource name of the Skill. Format: `projects/{project}/locations/{location}/skills/{skill}`""" create_time: Optional[datetime.datetime] - """Output only. Timestamp when this SavedQuery was created.""" + """Output only. Timestamp when this Skill was created.""" + + update_time: Optional[datetime.datetime] + """Output only. Timestamp when this Skill was most recently updated.""" display_name: Optional[str] - """Required. The user-defined name of the SavedQuery. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" + """Required. Provides the display name of the Skill. This should align with `name` in the `SKILL.md` file.""" - etag: Optional[str] - """Used to perform a consistent read-modify-write update. If not set, a blind "overwrite" update happens.""" + description: Optional[str] + """Required. Describes the Skill. Should describe both what the skill does and when to use it. Should include specific keywords that help agents identify relevant tasks. This should align with `description` in the `SKILL.md` file.""" - metadata: Optional[Any] - """Some additional information about the SavedQuery.""" + license: Optional[str] + """Optional. Specifies the license of the Skill. This should be an SPDX license identifier (e.g., "MIT", "Apache-2.0"). See https://spdx.org/licenses/. This should align with `license` in the `SKILL.md` file.""" - name: Optional[str] - """Output only. Resource name of the SavedQuery.""" + compatibility: Optional[str] + """Optional. Specifies the compatibility of the Skill. Indicates environment requirements (intended product, system packages, network access, etc.). This should align with `compatibility` in the `SKILL.md` file.""" - problem_type: Optional[str] - """Required. Problem type of the SavedQuery. Allowed values: * IMAGE_CLASSIFICATION_SINGLE_LABEL * IMAGE_CLASSIFICATION_MULTI_LABEL * IMAGE_BOUNDING_POLY * IMAGE_BOUNDING_BOX * TEXT_CLASSIFICATION_SINGLE_LABEL * TEXT_CLASSIFICATION_MULTI_LABEL * TEXT_EXTRACTION * TEXT_SENTIMENT * VIDEO_CLASSIFICATION * VIDEO_OBJECT_TRACKING""" + zipped_filesystem: Optional[str] + """Required. Provides the zipped filesystem of the Skill. This should contain the `SKILL.md` file at the root of the zip and optional directories for scripts, references, and assets. Directory should align with the directory structure specified at https://agentskills.io/specification#directory-structure.""" - support_automl_training: Optional[bool] - """Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training.""" + state: Optional[SkillState] + """Output only. The state of the Skill.""" - update_time: Optional[datetime.datetime] - """Output only. Timestamp when SavedQuery was last updated.""" + labels: Optional[dict[str, str]] + """The labels with user-defined metadata to organize Skills.""" + sha256: Optional[str] + """Output only. The SHA256 checksum of the zipped filesystem.""" -SavedQueryOrDict = Union[SavedQuery, SavedQueryDict] + skill_source: Optional[SkillSource] + """Output only. The source of the Skill.""" -class Dataset(_common.BaseModel): - """Represents a dataset resource to store prompts.""" +SkillOrDict = Union[Skill, SkillDict] - metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( - default=None, - description="""Required. Additional information about the Dataset.""", + +class RetrieveSkillsConfig(_common.BaseModel): + """Config for retrieving skills.""" + + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" ) - encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + top_k: Optional[int] = Field( default=None, - description="""Customer-managed encryption key spec for a Dataset. If set, this Dataset and all sub-resources of this Dataset will be secured by this key.""", + description="""Optional. The maximum number of skills to return. The service may + return fewer than this value. If unspecified, at most 10 skills will be + returned. The maximum value is 100. + """, ) - create_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. Timestamp when this Dataset was created.""", + + +class RetrieveSkillsConfigDict(TypedDict, total=False): + """Config for retrieving skills.""" + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + + top_k: Optional[int] + """Optional. The maximum number of skills to return. The service may + return fewer than this value. If unspecified, at most 10 skills will be + returned. The maximum value is 100. + """ + + +RetrieveSkillsConfigOrDict = Union[RetrieveSkillsConfig, RetrieveSkillsConfigDict] + + +class _RetrieveSkillsRequestParameters(_common.BaseModel): + """Parameters for retrieving skills.""" + + query: Optional[str] = Field( + default=None, description="""Required. The query to find matching skills.""" ) - data_item_count: Optional[int] = Field( - default=None, - description="""Output only. The number of DataItems in this Dataset. Only apply for non-structured Dataset.""", + config: Optional[RetrieveSkillsConfig] = Field(default=None, description="""""") + + +class _RetrieveSkillsRequestParametersDict(TypedDict, total=False): + """Parameters for retrieving skills.""" + + query: Optional[str] + """Required. The query to find matching skills.""" + + config: Optional[RetrieveSkillsConfigDict] + """""" + + +_RetrieveSkillsRequestParametersOrDict = Union[ + _RetrieveSkillsRequestParameters, _RetrieveSkillsRequestParametersDict +] + + +class RetrievedSkill(_common.BaseModel): + """A retrieved skill from semantic search.""" + + skill_name: Optional[str] = Field( + default=None, description="""The resource name of the skill.""" ) description: Optional[str] = Field( - default=None, description="""The description of the Dataset.""" - ) - display_name: Optional[str] = Field( - default=None, - description="""Required. The user-defined name of the Dataset. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", - ) - etag: Optional[str] = Field( - default=None, - description="""Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""", - ) - labels: Optional[dict[str, str]] = Field( - default=None, - description="""The labels with user-defined metadata to organize your Datasets. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one Dataset (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. Following system labels exist for each Dataset: * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its value is the metadata_schema's title.""", - ) - metadata_artifact: Optional[str] = Field( - default=None, - description="""Output only. The resource name of the Artifact that was created in MetadataStore when creating the Dataset. The Artifact resource name pattern is `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.""", - ) - metadata_schema_uri: Optional[str] = Field( - default=None, - description="""Required. Points to a YAML file stored on Google Cloud Storage describing additional information about the Dataset. The schema is defined as an OpenAPI 3.0.2 Schema Object. The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/metadata/.""", - ) - model_reference: Optional[str] = Field( - default=None, - description="""Optional. Reference to the public base model last used by the dataset. Only set for prompt datasets.""", - ) - name: Optional[str] = Field( - default=None, - description="""Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`""", - ) - satisfies_pzi: Optional[bool] = Field( - default=None, description="""Output only. Reserved for future use.""" - ) - satisfies_pzs: Optional[bool] = Field( - default=None, description="""Output only. Reserved for future use.""" - ) - saved_queries: Optional[list[SavedQuery]] = Field( - default=None, - description="""All SavedQueries belong to the Dataset will be returned in List/Get Dataset response. The annotation_specs field will not be populated except for UI cases which will only use annotation_spec_count. In CreateDataset request, a SavedQuery is created together if this field is set, up to one SavedQuery can be set in CreateDatasetRequest. The SavedQuery should not contain any AnnotationSpec.""", - ) - update_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. Timestamp when this Dataset was last updated.""", + default=None, description="""The description of the skill.""" ) - # TODO(b/448806531): Remove all the overridden _from_response methods once the - # ticket is resolved and published. - @classmethod - def _from_response( - cls: typing.Type["Dataset"], - *, - response: dict[str, object], - kwargs: dict[str, object], - ) -> "Dataset": - """Converts a dictionary response into a Dataset object.""" - response = _camel_key_to_snake(response) - result = super()._from_response(response=response, kwargs=kwargs) - return result +class RetrievedSkillDict(TypedDict, total=False): + """A retrieved skill from semantic search.""" + skill_name: Optional[str] + """The resource name of the skill.""" -class DatasetDict(TypedDict, total=False): - """Represents a dataset resource to store prompts.""" + description: Optional[str] + """The description of the skill.""" - metadata: Optional[SchemaTextPromptDatasetMetadataDict] - """Required. Additional information about the Dataset.""" - encryption_spec: Optional[genai_types.EncryptionSpecDict] - """Customer-managed encryption key spec for a Dataset. If set, this Dataset and all sub-resources of this Dataset will be secured by this key.""" +RetrievedSkillOrDict = Union[RetrievedSkill, RetrievedSkillDict] - create_time: Optional[datetime.datetime] - """Output only. Timestamp when this Dataset was created.""" - data_item_count: Optional[int] - """Output only. The number of DataItems in this Dataset. Only apply for non-structured Dataset.""" +class RetrieveSkillsResponse(_common.BaseModel): + """Response for retrieving skills.""" - description: Optional[str] - """The description of the Dataset.""" + retrieved_skills: Optional[list[RetrievedSkill]] = Field( + default=None, description="""List of retrieved skills ranked by similarity.""" + ) - display_name: Optional[str] - """Required. The user-defined name of the Dataset. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" - etag: Optional[str] - """Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""" +class RetrieveSkillsResponseDict(TypedDict, total=False): + """Response for retrieving skills.""" - labels: Optional[dict[str, str]] - """The labels with user-defined metadata to organize your Datasets. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one Dataset (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable. Following system labels exist for each Dataset: * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its value is the metadata_schema's title.""" + retrieved_skills: Optional[list[RetrievedSkillDict]] + """List of retrieved skills ranked by similarity.""" + + +RetrieveSkillsResponseOrDict = Union[RetrieveSkillsResponse, RetrieveSkillsResponseDict] + + +class CreateSkillConfig(_common.BaseModel): + """Config for creating a skill.""" - metadata_artifact: Optional[str] - """Output only. The resource name of the Artifact that was created in MetadataStore when creating the Dataset. The Artifact resource name pattern is `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Whether to wait for the long running operation to complete.""", + ) + local_path: Optional[str] = Field( + default=None, + description="""Optional. The local path to the directory containing the Skill to + be zipped and uploaded. + """, + ) + zipped_filesystem: Optional[Any] = Field( + default=None, description="""Optional. The zipped filesystem of the Skill.""" + ) - metadata_schema_uri: Optional[str] - """Required. Points to a YAML file stored on Google Cloud Storage describing additional information about the Dataset. The schema is defined as an OpenAPI 3.0.2 Schema Object. The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/metadata/.""" - model_reference: Optional[str] - """Optional. Reference to the public base model last used by the dataset. Only set for prompt datasets.""" +class CreateSkillConfigDict(TypedDict, total=False): + """Config for creating a skill.""" - name: Optional[str] - """Output only. Identifier. The resource name of the Dataset. Format: `projects/{project}/locations/{location}/datasets/{dataset}`""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - satisfies_pzi: Optional[bool] - """Output only. Reserved for future use.""" + wait_for_completion: Optional[bool] + """Whether to wait for the long running operation to complete.""" - satisfies_pzs: Optional[bool] - """Output only. Reserved for future use.""" + local_path: Optional[str] + """Optional. The local path to the directory containing the Skill to + be zipped and uploaded. + """ - saved_queries: Optional[list[SavedQueryDict]] - """All SavedQueries belong to the Dataset will be returned in List/Get Dataset response. The annotation_specs field will not be populated except for UI cases which will only use annotation_spec_count. In CreateDataset request, a SavedQuery is created together if this field is set, up to one SavedQuery can be set in CreateDatasetRequest. The SavedQuery should not contain any AnnotationSpec.""" + zipped_filesystem: Optional[Any] + """Optional. The zipped filesystem of the Skill.""" - update_time: Optional[datetime.datetime] - """Output only. Timestamp when this Dataset was last updated.""" +CreateSkillConfigOrDict = Union[CreateSkillConfig, CreateSkillConfigDict] -DatasetOrDict = Union[Dataset, DatasetDict] +class _CreateSkillRequestParameters(_common.BaseModel): + """Parameters for creating a skill.""" -class _GetDatasetVersionParameters(_common.BaseModel): - """Parameters for getting a dataset resource to store prompts.""" + display_name: Optional[str] = Field( + default=None, description="""Required. The display name of the Skill.""" + ) + description: Optional[str] = Field( + default=None, description="""Required. The description of the Skill.""" + ) + config: Optional[CreateSkillConfig] = Field(default=None, description="""""") + skill_id: Optional[str] = Field( + default=None, + description="""Required. The ID to use for the Skill, which will become the final + component of the Skill's resource name. + """, + ) - dataset_id: Optional[str] = Field(default=None, description="""""") - dataset_version_id: Optional[str] = Field(default=None, description="""""") - config: Optional[VertexBaseConfig] = Field(default=None, description="""""") +class _CreateSkillRequestParametersDict(TypedDict, total=False): + """Parameters for creating a skill.""" -class _GetDatasetVersionParametersDict(TypedDict, total=False): - """Parameters for getting a dataset resource to store prompts.""" + display_name: Optional[str] + """Required. The display name of the Skill.""" - dataset_id: Optional[str] - """""" + description: Optional[str] + """Required. The description of the Skill.""" - dataset_version_id: Optional[str] + config: Optional[CreateSkillConfigDict] """""" - config: Optional[VertexBaseConfigDict] - """""" + skill_id: Optional[str] + """Required. The ID to use for the Skill, which will become the final + component of the Skill's resource name. + """ -_GetDatasetVersionParametersOrDict = Union[ - _GetDatasetVersionParameters, _GetDatasetVersionParametersDict +_CreateSkillRequestParametersOrDict = Union[ + _CreateSkillRequestParameters, _CreateSkillRequestParametersDict ] -class DatasetVersion(_common.BaseModel): - """Represents a dataset version resource to store prompts.""" +class SkillOperation(_common.BaseModel): + """Operation that has a skill as a response.""" - metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( - default=None, - description="""Required. Output only. Additional information about the DatasetVersion.""", - ) - big_query_dataset_name: Optional[str] = Field( - default=None, - description="""Output only. Name of the associated BigQuery dataset.""", - ) - create_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. Timestamp when this DatasetVersion was created.""", - ) - display_name: Optional[str] = Field( + name: Optional[str] = Field( default=None, - description="""The user-defined name of the DatasetVersion. The name can be up to 128 characters long and can consist of any UTF-8 characters.""", + description="""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}`.""", ) - etag: Optional[str] = Field( + metadata: Optional[dict[str, Any]] = Field( default=None, - description="""Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""", + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", ) - model_reference: Optional[str] = Field( + done: Optional[bool] = Field( default=None, - description="""Output only. Reference to the public base model last used by the dataset version. Only set for prompt dataset versions.""", + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", ) - name: Optional[str] = Field( + error: Optional[dict[str, Any]] = Field( default=None, - description="""Output only. Identifier. The resource name of the DatasetVersion. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`""", - ) - satisfies_pzi: Optional[bool] = Field( - default=None, description="""Output only. Reserved for future use.""" - ) - satisfies_pzs: Optional[bool] = Field( - default=None, description="""Output only. Reserved for future use.""" + description="""The error result of the operation in case of failure or cancellation.""", ) - update_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. Timestamp when this DatasetVersion was last updated.""", + response: Optional[Skill] = Field( + default=None, description="""The created Skill.""" ) - # TODO(b/448806531): Remove all the overridden _from_response methods once the - # ticket is resolved and published. - @classmethod - def _from_response( - cls: typing.Type["DatasetVersion"], - *, - response: dict[str, object], - kwargs: dict[str, object], - ) -> "DatasetVersion": - """Converts a dictionary response into a DatasetVersion object.""" - - response = _camel_key_to_snake(response) - result = super()._from_response(response=response, kwargs=kwargs) - return result +class SkillOperationDict(TypedDict, total=False): + """Operation that has a skill as a response.""" -class DatasetVersionDict(TypedDict, total=False): - """Represents a dataset version resource to store prompts.""" + 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}`.""" - metadata: Optional[SchemaTextPromptDatasetMetadataDict] - """Required. Output only. Additional information about the DatasetVersion.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - big_query_dataset_name: Optional[str] - """Output only. Name of the associated BigQuery dataset.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" - create_time: Optional[datetime.datetime] - """Output only. Timestamp when this DatasetVersion was created.""" + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" - display_name: Optional[str] - """The user-defined name of the DatasetVersion. The name can be up to 128 characters long and can consist of any UTF-8 characters.""" + response: Optional[SkillDict] + """The created Skill.""" - etag: Optional[str] - """Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.""" - model_reference: Optional[str] - """Output only. Reference to the public base model last used by the dataset version. Only set for prompt dataset versions.""" +SkillOperationOrDict = Union[SkillOperation, SkillOperationDict] - name: Optional[str] - """Output only. Identifier. The resource name of the DatasetVersion. Format: `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`""" - satisfies_pzi: Optional[bool] - """Output only. Reserved for future use.""" +class UpdateSkillConfig(_common.BaseModel): + """Config for updating a skill.""" - satisfies_pzs: Optional[bool] - """Output only. Reserved for future use.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Whether to wait for the long running operation to complete.""", + ) + local_path: Optional[str] = Field( + default=None, + description="""Optional. The local path to the directory containing the Skill to + be zipped and uploaded. + """, + ) + display_name: Optional[str] = Field( + default=None, description="""Optional. The display name of the Skill.""" + ) + description: Optional[str] = Field( + default=None, description="""Optional. The description of the Skill.""" + ) + zipped_filesystem: Optional[Any] = Field( + default=None, description="""Optional. The zipped filesystem of the Skill.""" + ) + update_mask: Optional[str] = Field( + default=None, description="""Optional. The update mask to apply.""" + ) - update_time: Optional[datetime.datetime] - """Output only. Timestamp when this DatasetVersion was last updated.""" +class UpdateSkillConfigDict(TypedDict, total=False): + """Config for updating a skill.""" -DatasetVersionOrDict = Union[DatasetVersion, DatasetVersionDict] + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" + wait_for_completion: Optional[bool] + """Whether to wait for the long running operation to complete.""" -class GetDatasetOperationConfig(_common.BaseModel): - """Config for getting a dataset version operation.""" + local_path: Optional[str] + """Optional. The local path to the directory containing the Skill to + be zipped and uploaded. + """ - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) + display_name: Optional[str] + """Optional. The display name of the Skill.""" + description: Optional[str] + """Optional. The description of the Skill.""" -class GetDatasetOperationConfigDict(TypedDict, total=False): - """Config for getting a dataset version operation.""" + zipped_filesystem: Optional[Any] + """Optional. The zipped filesystem of the Skill.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + update_mask: Optional[str] + """Optional. The update mask to apply.""" -GetDatasetOperationConfigOrDict = Union[ - GetDatasetOperationConfig, GetDatasetOperationConfigDict -] +UpdateSkillConfigOrDict = Union[UpdateSkillConfig, UpdateSkillConfigDict] -class _GetDatasetOperationParameters(_common.BaseModel): - """Parameters for getting a dataset operation.""" +class _UpdateSkillRequestParameters(_common.BaseModel): + """Parameters for updating a skill.""" - dataset_id: Optional[str] = Field(default=None, description="""""") - operation_id: Optional[str] = Field(default=None, description="""""") - config: Optional[GetDatasetOperationConfig] = Field( - default=None, description="""""" + name: Optional[str] = Field( + default=None, + description="""Required. The resource name of the Skill to update.""", ) + config: Optional[UpdateSkillConfig] = Field(default=None, description="""""") -class _GetDatasetOperationParametersDict(TypedDict, total=False): - """Parameters for getting a dataset operation.""" - - dataset_id: Optional[str] - """""" +class _UpdateSkillRequestParametersDict(TypedDict, total=False): + """Parameters for updating a skill.""" - operation_id: Optional[str] - """""" + name: Optional[str] + """Required. The resource name of the Skill to update.""" - config: Optional[GetDatasetOperationConfigDict] + config: Optional[UpdateSkillConfigDict] """""" -_GetDatasetOperationParametersOrDict = Union[ - _GetDatasetOperationParameters, _GetDatasetOperationParametersDict +_UpdateSkillRequestParametersOrDict = Union[ + _UpdateSkillRequestParameters, _UpdateSkillRequestParametersDict ] -class ListPromptsConfig(_common.BaseModel): - """Config for listing prompt datasets and dataset versions.""" +class ListSkillsConfig(_common.BaseModel): + """Config for listing skills.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" @@ -17516,14 +21400,12 @@ class ListPromptsConfig(_common.BaseModel): page_size: Optional[int] = Field(default=None, description="""""") page_token: Optional[str] = Field(default=None, description="""""") filter: Optional[str] = Field( - default=None, - description="""An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""", + default=None, description="""Optional. The standard list filter.""" ) -class ListPromptsConfigDict(TypedDict, total=False): - """Config for listing prompt datasets and dataset versions.""" +class ListSkillsConfigDict(TypedDict, total=False): + """Config for listing skills.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" @@ -17535,62 +21417,44 @@ class ListPromptsConfigDict(TypedDict, total=False): """""" filter: Optional[str] - """An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported.""" + """Optional. The standard list filter.""" -ListPromptsConfigOrDict = Union[ListPromptsConfig, ListPromptsConfigDict] +ListSkillsConfigOrDict = Union[ListSkillsConfig, ListSkillsConfigDict] -class _ListDatasetsRequestParameters(_common.BaseModel): - """Parameters for listing prompt datasets.""" +class _ListSkillsRequestParameters(_common.BaseModel): + """Parameters for listing skills.""" - config: Optional[ListPromptsConfig] = Field(default=None, description="""""") + config: Optional[ListSkillsConfig] = Field(default=None, description="""""") -class _ListDatasetsRequestParametersDict(TypedDict, total=False): - """Parameters for listing prompt datasets.""" +class _ListSkillsRequestParametersDict(TypedDict, total=False): + """Parameters for listing skills.""" - config: Optional[ListPromptsConfigDict] + config: Optional[ListSkillsConfigDict] """""" -_ListDatasetsRequestParametersOrDict = Union[ - _ListDatasetsRequestParameters, _ListDatasetsRequestParametersDict +_ListSkillsRequestParametersOrDict = Union[ + _ListSkillsRequestParameters, _ListSkillsRequestParametersDict ] -class ListDatasetsResponse(_common.BaseModel): - """Response for listing prompt datasets.""" +class ListSkillsResponse(_common.BaseModel): + """Response for listing skills.""" sdk_http_response: Optional[genai_types.HttpResponse] = Field( default=None, description="""Used to retain the full HTTP response.""" ) next_page_token: Optional[str] = Field(default=None, description="""""") - datasets: Optional[list[Dataset]] = Field( - default=None, - description="""List of datasets for the project. - """, + skills: Optional[list[Skill]] = Field( + default=None, description="""List of Skills.""" ) - # TODO(b/448806531): Remove all the overridden _from_response methods once the - # ticket is resolved and published. - @classmethod - def _from_response( - cls: typing.Type["ListDatasetsResponse"], - *, - response: dict[str, object], - kwargs: dict[str, object], - ) -> "ListDatasetsResponse": - """Converts a dictionary response into a ListDatasetsResponse object.""" - - response = _camel_key_to_snake(response) - result = super()._from_response(response=response, kwargs=kwargs) - return result - -class ListDatasetsResponseDict(TypedDict, total=False): - """Response for listing prompt datasets.""" +class ListSkillsResponseDict(TypedDict, total=False): + """Response for listing skills.""" sdk_http_response: Optional[genai_types.HttpResponseDict] """Used to retain the full HTTP response.""" @@ -17598,1253 +21462,1576 @@ class ListDatasetsResponseDict(TypedDict, total=False): next_page_token: Optional[str] """""" - datasets: Optional[list[DatasetDict]] - """List of datasets for the project. - """ - + skills: Optional[list[SkillDict]] + """List of Skills.""" -ListDatasetsResponseOrDict = Union[ListDatasetsResponse, ListDatasetsResponseDict] +ListSkillsResponseOrDict = Union[ListSkillsResponse, ListSkillsResponseDict] -class _ListDatasetVersionsRequestParameters(_common.BaseModel): - """Parameters for listing dataset versions.""" - read_mask: Optional[str] = Field(default=None, description="""""") - dataset_id: Optional[str] = Field(default=None, description="""""") - config: Optional[ListPromptsConfig] = Field(default=None, description="""""") +class DeleteSkillConfig(_common.BaseModel): + """Config for deleting a skill.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) + wait_for_completion: Optional[bool] = Field( + default=True, + description="""Whether to wait for the long running operation to complete.""", + ) -class _ListDatasetVersionsRequestParametersDict(TypedDict, total=False): - """Parameters for listing dataset versions.""" - read_mask: Optional[str] - """""" +class DeleteSkillConfigDict(TypedDict, total=False): + """Config for deleting a skill.""" - dataset_id: Optional[str] - """""" + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" - config: Optional[ListPromptsConfigDict] - """""" + wait_for_completion: Optional[bool] + """Whether to wait for the long running operation to complete.""" -_ListDatasetVersionsRequestParametersOrDict = Union[ - _ListDatasetVersionsRequestParameters, _ListDatasetVersionsRequestParametersDict -] +DeleteSkillConfigOrDict = Union[DeleteSkillConfig, DeleteSkillConfigDict] -class ListDatasetVersionsResponse(_common.BaseModel): - """Response for listing prompt datasets.""" +class _DeleteSkillRequestParameters(_common.BaseModel): + """Parameters for deleting a skill.""" - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" - ) - next_page_token: Optional[str] = Field(default=None, description="""""") - dataset_versions: Optional[list[DatasetVersion]] = Field( + name: Optional[str] = Field( default=None, - description="""List of datasets for the project. - """, + description="""Required. The resource name of the Skill to delete.""", ) - - # TODO(b/448806531): Remove all the overridden _from_response methods once the - # ticket is resolved and published. - @classmethod - def _from_response( - cls: typing.Type["ListDatasetVersionsResponse"], - *, - response: dict[str, object], - kwargs: dict[str, object], - ) -> "ListDatasetVersionsResponse": - """Converts a dictionary response into a ListDatasetVersionsResponse object.""" - - response = _camel_key_to_snake(response) - result = super()._from_response(response=response, kwargs=kwargs) - return result + config: Optional[DeleteSkillConfig] = Field(default=None, description="""""") -class ListDatasetVersionsResponseDict(TypedDict, total=False): - """Response for listing prompt datasets.""" +class _DeleteSkillRequestParametersDict(TypedDict, total=False): + """Parameters for deleting a skill.""" - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" + name: Optional[str] + """Required. The resource name of the Skill to delete.""" - next_page_token: Optional[str] + config: Optional[DeleteSkillConfigDict] """""" - dataset_versions: Optional[list[DatasetVersionDict]] - """List of datasets for the project. - """ - -ListDatasetVersionsResponseOrDict = Union[ - ListDatasetVersionsResponse, ListDatasetVersionsResponseDict +_DeleteSkillRequestParametersOrDict = Union[ + _DeleteSkillRequestParameters, _DeleteSkillRequestParametersDict ] -class DeletePromptConfig(_common.BaseModel): - """Config for deleting a prompt.""" +class DeleteSkillOperation(_common.BaseModel): + """Operation for deleting a skill.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + name: Optional[str] = Field( + default=None, + description="""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}`.""", ) - timeout: Optional[int] = Field( - default=90, - description="""Timeout for the delete prompt operation in seconds. Defaults to 90.""", + metadata: Optional[dict[str, Any]] = Field( + default=None, + description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + ) + done: Optional[bool] = Field( + default=None, + description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + ) + error: Optional[dict[str, Any]] = Field( + default=None, + description="""The error result of the operation in case of failure or cancellation.""", ) -class DeletePromptConfigDict(TypedDict, total=False): - """Config for deleting a prompt.""" +class DeleteSkillOperationDict(TypedDict, total=False): + """Operation for deleting a skill.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + 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}`.""" - timeout: Optional[int] - """Timeout for the delete prompt operation in seconds. Defaults to 90.""" + metadata: Optional[dict[str, Any]] + """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + done: Optional[bool] + """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" -DeletePromptConfigOrDict = Union[DeletePromptConfig, DeletePromptConfigDict] + error: Optional[dict[str, Any]] + """The error result of the operation in case of failure or cancellation.""" -class _DeleteDatasetRequestParameters(_common.BaseModel): - """Parameters for deleting a prompt dataset.""" +DeleteSkillOperationOrDict = Union[DeleteSkillOperation, DeleteSkillOperationDict] - prompt_id: Optional[str] = Field( - default=None, description="""ID of the prompt dataset to be deleted.""" - ) - config: Optional[DeletePromptConfig] = Field(default=None, description="""""") +class GetSkillOperationConfig(_common.BaseModel): -class _DeleteDatasetRequestParametersDict(TypedDict, total=False): - """Parameters for deleting a prompt dataset.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) - prompt_id: Optional[str] - """ID of the prompt dataset to be deleted.""" - config: Optional[DeletePromptConfigDict] - """""" +class GetSkillOperationConfigDict(TypedDict, total=False): + + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -_DeleteDatasetRequestParametersOrDict = Union[ - _DeleteDatasetRequestParameters, _DeleteDatasetRequestParametersDict +GetSkillOperationConfigOrDict = Union[ + GetSkillOperationConfig, GetSkillOperationConfigDict ] -class DeletePromptOperation(_common.BaseModel): - """Operation for deleting prompts.""" +class _GetSkillOperationParameters(_common.BaseModel): + """Parameters for getting an operation.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + operation_name: Optional[str] = Field( + default=None, description="""The server-assigned name for the operation.""" ) - error: Optional[dict[str, Any]] = Field( - default=None, - description="""The error result of the operation in case of failure or cancellation.""", + config: Optional[GetSkillOperationConfig] = Field( + default=None, description="""Used to override the default configuration.""" ) -class DeletePromptOperationDict(TypedDict, total=False): - """Operation for deleting prompts.""" +class _GetSkillOperationParametersDict(TypedDict, total=False): + """Parameters for getting an operation.""" + + operation_name: Optional[str] + """The server-assigned name for the operation.""" + + config: Optional[GetSkillOperationConfigDict] + """Used to override the default configuration.""" + + +_GetSkillOperationParametersOrDict = Union[ + _GetSkillOperationParameters, _GetSkillOperationParametersDict +] - 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}`.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" +class GetSkillRevisionConfig(_common.BaseModel): + """Configuration for getting a Skill Revision.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + http_options: Optional[genai_types.HttpOptions] = Field( + default=None, description="""Used to override HTTP request options.""" + ) - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" +class GetSkillRevisionConfigDict(TypedDict, total=False): + """Configuration for getting a Skill Revision.""" -DeletePromptOperationOrDict = Union[DeletePromptOperation, DeletePromptOperationDict] + http_options: Optional[genai_types.HttpOptionsDict] + """Used to override HTTP request options.""" -class _DeletePromptVersionRequestParameters(_common.BaseModel): - """Parameters for deleting a prompt version.""" +GetSkillRevisionConfigOrDict = Union[GetSkillRevisionConfig, GetSkillRevisionConfigDict] - prompt_id: Optional[str] = Field( - default=None, description="""ID of the prompt to be deleted.""" - ) - version_id: Optional[str] = Field( + +class _GetSkillRevisionRequestParameters(_common.BaseModel): + """Parameters for getting a Skill Revision.""" + + name: Optional[str] = Field( default=None, - description="""ID of the prompt version to be deleted within the provided prompt_id.""", + description="""The resource name of the Skill Revision to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}""", ) - config: Optional[DeletePromptConfig] = Field(default=None, description="""""") - + config: Optional[GetSkillRevisionConfig] = Field(default=None, description="""""") -class _DeletePromptVersionRequestParametersDict(TypedDict, total=False): - """Parameters for deleting a prompt version.""" - prompt_id: Optional[str] - """ID of the prompt to be deleted.""" +class _GetSkillRevisionRequestParametersDict(TypedDict, total=False): + """Parameters for getting a Skill Revision.""" - version_id: Optional[str] - """ID of the prompt version to be deleted within the provided prompt_id.""" + name: Optional[str] + """The resource name of the Skill Revision to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}""" - config: Optional[DeletePromptConfigDict] + config: Optional[GetSkillRevisionConfigDict] """""" -_DeletePromptVersionRequestParametersOrDict = Union[ - _DeletePromptVersionRequestParameters, _DeletePromptVersionRequestParametersDict +_GetSkillRevisionRequestParametersOrDict = Union[ + _GetSkillRevisionRequestParameters, _GetSkillRevisionRequestParametersDict ] -class DeletePromptVersionOperation(_common.BaseModel): - """Operation for deleting prompt versions.""" +class SkillRevision(_common.BaseModel): + """A single revision of a Skill.""" name: Optional[str] = Field( default=None, - description="""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}`.""", + description="""Identifier. The resource name of the Skill Revision. Format: `projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}`""", ) - metadata: Optional[dict[str, Any]] = Field( + create_time: Optional[datetime.datetime] = Field( default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + description="""Output only. Timestamp when this Skill Revision was created.""", ) - done: Optional[bool] = Field( + skill: Optional[Skill] = Field( default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + description="""Output only. The state of the Skill at this revision. TODO(b/503772996) Use a different proto for skill data included in skill revision""", ) - error: Optional[dict[str, Any]] = Field( - default=None, - description="""The error result of the operation in case of failure or cancellation.""", + state: Optional[SkillRevisionState] = Field( + default=None, description="""Output only. The state of the Skill Revision.""" ) -class DeletePromptVersionOperationDict(TypedDict, total=False): - """Operation for deleting prompt versions.""" +class SkillRevisionDict(TypedDict, total=False): + """A single revision of a Skill.""" 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}`.""" + """Identifier. The resource name of the Skill Revision. Format: `projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}`""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + create_time: Optional[datetime.datetime] + """Output only. Timestamp when this Skill Revision was created.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + skill: Optional[SkillDict] + """Output only. The state of the Skill at this revision. TODO(b/503772996) Use a different proto for skill data included in skill revision""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + state: Optional[SkillRevisionState] + """Output only. The state of the Skill Revision.""" -DeletePromptVersionOperationOrDict = Union[ - DeletePromptVersionOperation, DeletePromptVersionOperationDict -] +SkillRevisionOrDict = Union[SkillRevision, SkillRevisionDict] -class RestoreVersionConfig(_common.BaseModel): - """Config for restoring a prompt version.""" +class ListSkillRevisionsConfig(_common.BaseModel): + """Configuration for listing Skill Revisions.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") -class RestoreVersionConfigDict(TypedDict, total=False): - """Config for restoring a prompt version.""" +class ListSkillRevisionsConfigDict(TypedDict, total=False): + """Configuration for listing Skill Revisions.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" + page_size: Optional[int] + """""" -RestoreVersionConfigOrDict = Union[RestoreVersionConfig, RestoreVersionConfigDict] + page_token: Optional[str] + """""" -class _RestoreVersionRequestParameters(_common.BaseModel): - """Parameters for restoring a prompt version.""" +ListSkillRevisionsConfigOrDict = Union[ + ListSkillRevisionsConfig, ListSkillRevisionsConfigDict +] - dataset_id: Optional[str] = Field( - default=None, description="""ID of the prompt dataset to be restored.""" - ) - version_id: Optional[str] = Field( - default=None, description="""ID of the prompt dataset version to be restored.""" - ) - config: Optional[RestoreVersionConfig] = Field(default=None, description="""""") +class _ListSkillRevisionsRequestParameters(_common.BaseModel): + """Parameters for ListSkillRevisionsRequest.""" -class _RestoreVersionRequestParametersDict(TypedDict, total=False): - """Parameters for restoring a prompt version.""" + name: Optional[str] = Field( + default=None, + description="""Required. The name of the Skill to list revisions for.""", + ) + config: Optional[ListSkillRevisionsConfig] = Field(default=None, description="""""") - dataset_id: Optional[str] - """ID of the prompt dataset to be restored.""" - version_id: Optional[str] - """ID of the prompt dataset version to be restored.""" +class _ListSkillRevisionsRequestParametersDict(TypedDict, total=False): + """Parameters for ListSkillRevisionsRequest.""" - config: Optional[RestoreVersionConfigDict] + name: Optional[str] + """Required. The name of the Skill to list revisions for.""" + + config: Optional[ListSkillRevisionsConfigDict] """""" -_RestoreVersionRequestParametersOrDict = Union[ - _RestoreVersionRequestParameters, _RestoreVersionRequestParametersDict +_ListSkillRevisionsRequestParametersOrDict = Union[ + _ListSkillRevisionsRequestParameters, _ListSkillRevisionsRequestParametersDict ] -class RestoreVersionOperation(_common.BaseModel): - """Represents the restore version operation.""" +class ListSkillRevisionsResponse(_common.BaseModel): + """Response for listing Skill Revisions.""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + sdk_http_response: Optional[genai_types.HttpResponse] = Field( + default=None, description="""Used to retain the full HTTP response.""" ) - error: Optional[dict[str, Any]] = Field( - default=None, - description="""The error result of the operation in case of failure or cancellation.""", + next_page_token: Optional[str] = Field(default=None, description="""""") + skill_revisions: Optional[list[SkillRevision]] = Field( + default=None, description="""List of Skill Revisions.""" ) -class RestoreVersionOperationDict(TypedDict, total=False): - """Represents the restore version 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}`.""" +class ListSkillRevisionsResponseDict(TypedDict, total=False): + """Response for listing Skill Revisions.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + sdk_http_response: Optional[genai_types.HttpResponseDict] + """Used to retain the full HTTP response.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + next_page_token: Optional[str] + """""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + skill_revisions: Optional[list[SkillRevisionDict]] + """List of Skill Revisions.""" -RestoreVersionOperationOrDict = Union[ - RestoreVersionOperation, RestoreVersionOperationDict +ListSkillRevisionsResponseOrDict = Union[ + ListSkillRevisionsResponse, ListSkillRevisionsResponseDict ] -class UpdatePromptConfig(_common.BaseModel): - """Config for creating a dataset resource to store prompts.""" +class ListPublisherModelsConfig(_common.BaseModel): + """Config for listing publisher models.""" http_options: Optional[genai_types.HttpOptions] = Field( default=None, description="""Used to override HTTP request options.""" ) - prompt_display_name: Optional[str] = Field( - default=None, description="""The updated display name for the prompt.""" - ) - version_display_name: Optional[str] = Field( - default=None, - description="""The updated display name for the prompt version. If not set, a default name with a timestamp will be used.""", - ) - timeout: Optional[int] = Field( - default=90, - description="""The timeout for the update_dataset_resource request in seconds. If not set, the default timeout is 90 seconds.""", + page_size: Optional[int] = Field(default=None, description="""""") + page_token: Optional[str] = Field(default=None, description="""""") + filter: Optional[str] = Field( + default=None, description="""Filter string for publisher models.""" ) - encryption_spec: Optional[genai_types.EncryptionSpec] = Field( - default=None, - description="""Customer-managed encryption key spec for a prompt dataset. If set, this prompt dataset and all sub-resources of this prompt dataset will be secured by this key.""", + list_all_versions: Optional[bool] = Field( + default=None, description="""Whether to list all versions.""" ) -class UpdatePromptConfigDict(TypedDict, total=False): - """Config for creating a dataset resource to store prompts.""" +class ListPublisherModelsConfigDict(TypedDict, total=False): + """Config for listing publisher models.""" http_options: Optional[genai_types.HttpOptionsDict] """Used to override HTTP request options.""" - prompt_display_name: Optional[str] - """The updated display name for the prompt.""" + page_size: Optional[int] + """""" - version_display_name: Optional[str] - """The updated display name for the prompt version. If not set, a default name with a timestamp will be used.""" + page_token: Optional[str] + """""" - timeout: Optional[int] - """The timeout for the update_dataset_resource request in seconds. If not set, the default timeout is 90 seconds.""" + filter: Optional[str] + """Filter string for publisher models.""" - encryption_spec: Optional[genai_types.EncryptionSpecDict] - """Customer-managed encryption key spec for a prompt dataset. If set, this prompt dataset and all sub-resources of this prompt dataset will be secured by this key.""" + list_all_versions: Optional[bool] + """Whether to list all versions.""" -UpdatePromptConfigOrDict = Union[UpdatePromptConfig, UpdatePromptConfigDict] +ListPublisherModelsConfigOrDict = Union[ + ListPublisherModelsConfig, ListPublisherModelsConfigDict +] -class _UpdateDatasetParameters(_common.BaseModel): - """Parameters for creating a dataset resource to store prompts.""" +class _ListPublisherModelsRequestParameters(_common.BaseModel): + """Parameters for listing publisher models.""" - name: Optional[str] = Field(default=None, description="""""") - dataset_id: Optional[str] = Field(default=None, description="""""") - display_name: Optional[str] = Field(default=None, description="""""") - metadata: Optional[SchemaTextPromptDatasetMetadata] = Field( - default=None, description="""""" - ) - description: Optional[str] = Field(default=None, description="""""") - encryption_spec: Optional[genai_types.EncryptionSpec] = Field( + parent: Optional[str] = Field(default=None, description="""""") + config: Optional[ListPublisherModelsConfig] = Field( default=None, description="""""" ) - model_reference: Optional[str] = Field(default=None, description="""""") - config: Optional[UpdatePromptConfig] = Field(default=None, description="""""") -class _UpdateDatasetParametersDict(TypedDict, total=False): - """Parameters for creating a dataset resource to store prompts.""" +class _ListPublisherModelsRequestParametersDict(TypedDict, total=False): + """Parameters for listing publisher models.""" - name: Optional[str] + parent: Optional[str] """""" - dataset_id: Optional[str] + config: Optional[ListPublisherModelsConfigDict] """""" - display_name: Optional[str] - """""" - metadata: Optional[SchemaTextPromptDatasetMetadataDict] - """""" +_ListPublisherModelsRequestParametersOrDict = Union[ + _ListPublisherModelsRequestParameters, _ListPublisherModelsRequestParametersDict +] + + +class PublisherModelResourceReference(_common.BaseModel): + """Reference to a resource.""" + + description: Optional[str] = Field( + default=None, description="""Description of the resource.""" + ) + resource_name: Optional[str] = Field( + default=None, description="""The resource name of the Google Cloud resource.""" + ) + uri: Optional[str] = Field(default=None, description="""The URI of the resource.""") + use_case: Optional[str] = Field( + default=None, description="""Use case (CUJ) of the resource.""" + ) + + +class PublisherModelResourceReferenceDict(TypedDict, total=False): + """Reference to a resource.""" description: Optional[str] - """""" + """Description of the resource.""" - encryption_spec: Optional[genai_types.EncryptionSpecDict] - """""" + resource_name: Optional[str] + """The resource name of the Google Cloud resource.""" - model_reference: Optional[str] - """""" + uri: Optional[str] + """The URI of the resource.""" - config: Optional[UpdatePromptConfigDict] - """""" + use_case: Optional[str] + """Use case (CUJ) of the resource.""" -_UpdateDatasetParametersOrDict = Union[ - _UpdateDatasetParameters, _UpdateDatasetParametersDict +PublisherModelResourceReferenceOrDict = Union[ + PublisherModelResourceReference, PublisherModelResourceReferenceDict ] -class GetSkillConfig(_common.BaseModel): - """Config for getting a skill.""" +class PublisherModelParent(_common.BaseModel): + """The information about the parent of a model.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + display_name: Optional[str] = Field( + default=None, + description="""Required. The display name of the parent. E.g., LaMDA, T5, Vision API, Natural Language API.""", + ) + reference: Optional[PublisherModelResourceReference] = Field( + default=None, + description="""Optional. The Google Cloud resource name or the URI reference.""", ) -class GetSkillConfigDict(TypedDict, total=False): - """Config for getting a skill.""" +class PublisherModelParentDict(TypedDict, total=False): + """The information about the parent of a model.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + display_name: Optional[str] + """Required. The display name of the parent. E.g., LaMDA, T5, Vision API, Natural Language API.""" + reference: Optional[PublisherModelResourceReferenceDict] + """Optional. The Google Cloud resource name or the URI reference.""" -GetSkillConfigOrDict = Union[GetSkillConfig, GetSkillConfigDict] +PublisherModelParentOrDict = Union[PublisherModelParent, PublisherModelParentDict] -class _GetSkillRequestParameters(_common.BaseModel): - """Parameters for GetSkillRequest.""" - name: Optional[str] = Field( +class PredictSchemata(_common.BaseModel): + """Contains the schemata used in Model's predictions and explanations via PredictionService.Predict, PredictionService.Explain and BatchPredictionJob.""" + + instance_schema_uri: Optional[str] = Field( default=None, - description="""The resource name of the Skill to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}""", + description="""Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single instance, which are used in PredictRequest.instances, ExplainRequest.instances and BatchPredictionJob.input_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""", + ) + parameters_schema_uri: Optional[str] = Field( + default=None, + description="""Immutable. Points to a YAML file stored on Google Cloud Storage describing the parameters of prediction and explanation via PredictRequest.parameters, ExplainRequest.parameters and BatchPredictionJob.model_parameters. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI, if no parameters are supported, then it is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""", + ) + prediction_schema_uri: Optional[str] = Field( + default=None, + description="""Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single prediction produced by this Model, which are returned via PredictResponse.predictions, ExplainResponse.explanations, and BatchPredictionJob.output_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""", ) - config: Optional[GetSkillConfig] = Field(default=None, description="""""") -class _GetSkillRequestParametersDict(TypedDict, total=False): - """Parameters for GetSkillRequest.""" +class PredictSchemataDict(TypedDict, total=False): + """Contains the schemata used in Model's predictions and explanations via PredictionService.Predict, PredictionService.Explain and BatchPredictionJob.""" - name: Optional[str] - """The resource name of the Skill to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}""" + instance_schema_uri: Optional[str] + """Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single instance, which are used in PredictRequest.instances, ExplainRequest.instances and BatchPredictionJob.input_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""" - config: Optional[GetSkillConfigDict] - """""" + parameters_schema_uri: Optional[str] + """Immutable. Points to a YAML file stored on Google Cloud Storage describing the parameters of prediction and explanation via PredictRequest.parameters, ExplainRequest.parameters and BatchPredictionJob.model_parameters. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI, if no parameters are supported, then it is set to an empty string. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""" + prediction_schema_uri: Optional[str] + """Immutable. Points to a YAML file stored on Google Cloud Storage describing the format of a single prediction produced by this Model, which are returned via PredictResponse.predictions, ExplainResponse.explanations, and BatchPredictionJob.output_config. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML Models always have this field populated by Vertex AI. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.""" -_GetSkillRequestParametersOrDict = Union[ - _GetSkillRequestParameters, _GetSkillRequestParametersDict -] +PredictSchemataOrDict = Union[PredictSchemata, PredictSchemataDict] -class Skill(_common.BaseModel): - """Represents a Skill resource. - Patches the type from the discovery document. - """ +class PublisherModelCallToActionRegionalResourceReferences(_common.BaseModel): + """The regional resource name or the URI. Key is region, e.g., us-central1, europe-west2, global, etc..""" - name: Optional[str] = Field( - default=None, - description="""Identifier. The resource name of the Skill. Format: `projects/{project}/locations/{location}/skills/{skill}`""", - ) - create_time: Optional[datetime.datetime] = Field( - default=None, - description="""Output only. Timestamp when this Skill was created.""", - ) - update_time: Optional[datetime.datetime] = Field( + colab_notebook_disabled: Optional[bool] = Field( default=None, - description="""Output only. Timestamp when this Skill was most recently updated.""", + description="""Optional. For notebook resource. When set to true, the Colab Enterprise link will be disabled in the "open notebook" dialog in UI.""", ) - display_name: Optional[str] = Field( - default=None, - description="""Required. Provides the display name of the Skill. This should align with `name` in the `SKILL.md` file.""", + references: Optional[dict[str, PublisherModelResourceReference]] = Field( + default=None, description="""Required.""" ) - description: Optional[str] = Field( - default=None, - description="""Required. Describes the Skill. Should describe both what the skill does and when to use it. Should include specific keywords that help agents identify relevant tasks. This should align with `description` in the `SKILL.md` file.""", + resource_description: Optional[str] = Field( + default=None, description="""Optional. Description of the resource.""" ) - license: Optional[str] = Field( - default=None, - description="""Optional. Specifies the license of the Skill. This should be an SPDX license identifier (e.g., "MIT", "Apache-2.0"). See https://spdx.org/licenses/. This should align with `license` in the `SKILL.md` file.""", + resource_title: Optional[str] = Field( + default=None, description="""Optional. Title of the resource.""" ) - compatibility: Optional[str] = Field( - default=None, - description="""Optional. Specifies the compatibility of the Skill. Indicates environment requirements (intended product, system packages, network access, etc.). This should align with `compatibility` in the `SKILL.md` file.""", + resource_use_case: Optional[str] = Field( + default=None, description="""Optional. Use case (CUJ) of the resource.""" ) - zipped_filesystem: Optional[str] = Field( + supports_workbench: Optional[bool] = Field( default=None, - description="""Required. Provides the zipped filesystem of the Skill. This should contain the `SKILL.md` file at the root of the zip and optional directories for scripts, references, and assets. Directory should align with the directory structure specified at https://agentskills.io/specification#directory-structure.""", - ) - state: Optional[SkillState] = Field( - default=None, description="""Output only. The state of the Skill.""" + description="""Optional. For notebook resource, whether the notebook supports Workbench.""", ) - labels: Optional[dict[str, str]] = Field( + title: Optional[str] = Field(default=None, description="""Required. """) + + +class PublisherModelCallToActionRegionalResourceReferencesDict(TypedDict, total=False): + """The regional resource name or the URI. Key is region, e.g., us-central1, europe-west2, global, etc..""" + + colab_notebook_disabled: Optional[bool] + """Optional. For notebook resource. When set to true, the Colab Enterprise link will be disabled in the "open notebook" dialog in UI.""" + + references: Optional[dict[str, PublisherModelResourceReferenceDict]] + """Required.""" + + resource_description: Optional[str] + """Optional. Description of the resource.""" + + resource_title: Optional[str] + """Optional. Title of the resource.""" + + resource_use_case: Optional[str] + """Optional. Use case (CUJ) of the resource.""" + + supports_workbench: Optional[bool] + """Optional. For notebook resource, whether the notebook supports Workbench.""" + + title: Optional[str] + """Required. """ + + +PublisherModelCallToActionRegionalResourceReferencesOrDict = Union[ + PublisherModelCallToActionRegionalResourceReferences, + PublisherModelCallToActionRegionalResourceReferencesDict, +] + + +class AutomaticResources(_common.BaseModel): + """A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration. Each Model supporting these resources documents its specific guidelines.""" + + max_replica_count: Optional[int] = Field( default=None, - description="""The labels with user-defined metadata to organize Skills.""", + description="""Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, a no upper bound for scaling under heavy traffic will be assume, though Vertex AI may be unable to scale beyond certain replica number.""", ) - sha256: Optional[str] = Field( + min_replica_count: Optional[int] = Field( default=None, - description="""Output only. The SHA256 checksum of the zipped filesystem.""", - ) - skill_source: Optional[SkillSource] = Field( - default=None, description="""Output only. The source of the Skill.""" + description="""Immutable. The minimum number of replicas that will be always deployed on. If traffic against it increases, it may dynamically be deployed onto more replicas up to max_replica_count, and as traffic decreases, some of these extra replicas may be freed. If the requested value is too large, the deployment will error.""", ) -class SkillDict(TypedDict, total=False): - """Represents a Skill resource. +class AutomaticResourcesDict(TypedDict, total=False): + """A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration. Each Model supporting these resources documents its specific guidelines.""" - Patches the type from the discovery document. - """ + max_replica_count: Optional[int] + """Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, a no upper bound for scaling under heavy traffic will be assume, though Vertex AI may be unable to scale beyond certain replica number.""" - name: Optional[str] - """Identifier. The resource name of the Skill. Format: `projects/{project}/locations/{location}/skills/{skill}`""" + min_replica_count: Optional[int] + """Immutable. The minimum number of replicas that will be always deployed on. If traffic against it increases, it may dynamically be deployed onto more replicas up to max_replica_count, and as traffic decreases, some of these extra replicas may be freed. If the requested value is too large, the deployment will error.""" - create_time: Optional[datetime.datetime] - """Output only. Timestamp when this Skill was created.""" - update_time: Optional[datetime.datetime] - """Output only. Timestamp when this Skill was most recently updated.""" +AutomaticResourcesOrDict = Union[AutomaticResources, AutomaticResourcesDict] - display_name: Optional[str] - """Required. Provides the display name of the Skill. This should align with `name` in the `SKILL.md` file.""" - description: Optional[str] - """Required. Describes the Skill. Should describe both what the skill does and when to use it. Should include specific keywords that help agents identify relevant tasks. This should align with `description` in the `SKILL.md` file.""" +class Port(_common.BaseModel): + """Represents a network port in a container.""" - license: Optional[str] - """Optional. Specifies the license of the Skill. This should be an SPDX license identifier (e.g., "MIT", "Apache-2.0"). See https://spdx.org/licenses/. This should align with `license` in the `SKILL.md` file.""" + container_port: Optional[int] = Field( + default=None, + description="""The number of the port to expose on the pod's IP address. Must be a valid port number, between 1 and 65535 inclusive.""", + ) - compatibility: Optional[str] - """Optional. Specifies the compatibility of the Skill. Indicates environment requirements (intended product, system packages, network access, etc.). This should align with `compatibility` in the `SKILL.md` file.""" - zipped_filesystem: Optional[str] - """Required. Provides the zipped filesystem of the Skill. This should contain the `SKILL.md` file at the root of the zip and optional directories for scripts, references, and assets. Directory should align with the directory structure specified at https://agentskills.io/specification#directory-structure.""" +class PortDict(TypedDict, total=False): + """Represents a network port in a container.""" - state: Optional[SkillState] - """Output only. The state of the Skill.""" + container_port: Optional[int] + """The number of the port to expose on the pod's IP address. Must be a valid port number, between 1 and 65535 inclusive.""" - labels: Optional[dict[str, str]] - """The labels with user-defined metadata to organize Skills.""" - sha256: Optional[str] - """Output only. The SHA256 checksum of the zipped filesystem.""" +PortOrDict = Union[Port, PortDict] - skill_source: Optional[SkillSource] - """Output only. The source of the Skill.""" +class ProbeExecAction(_common.BaseModel): + """ExecAction specifies a command to execute.""" -SkillOrDict = Union[Skill, SkillDict] + command: Optional[list[str]] = Field( + default=None, + description="""Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.""", + ) -class RetrieveSkillsConfig(_common.BaseModel): - """Config for retrieving skills.""" +class ProbeExecActionDict(TypedDict, total=False): + """ExecAction specifies a command to execute.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + command: Optional[list[str]] + """Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.""" + + +ProbeExecActionOrDict = Union[ProbeExecAction, ProbeExecActionDict] + + +class ProbeGrpcAction(_common.BaseModel): + """GrpcAction checks the health of a container using a gRPC service.""" + + port: Optional[int] = Field( + default=None, + description="""Port number of the gRPC service. Number must be in the range 1 to 65535.""", ) - top_k: Optional[int] = Field( + service: Optional[str] = Field( default=None, - description="""Optional. The maximum number of skills to return. The service may - return fewer than this value. If unspecified, at most 10 skills will be - returned. The maximum value is 100. - """, + description="""Service is the name of the service to place in the gRPC HealthCheckRequest. See https://github.com/grpc/grpc/blob/master/doc/health-checking.md. If this is not specified, the default behavior is defined by gRPC.""", ) -class RetrieveSkillsConfigDict(TypedDict, total=False): - """Config for retrieving skills.""" +class ProbeGrpcActionDict(TypedDict, total=False): + """GrpcAction checks the health of a container using a gRPC service.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + port: Optional[int] + """Port number of the gRPC service. Number must be in the range 1 to 65535.""" - top_k: Optional[int] - """Optional. The maximum number of skills to return. The service may - return fewer than this value. If unspecified, at most 10 skills will be - returned. The maximum value is 100. - """ + service: Optional[str] + """Service is the name of the service to place in the gRPC HealthCheckRequest. See https://github.com/grpc/grpc/blob/master/doc/health-checking.md. If this is not specified, the default behavior is defined by gRPC.""" -RetrieveSkillsConfigOrDict = Union[RetrieveSkillsConfig, RetrieveSkillsConfigDict] +ProbeGrpcActionOrDict = Union[ProbeGrpcAction, ProbeGrpcActionDict] -class _RetrieveSkillsRequestParameters(_common.BaseModel): - """Parameters for retrieving skills.""" +class ProbeHttpHeader(_common.BaseModel): + """HttpHeader describes a custom header to be used in HTTP probes""" - query: Optional[str] = Field( - default=None, description="""Required. The query to find matching skills.""" + name: Optional[str] = Field( + default=None, + description="""The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.""", ) - config: Optional[RetrieveSkillsConfig] = Field(default=None, description="""""") + value: Optional[str] = Field(default=None, description="""The header field value""") -class _RetrieveSkillsRequestParametersDict(TypedDict, total=False): - """Parameters for retrieving skills.""" +class ProbeHttpHeaderDict(TypedDict, total=False): + """HttpHeader describes a custom header to be used in HTTP probes""" - query: Optional[str] - """Required. The query to find matching skills.""" + name: Optional[str] + """The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.""" - config: Optional[RetrieveSkillsConfigDict] - """""" + value: Optional[str] + """The header field value""" -_RetrieveSkillsRequestParametersOrDict = Union[ - _RetrieveSkillsRequestParameters, _RetrieveSkillsRequestParametersDict -] +ProbeHttpHeaderOrDict = Union[ProbeHttpHeader, ProbeHttpHeaderDict] -class RetrievedSkill(_common.BaseModel): - """A retrieved skill from semantic search.""" +class ProbeHttpGetAction(_common.BaseModel): + """HttpGetAction describes an action based on HTTP Get requests.""" - skill_name: Optional[str] = Field( - default=None, description="""The resource name of the skill.""" + host: Optional[str] = Field( + default=None, + description="""Host name to connect to, defaults to the model serving container's IP. You probably want to set "Host" in httpHeaders instead.""", ) - description: Optional[str] = Field( - default=None, description="""The description of the skill.""" + http_headers: Optional[list[ProbeHttpHeader]] = Field( + default=None, + description="""Custom headers to set in the request. HTTP allows repeated headers.""", + ) + path: Optional[str] = Field( + default=None, description="""Path to access on the HTTP server.""" + ) + port: Optional[int] = Field( + default=None, + description="""Number of the port to access on the container. Number must be in the range 1 to 65535.""", + ) + scheme: Optional[str] = Field( + default=None, + description="""Scheme to use for connecting to the host. Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS".""", ) -class RetrievedSkillDict(TypedDict, total=False): - """A retrieved skill from semantic search.""" +class ProbeHttpGetActionDict(TypedDict, total=False): + """HttpGetAction describes an action based on HTTP Get requests.""" - skill_name: Optional[str] - """The resource name of the skill.""" + host: Optional[str] + """Host name to connect to, defaults to the model serving container's IP. You probably want to set "Host" in httpHeaders instead.""" - description: Optional[str] - """The description of the skill.""" + http_headers: Optional[list[ProbeHttpHeaderDict]] + """Custom headers to set in the request. HTTP allows repeated headers.""" + path: Optional[str] + """Path to access on the HTTP server.""" -RetrievedSkillOrDict = Union[RetrievedSkill, RetrievedSkillDict] + port: Optional[int] + """Number of the port to access on the container. Number must be in the range 1 to 65535.""" + scheme: Optional[str] + """Scheme to use for connecting to the host. Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS".""" -class RetrieveSkillsResponse(_common.BaseModel): - """Response for retrieving skills.""" - retrieved_skills: Optional[list[RetrievedSkill]] = Field( - default=None, description="""List of retrieved skills ranked by similarity.""" +ProbeHttpGetActionOrDict = Union[ProbeHttpGetAction, ProbeHttpGetActionDict] + + +class ProbeTcpSocketAction(_common.BaseModel): + """TcpSocketAction probes the health of a container by opening a TCP socket connection.""" + + host: Optional[str] = Field( + default=None, + description="""Optional: Host name to connect to, defaults to the model serving container's IP.""", + ) + port: Optional[int] = Field( + default=None, + description="""Number of the port to access on the container. Number must be in the range 1 to 65535.""", ) -class RetrieveSkillsResponseDict(TypedDict, total=False): - """Response for retrieving skills.""" +class ProbeTcpSocketActionDict(TypedDict, total=False): + """TcpSocketAction probes the health of a container by opening a TCP socket connection.""" - retrieved_skills: Optional[list[RetrievedSkillDict]] - """List of retrieved skills ranked by similarity.""" + host: Optional[str] + """Optional: Host name to connect to, defaults to the model serving container's IP.""" + port: Optional[int] + """Number of the port to access on the container. Number must be in the range 1 to 65535.""" -RetrieveSkillsResponseOrDict = Union[RetrieveSkillsResponse, RetrieveSkillsResponseDict] +ProbeTcpSocketActionOrDict = Union[ProbeTcpSocketAction, ProbeTcpSocketActionDict] -class CreateSkillConfig(_common.BaseModel): - """Config for creating a skill.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" +class Probe(_common.BaseModel): + """Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.""" + + exec: Optional[ProbeExecAction] = Field( + default=None, + description="""ExecAction probes the health of a container by executing a command.""", ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Whether to wait for the long running operation to complete.""", + failure_threshold: Optional[int] = Field( + default=None, + description="""Number of consecutive failures before the probe is considered failed. Defaults to 3. Minimum value is 1. Maps to Kubernetes probe argument 'failureThreshold'.""", ) - local_path: Optional[str] = Field( + grpc: Optional[ProbeGrpcAction] = Field( default=None, - description="""Optional. The local path to the directory containing the Skill to - be zipped and uploaded. - """, + description="""GrpcAction probes the health of a container by sending a gRPC request.""", ) - zipped_filesystem: Optional[Any] = Field( - default=None, description="""Optional. The zipped filesystem of the Skill.""" + http_get: Optional[ProbeHttpGetAction] = Field( + default=None, + description="""HttpGetAction probes the health of a container by sending an HTTP GET request.""", ) - skill_id: Optional[str] = Field( + initial_delay_seconds: Optional[int] = Field( default=None, - description="""Optional. The ID to use for the Skill, which will become the final - component of the Skill's resource name. - """, + description="""Number of seconds to wait before starting the probe. Defaults to 0. Minimum value is 0. Maps to Kubernetes probe argument 'initialDelaySeconds'.""", + ) + period_seconds: Optional[int] = Field( + default=None, + description="""How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Must be less than timeout_seconds. Maps to Kubernetes probe argument 'periodSeconds'.""", + ) + success_threshold: Optional[int] = Field( + default=None, + description="""Number of consecutive successes before the probe is considered successful. Defaults to 1. Minimum value is 1. Maps to Kubernetes probe argument 'successThreshold'.""", + ) + tcp_socket: Optional[ProbeTcpSocketAction] = Field( + default=None, + description="""TcpSocketAction probes the health of a container by opening a TCP socket connection.""", + ) + timeout_seconds: Optional[int] = Field( + default=None, + description="""Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Must be greater or equal to period_seconds. Maps to Kubernetes probe argument 'timeoutSeconds'.""", ) -class CreateSkillConfigDict(TypedDict, total=False): - """Config for creating a skill.""" - - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" - - wait_for_completion: Optional[bool] - """Whether to wait for the long running operation to complete.""" - - local_path: Optional[str] - """Optional. The local path to the directory containing the Skill to - be zipped and uploaded. - """ - - zipped_filesystem: Optional[Any] - """Optional. The zipped filesystem of the Skill.""" - - skill_id: Optional[str] - """Optional. The ID to use for the Skill, which will become the final - component of the Skill's resource name. - """ - +class ProbeDict(TypedDict, total=False): + """Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.""" -CreateSkillConfigOrDict = Union[CreateSkillConfig, CreateSkillConfigDict] + exec: Optional[ProbeExecActionDict] + """ExecAction probes the health of a container by executing a command.""" + failure_threshold: Optional[int] + """Number of consecutive failures before the probe is considered failed. Defaults to 3. Minimum value is 1. Maps to Kubernetes probe argument 'failureThreshold'.""" -class _CreateSkillRequestParameters(_common.BaseModel): - """Parameters for creating a skill.""" + grpc: Optional[ProbeGrpcActionDict] + """GrpcAction probes the health of a container by sending a gRPC request.""" - display_name: Optional[str] = Field( - default=None, description="""Required. The display name of the Skill.""" - ) - description: Optional[str] = Field( - default=None, description="""Required. The description of the Skill.""" - ) - config: Optional[CreateSkillConfig] = Field(default=None, description="""""") + http_get: Optional[ProbeHttpGetActionDict] + """HttpGetAction probes the health of a container by sending an HTTP GET request.""" + initial_delay_seconds: Optional[int] + """Number of seconds to wait before starting the probe. Defaults to 0. Minimum value is 0. Maps to Kubernetes probe argument 'initialDelaySeconds'.""" -class _CreateSkillRequestParametersDict(TypedDict, total=False): - """Parameters for creating a skill.""" + period_seconds: Optional[int] + """How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Must be less than timeout_seconds. Maps to Kubernetes probe argument 'periodSeconds'.""" - display_name: Optional[str] - """Required. The display name of the Skill.""" + success_threshold: Optional[int] + """Number of consecutive successes before the probe is considered successful. Defaults to 1. Minimum value is 1. Maps to Kubernetes probe argument 'successThreshold'.""" - description: Optional[str] - """Required. The description of the Skill.""" + tcp_socket: Optional[ProbeTcpSocketActionDict] + """TcpSocketAction probes the health of a container by opening a TCP socket connection.""" - config: Optional[CreateSkillConfigDict] - """""" + timeout_seconds: Optional[int] + """Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Must be greater or equal to period_seconds. Maps to Kubernetes probe argument 'timeoutSeconds'.""" -_CreateSkillRequestParametersOrDict = Union[ - _CreateSkillRequestParameters, _CreateSkillRequestParametersDict -] +ProbeOrDict = Union[Probe, ProbeDict] -class SkillOperation(_common.BaseModel): - """Operation that has a skill as a response.""" +class ModelContainerSpec(_common.BaseModel): + """Specification of a container for serving predictions. Some fields in this message correspond to fields in the [Kubernetes Container v1 core specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" - name: Optional[str] = Field( + args: Optional[list[str]] = Field( default=None, - description="""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}`.""", + description="""Immutable. Specifies arguments for the command that runs when the container starts. This overrides the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify this field as an array of executable and arguments, similar to a Docker `CMD`'s "default parameters" form. If you don't specify this field but do specify the command field, then the command from the `command` field runs without any additional arguments. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). If you don't specify this field and don't specify the `command` field, then the container's [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and `CMD` determine what runs based on their default behavior. See the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `args` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", ) - metadata: Optional[dict[str, Any]] = Field( + command: Optional[list[str]] = Field( default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", + description="""Immutable. Specifies the command that runs when the container starts. This overrides the container's [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). Specify this field as an array of executable and arguments, similar to a Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. If you do not specify this field, then the container's `ENTRYPOINT` runs, in conjunction with the args field or the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), if either exists. If this field is not specified and the container does not have an `ENTRYPOINT`, then refer to the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). If you specify this field, then you can also specify the `args` field to provide additional arguments for this command. However, if you specify this field, then the container's `CMD` is ignored. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `command` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", ) - done: Optional[bool] = Field( + deployment_timeout: Optional[str] = Field( default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", + description="""Immutable. Deployment timeout. Limit for deployment timeout is 2 hours.""", ) - error: Optional[dict[str, Any]] = Field( + env: Optional[list[EnvVar]] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Immutable. List of environment variables to set in the container. After the container starts running, code running in the container can read these environment variables. Additionally, the command and args fields can reference these variables. Later entries in this list can also reference earlier entries. For example, the following example sets the variable `VAR_2` to have the value `foo bar`: ```json [ { "name": "VAR_1", "value": "foo" }, { "name": "VAR_2", "value": "$(VAR_1) bar" } ] ``` If you switch the order of the variables in the example, then the expansion does not occur. This field corresponds to the `env` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", ) - response: Optional[Skill] = Field( - default=None, description="""The created Skill.""" + grpc_ports: Optional[list[Port]] = Field( + default=None, + description="""Immutable. List of ports to expose from the container. Vertex AI sends gRPC prediction requests that it receives to the first port on this list. Vertex AI also sends liveness and health checks to this port. If you do not specify this field, gRPC requests to the container will be disabled. Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers v1 core API.""", + ) + health_probe: Optional[Probe] = Field( + default=None, + description="""Immutable. Specification for Kubernetes readiness probe.""", + ) + health_route: Optional[str] = Field( + default=None, + description="""Immutable. HTTP path on the container to send health checks to. Vertex AI intermittently sends GET requests to this path on the container's IP address and port to check that the container is healthy. Read more about [health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). For example, if you set this field to `/bar`, then Vertex AI intermittently sends a GET request to the `/bar` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/ DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""", + ) + image_uri: Optional[str] = Field( + default=None, + description="""Required. Immutable. URI of the Docker image to be used as the custom container for serving predictions. This URI must identify an image in Artifact Registry or Container Registry. Learn more about the [container publishing requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), including permissions requirements for the Vertex AI Service Agent. The container image is ingested upon ModelService.UploadModel, stored internally, and this original path is afterwards not used. To learn about the requirements for the Docker image itself, see [Custom container requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). You can use the URI to one of Vertex AI's [pre-built container images for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) in this field.""", + ) + invoke_route_prefix: Optional[str] = Field( + default=None, + description="""Immutable. Invoke route prefix for the custom container. "/*" is the only supported value right now. By setting this field, any non-root route on this model will be accessible with invoke http call eg: "/invoke/foo/bar", however the [PredictionService.Invoke] RPC is not supported yet. Only one of `predict_route` or `invoke_route_prefix` can be set, and we default to using `predict_route` if this field is not set. If this field is set, the Model can only be deployed to dedicated endpoint.""", + ) + liveness_probe: Optional[Probe] = Field( + default=None, + description="""Immutable. Specification for Kubernetes liveness probe.""", + ) + ports: Optional[list[Port]] = Field( + default=None, + description="""Immutable. List of ports to expose from the container. Vertex AI sends any prediction requests that it receives to the first port on this list. Vertex AI also sends [liveness and health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) to this port. If you do not specify this field, it defaults to following value: ```json [ { "containerPort": 8080 } ] ``` Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""", + ) + predict_route: Optional[str] = Field( + default=None, + description="""Immutable. HTTP path on the container to send prediction requests to. Vertex AI forwards requests sent using projects.locations.endpoints.predict to this path on the container's IP address and port. Vertex AI then returns the container's response in the API response. For example, if you set this field to `/foo`, then when Vertex AI receives a prediction request, it forwards the request body in a POST request to the `/foo` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""", + ) + shared_memory_size_mb: Optional[int] = Field( + default=None, + description="""Immutable. The amount of the VM memory to reserve as the shared memory for the model in megabytes.""", + ) + startup_probe: Optional[Probe] = Field( + default=None, + description="""Immutable. Specification for Kubernetes startup probe.""", ) -class SkillOperationDict(TypedDict, total=False): - """Operation that has a skill as a response.""" +class ModelContainerSpecDict(TypedDict, total=False): + """Specification of a container for serving predictions. Some fields in this message correspond to fields in the [Kubernetes Container v1 core specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" - 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}`.""" + args: Optional[list[str]] + """Immutable. Specifies arguments for the command that runs when the container starts. This overrides the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify this field as an array of executable and arguments, similar to a Docker `CMD`'s "default parameters" form. If you don't specify this field but do specify the command field, then the command from the `command` field runs without any additional arguments. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). If you don't specify this field and don't specify the `command` field, then the container's [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and `CMD` determine what runs based on their default behavior. See the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `args` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" + command: Optional[list[str]] + """Immutable. Specifies the command that runs when the container starts. This overrides the container's [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). Specify this field as an array of executable and arguments, similar to a Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. If you do not specify this field, then the container's `ENTRYPOINT` runs, in conjunction with the args field or the container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), if either exists. If this field is not specified and the container does not have an `ENTRYPOINT`, then refer to the Docker documentation about [how `CMD` and `ENTRYPOINT` interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). If you specify this field, then you can also specify the `args` field to provide additional arguments for this command. However, if you specify this field, then the container's `CMD` is ignored. See the [Kubernetes documentation about how the `command` and `args` fields interact with a container's `ENTRYPOINT` and `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). In this field, you can reference [environment variables set by Vertex AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) and environment variables set in the env field. You cannot reference environment variables set in the Docker image. In order for environment variables to be expanded, reference them by using the following syntax: $( VARIABLE_NAME) Note that this differs from Bash variable expansion, which does not use parentheses. If a variable cannot be resolved, the reference in the input string is used unchanged. To avoid variable expansion, you can escape this syntax with `$$`; for example: $$(VARIABLE_NAME) This field corresponds to the `command` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" + deployment_timeout: Optional[str] + """Immutable. Deployment timeout. Limit for deployment timeout is 2 hours.""" - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" + env: Optional[list[EnvVarDict]] + """Immutable. List of environment variables to set in the container. After the container starts running, code running in the container can read these environment variables. Additionally, the command and args fields can reference these variables. Later entries in this list can also reference earlier entries. For example, the following example sets the variable `VAR_2` to have the value `foo bar`: ```json [ { "name": "VAR_1", "value": "foo" }, { "name": "VAR_2", "value": "$(VAR_1) bar" } ] ``` If you switch the order of the variables in the example, then the expansion does not occur. This field corresponds to the `env` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" - response: Optional[SkillDict] - """The created Skill.""" + grpc_ports: Optional[list[PortDict]] + """Immutable. List of ports to expose from the container. Vertex AI sends gRPC prediction requests that it receives to the first port on this list. Vertex AI also sends liveness and health checks to this port. If you do not specify this field, gRPC requests to the container will be disabled. Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers v1 core API.""" + health_probe: Optional[ProbeDict] + """Immutable. Specification for Kubernetes readiness probe.""" -SkillOperationOrDict = Union[SkillOperation, SkillOperationDict] + health_route: Optional[str] + """Immutable. HTTP path on the container to send health checks to. Vertex AI intermittently sends GET requests to this path on the container's IP address and port to check that the container is healthy. Read more about [health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). For example, if you set this field to `/bar`, then Vertex AI intermittently sends a GET request to the `/bar` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/ DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""" + + image_uri: Optional[str] + """Required. Immutable. URI of the Docker image to be used as the custom container for serving predictions. This URI must identify an image in Artifact Registry or Container Registry. Learn more about the [container publishing requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), including permissions requirements for the Vertex AI Service Agent. The container image is ingested upon ModelService.UploadModel, stored internally, and this original path is afterwards not used. To learn about the requirements for the Docker image itself, see [Custom container requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). You can use the URI to one of Vertex AI's [pre-built container images for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) in this field.""" + invoke_route_prefix: Optional[str] + """Immutable. Invoke route prefix for the custom container. "/*" is the only supported value right now. By setting this field, any non-root route on this model will be accessible with invoke http call eg: "/invoke/foo/bar", however the [PredictionService.Invoke] RPC is not supported yet. Only one of `predict_route` or `invoke_route_prefix` can be set, and we default to using `predict_route` if this field is not set. If this field is set, the Model can only be deployed to dedicated endpoint.""" -class UpdateSkillConfig(_common.BaseModel): - """Config for updating a skill.""" + liveness_probe: Optional[ProbeDict] + """Immutable. Specification for Kubernetes liveness probe.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Whether to wait for the long running operation to complete.""", - ) - local_path: Optional[str] = Field( + ports: Optional[list[PortDict]] + """Immutable. List of ports to expose from the container. Vertex AI sends any prediction requests that it receives to the first port on this list. Vertex AI also sends [liveness and health checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) to this port. If you do not specify this field, it defaults to following value: ```json [ { "containerPort": 8080 } ] ``` Vertex AI does not use ports other than the first one listed. This field corresponds to the `ports` field of the Kubernetes Containers [v1 core API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).""" + + predict_route: Optional[str] + """Immutable. HTTP path on the container to send prediction requests to. Vertex AI forwards requests sent using projects.locations.endpoints.predict to this path on the container's IP address and port. Vertex AI then returns the container's response in the API response. For example, if you set this field to `/foo`, then when Vertex AI receives a prediction request, it forwards the request body in a POST request to the `/foo` path on the port of your container specified by the first value of this `ModelContainerSpec`'s ports field. If you don't specify this field, it defaults to the following value when you deploy this Model to an Endpoint: /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict The placeholders in this value are replaced as follows: * ENDPOINT: The last segment (following `endpoints/`)of the Endpoint.name][] field of the Endpoint where this Model has been deployed. (Vertex AI makes this value available to your container code as the [`AIP_ENDPOINT_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) * DEPLOYED_MODEL: DeployedModel.id of the `DeployedModel`. (Vertex AI makes this value available to your container code as the [`AIP_DEPLOYED_MODEL_ID` environment variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)""" + + shared_memory_size_mb: Optional[int] + """Immutable. The amount of the VM memory to reserve as the shared memory for the model in megabytes.""" + + startup_probe: Optional[ProbeDict] + """Immutable. Specification for Kubernetes startup probe.""" + + +ModelContainerSpecOrDict = Union[ModelContainerSpec, ModelContainerSpecDict] + + +class AutoscalingMetricSpec(_common.BaseModel): + """The metric specification that defines the target resource utilization (CPU utilization, accelerator's duty cycle, and so on) for calculating the desired replica count.""" + + metric_name: Optional[str] = Field( default=None, - description="""Optional. The local path to the directory containing the Skill to - be zipped and uploaded. - """, - ) - display_name: Optional[str] = Field( - default=None, description="""Optional. The display name of the Skill.""" - ) - description: Optional[str] = Field( - default=None, description="""Optional. The description of the Skill.""" + description="""Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count` * `pubsub.googleapis.com/subscription/num_undelivered_messages` * `prometheus.googleapis.com/vertex_dcgm_fi_dev_gpu_util` * `prometheus.googleapis.com/vertex_vllm_gpu_cache_usage_perc` * `prometheus.googleapis.com/vertex_vllm_num_requests_waiting`""", ) - zipped_filesystem: Optional[Any] = Field( - default=None, description="""Optional. The zipped filesystem of the Skill.""" + monitored_resource_labels: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info""", ) - update_mask: Optional[str] = Field( - default=None, description="""Optional. The update mask to apply.""" + target: Optional[int] = Field( + default=None, + description="""The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.""", ) -class UpdateSkillConfigDict(TypedDict, total=False): - """Config for updating a skill.""" +class AutoscalingMetricSpecDict(TypedDict, total=False): + """The metric specification that defines the target resource utilization (CPU utilization, accelerator's duty cycle, and so on) for calculating the desired replica count.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + metric_name: Optional[str] + """Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count` * `pubsub.googleapis.com/subscription/num_undelivered_messages` * `prometheus.googleapis.com/vertex_dcgm_fi_dev_gpu_util` * `prometheus.googleapis.com/vertex_vllm_gpu_cache_usage_perc` * `prometheus.googleapis.com/vertex_vllm_num_requests_waiting`""" - wait_for_completion: Optional[bool] - """Whether to wait for the long running operation to complete.""" + monitored_resource_labels: Optional[dict[str, str]] + """Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info""" - local_path: Optional[str] - """Optional. The local path to the directory containing the Skill to - be zipped and uploaded. - """ + target: Optional[int] + """The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.""" - display_name: Optional[str] - """Optional. The display name of the Skill.""" - description: Optional[str] - """Optional. The description of the Skill.""" +AutoscalingMetricSpecOrDict = Union[AutoscalingMetricSpec, AutoscalingMetricSpecDict] - zipped_filesystem: Optional[Any] - """Optional. The zipped filesystem of the Skill.""" - update_mask: Optional[str] - """Optional. The update mask to apply.""" +class FlexStart(_common.BaseModel): + """FlexStart is used to schedule the deployment workload on DWS resource. It contains the max duration of the deployment.""" + + max_runtime_duration: Optional[str] = Field( + default=None, + description="""The max duration of the deployment is max_runtime_duration. The deployment will be terminated after the duration. The max_runtime_duration can be set up to 7 days.""", + ) -UpdateSkillConfigOrDict = Union[UpdateSkillConfig, UpdateSkillConfigDict] +class FlexStartDict(TypedDict, total=False): + """FlexStart is used to schedule the deployment workload on DWS resource. It contains the max duration of the deployment.""" + max_runtime_duration: Optional[str] + """The max duration of the deployment is max_runtime_duration. The deployment will be terminated after the duration. The max_runtime_duration can be set up to 7 days.""" -class _UpdateSkillRequestParameters(_common.BaseModel): - """Parameters for updating a skill.""" - name: Optional[str] = Field( +FlexStartOrDict = Union[FlexStart, FlexStartDict] + + +class DedicatedResourcesScaleToZeroSpec(_common.BaseModel): + """Specification for scale-to-zero feature.""" + + idle_scaledown_period: Optional[str] = Field( default=None, - description="""Required. The resource name of the Skill to update.""", + description="""Optional. Duration of no traffic before scaling to zero. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""", + ) + min_scaleup_period: Optional[str] = Field( + default=None, + description="""Optional. Minimum duration that a deployment will be scaled up before traffic is evaluated for potential scale-down. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""", ) - config: Optional[UpdateSkillConfig] = Field(default=None, description="""""") -class _UpdateSkillRequestParametersDict(TypedDict, total=False): - """Parameters for updating a skill.""" +class DedicatedResourcesScaleToZeroSpecDict(TypedDict, total=False): + """Specification for scale-to-zero feature.""" - name: Optional[str] - """Required. The resource name of the Skill to update.""" + idle_scaledown_period: Optional[str] + """Optional. Duration of no traffic before scaling to zero. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""" - config: Optional[UpdateSkillConfigDict] - """""" + min_scaleup_period: Optional[str] + """Optional. Minimum duration that a deployment will be scaled up before traffic is evaluated for potential scale-down. [MinValue=300] (5 minutes) [MaxValue=28800] (8 hours)""" -_UpdateSkillRequestParametersOrDict = Union[ - _UpdateSkillRequestParameters, _UpdateSkillRequestParametersDict +DedicatedResourcesScaleToZeroSpecOrDict = Union[ + DedicatedResourcesScaleToZeroSpec, DedicatedResourcesScaleToZeroSpecDict ] -class ListSkillsConfig(_common.BaseModel): - """Config for listing skills.""" +class DedicatedResources(_common.BaseModel): + """A description of resources that are dedicated to a DeployedModel or DeployedIndex, and that need a higher degree of manual configuration.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + autoscaling_metric_specs: Optional[list[AutoscalingMetricSpec]] = Field( + default=None, + description="""Immutable. The metric specifications that overrides a resource utilization metric (CPU utilization, accelerator's duty cycle, and so on) target value (default to 60 if not set). At most one entry is allowed per metric. If machine_spec.accelerator_count is above 0, the autoscaling will be based on both CPU utilization and accelerator's duty cycle metrics and scale up when either metrics exceeds its target value while scale down if both metrics are under their target value. The default target value is 60 for both metrics. If machine_spec.accelerator_count is 0, the autoscaling will be based on CPU utilization metric only with default target value 60 if not explicitly set. For example, in the case of Online Prediction, if you want to override target CPU utilization to 80, you should set autoscaling_metric_specs.metric_name to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and autoscaling_metric_specs.target to `80`.""", ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") - filter: Optional[str] = Field( - default=None, description="""Optional. The standard list filter.""" + flex_start: Optional[FlexStart] = Field( + default=None, + description="""Optional. Immutable. If set, use DWS resource to schedule the deployment workload. reference: (https://cloud.google.com/blog/products/compute/introducing-dynamic-workload-scheduler)""", + ) + initial_replica_count: Optional[int] = Field( + default=None, + description="""Immutable. Number of initial replicas being deployed on when scaling the workload up from zero or when creating the workload in case min_replica_count = 0. When min_replica_count > 0 (meaning that the scale-to-zero feature is not enabled), initial_replica_count should not be set. When min_replica_count = 0 (meaning that the scale-to-zero feature is enabled), initial_replica_count should be larger than zero, but no greater than max_replica_count.""", + ) + machine_spec: Optional[MachineSpec] = Field( + default=None, + description="""Required. Immutable. The specification of a single machine being used.""", + ) + max_replica_count: Optional[int] = Field( + default=None, + description="""Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, will use min_replica_count as the default value. The value of this field impacts the charge against Vertex CPU and GPU quotas. Specifically, you will be charged for (max_replica_count * number of cores in the selected machine type) and (max_replica_count * number of GPUs per replica in the selected machine type).""", + ) + min_replica_count: Optional[int] = Field( + default=None, + description="""Required. Immutable. The minimum number of machine replicas that will be always deployed on. This value must be greater than or equal to 1. If traffic increases, it may dynamically be deployed onto more replicas, and as traffic decreases, some of these extra replicas may be freed.""", + ) + required_replica_count: Optional[int] = Field( + default=None, + description="""Optional. Number of required available replicas for the deployment to succeed. This field is only needed when partial deployment/mutation is desired. If set, the deploy/mutate operation will succeed once available_replica_count reaches required_replica_count, and the rest of the replicas will be retried. If not set, the default required_replica_count will be min_replica_count.""", + ) + scale_to_zero_spec: Optional[DedicatedResourcesScaleToZeroSpec] = Field( + default=None, + description="""Optional. Specification for scale-to-zero feature.""", + ) + spot: Optional[bool] = Field( + default=None, + description="""Optional. If true, schedule the deployment workload on [spot VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).""", ) -class ListSkillsConfigDict(TypedDict, total=False): - """Config for listing skills.""" +class DedicatedResourcesDict(TypedDict, total=False): + """A description of resources that are dedicated to a DeployedModel or DeployedIndex, and that need a higher degree of manual configuration.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + autoscaling_metric_specs: Optional[list[AutoscalingMetricSpecDict]] + """Immutable. The metric specifications that overrides a resource utilization metric (CPU utilization, accelerator's duty cycle, and so on) target value (default to 60 if not set). At most one entry is allowed per metric. If machine_spec.accelerator_count is above 0, the autoscaling will be based on both CPU utilization and accelerator's duty cycle metrics and scale up when either metrics exceeds its target value while scale down if both metrics are under their target value. The default target value is 60 for both metrics. If machine_spec.accelerator_count is 0, the autoscaling will be based on CPU utilization metric only with default target value 60 if not explicitly set. For example, in the case of Online Prediction, if you want to override target CPU utilization to 80, you should set autoscaling_metric_specs.metric_name to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and autoscaling_metric_specs.target to `80`.""" - page_size: Optional[int] - """""" + flex_start: Optional[FlexStartDict] + """Optional. Immutable. If set, use DWS resource to schedule the deployment workload. reference: (https://cloud.google.com/blog/products/compute/introducing-dynamic-workload-scheduler)""" - page_token: Optional[str] - """""" + initial_replica_count: Optional[int] + """Immutable. Number of initial replicas being deployed on when scaling the workload up from zero or when creating the workload in case min_replica_count = 0. When min_replica_count > 0 (meaning that the scale-to-zero feature is not enabled), initial_replica_count should not be set. When min_replica_count = 0 (meaning that the scale-to-zero feature is enabled), initial_replica_count should be larger than zero, but no greater than max_replica_count.""" - filter: Optional[str] - """Optional. The standard list filter.""" + machine_spec: Optional[MachineSpecDict] + """Required. Immutable. The specification of a single machine being used.""" + max_replica_count: Optional[int] + """Immutable. The maximum number of replicas that may be deployed on when the traffic against it increases. If the requested value is too large, the deployment will error, but if deployment succeeds then the ability to scale to that many replicas is guaranteed (barring service outages). If traffic increases beyond what its replicas at maximum may handle, a portion of the traffic will be dropped. If this value is not provided, will use min_replica_count as the default value. The value of this field impacts the charge against Vertex CPU and GPU quotas. Specifically, you will be charged for (max_replica_count * number of cores in the selected machine type) and (max_replica_count * number of GPUs per replica in the selected machine type).""" -ListSkillsConfigOrDict = Union[ListSkillsConfig, ListSkillsConfigDict] + min_replica_count: Optional[int] + """Required. Immutable. The minimum number of machine replicas that will be always deployed on. This value must be greater than or equal to 1. If traffic increases, it may dynamically be deployed onto more replicas, and as traffic decreases, some of these extra replicas may be freed.""" + required_replica_count: Optional[int] + """Optional. Number of required available replicas for the deployment to succeed. This field is only needed when partial deployment/mutation is desired. If set, the deploy/mutate operation will succeed once available_replica_count reaches required_replica_count, and the rest of the replicas will be retried. If not set, the default required_replica_count will be min_replica_count.""" -class _ListSkillsRequestParameters(_common.BaseModel): - """Parameters for listing skills.""" + scale_to_zero_spec: Optional[DedicatedResourcesScaleToZeroSpecDict] + """Optional. Specification for scale-to-zero feature.""" - config: Optional[ListSkillsConfig] = Field(default=None, description="""""") + spot: Optional[bool] + """Optional. If true, schedule the deployment workload on [spot VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).""" -class _ListSkillsRequestParametersDict(TypedDict, total=False): - """Parameters for listing skills.""" +DedicatedResourcesOrDict = Union[DedicatedResources, DedicatedResourcesDict] - config: Optional[ListSkillsConfigDict] - """""" +class PublisherModelCallToActionDeployDeployMetadata(_common.BaseModel): + """Metadata information about the deployment for managing deployment config.""" -_ListSkillsRequestParametersOrDict = Union[ - _ListSkillsRequestParameters, _ListSkillsRequestParametersDict -] + labels: Optional[dict[str, str]] = Field( + default=None, + description="""Optional. Labels for the deployment config. For managing deployment config like verifying, source of deployment config, etc.""", + ) + sample_request: Optional[str] = Field( + default=None, description="""Optional. Sample request for deployed endpoint.""" + ) -class ListSkillsResponse(_common.BaseModel): - """Response for listing skills.""" +class PublisherModelCallToActionDeployDeployMetadataDict(TypedDict, total=False): + """Metadata information about the deployment for managing deployment config.""" - sdk_http_response: Optional[genai_types.HttpResponse] = Field( - default=None, description="""Used to retain the full HTTP response.""" - ) - next_page_token: Optional[str] = Field(default=None, description="""""") - skills: Optional[list[Skill]] = Field( - default=None, description="""List of Skills.""" - ) + labels: Optional[dict[str, str]] + """Optional. Labels for the deployment config. For managing deployment config like verifying, source of deployment config, etc.""" + sample_request: Optional[str] + """Optional. Sample request for deployed endpoint.""" -class ListSkillsResponseDict(TypedDict, total=False): - """Response for listing skills.""" - sdk_http_response: Optional[genai_types.HttpResponseDict] - """Used to retain the full HTTP response.""" +PublisherModelCallToActionDeployDeployMetadataOrDict = Union[ + PublisherModelCallToActionDeployDeployMetadata, + PublisherModelCallToActionDeployDeployMetadataDict, +] - next_page_token: Optional[str] - """""" - skills: Optional[list[SkillDict]] - """List of Skills.""" +class LargeModelReference(_common.BaseModel): + """Contains information about the Large Model.""" + name: Optional[str] = Field( + default=None, + description="""Required. The unique name of the large Foundation or pre-built model. Like "chat-bison", "text-bison". Or model name with version ID, like "chat-bison@001", "text-bison@005", etc.""", + ) -ListSkillsResponseOrDict = Union[ListSkillsResponse, ListSkillsResponseDict] +class LargeModelReferenceDict(TypedDict, total=False): + """Contains information about the Large Model.""" -class DeleteSkillConfig(_common.BaseModel): - """Config for deleting a skill.""" + name: Optional[str] + """Required. The unique name of the large Foundation or pre-built model. Like "chat-bison", "text-bison". Or model name with version ID, like "chat-bison@001", "text-bison@005", etc.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + +LargeModelReferenceOrDict = Union[LargeModelReference, LargeModelReferenceDict] + + +class PublisherModelCallToActionDeploy(_common.BaseModel): + """Model metadata that is needed for UploadModel or DeployModel/CreateEndpoint requests.""" + + artifact_uri: Optional[str] = Field( + default=None, + description="""Optional. The path to the directory containing the Model artifact and any of its supporting files.""", + ) + automatic_resources: Optional[AutomaticResources] = Field( + default=None, + description="""A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration.""", + ) + container_spec: Optional[ModelContainerSpec] = Field( + default=None, + description="""Optional. The specification of the container that is to be used when deploying this Model in Vertex AI. Not present for Large Models.""", + ) + dedicated_resources: Optional[DedicatedResources] = Field( + default=None, + description="""A description of resources that are dedicated to the DeployedModel, and that need a higher degree of manual configuration.""", + ) + deploy_metadata: Optional[PublisherModelCallToActionDeployDeployMetadata] = Field( + default=None, + description="""Optional. Metadata information about this deployment config.""", + ) + deploy_task_name: Optional[str] = Field( + default=None, + description="""Optional. The name of the deploy task (e.g., "text to image generation").""", + ) + large_model_reference: Optional[LargeModelReference] = Field( + default=None, + description="""Optional. Large model reference. When this is set, model_artifact_spec is not needed.""", + ) + model_display_name: Optional[str] = Field( + default=None, description="""Optional. Default model display name.""" + ) + public_artifact_uri: Optional[str] = Field( + default=None, + description="""Optional. The signed URI for ephemeral Cloud Storage access to model artifact.""", + ) + shared_resources: Optional[str] = Field( + default=None, + description="""The resource name of the shared DeploymentResourcePool to deploy on. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`""", ) - wait_for_completion: Optional[bool] = Field( - default=True, - description="""Whether to wait for the long running operation to complete.""", + title: Optional[str] = Field( + default=None, + description="""Required. The title of the regional resource reference.""", ) -class DeleteSkillConfigDict(TypedDict, total=False): - """Config for deleting a skill.""" +class PublisherModelCallToActionDeployDict(TypedDict, total=False): + """Model metadata that is needed for UploadModel or DeployModel/CreateEndpoint requests.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + artifact_uri: Optional[str] + """Optional. The path to the directory containing the Model artifact and any of its supporting files.""" - wait_for_completion: Optional[bool] - """Whether to wait for the long running operation to complete.""" + automatic_resources: Optional[AutomaticResourcesDict] + """A description of resources that to large degree are decided by Vertex AI, and require only a modest additional configuration.""" + container_spec: Optional[ModelContainerSpecDict] + """Optional. The specification of the container that is to be used when deploying this Model in Vertex AI. Not present for Large Models.""" -DeleteSkillConfigOrDict = Union[DeleteSkillConfig, DeleteSkillConfigDict] + dedicated_resources: Optional[DedicatedResourcesDict] + """A description of resources that are dedicated to the DeployedModel, and that need a higher degree of manual configuration.""" + deploy_metadata: Optional[PublisherModelCallToActionDeployDeployMetadataDict] + """Optional. Metadata information about this deployment config.""" -class _DeleteSkillRequestParameters(_common.BaseModel): - """Parameters for deleting a skill.""" + deploy_task_name: Optional[str] + """Optional. The name of the deploy task (e.g., "text to image generation").""" - name: Optional[str] = Field( - default=None, - description="""Required. The resource name of the Skill to delete.""", - ) - config: Optional[DeleteSkillConfig] = Field(default=None, description="""""") + large_model_reference: Optional[LargeModelReferenceDict] + """Optional. Large model reference. When this is set, model_artifact_spec is not needed.""" + model_display_name: Optional[str] + """Optional. Default model display name.""" -class _DeleteSkillRequestParametersDict(TypedDict, total=False): - """Parameters for deleting a skill.""" + public_artifact_uri: Optional[str] + """Optional. The signed URI for ephemeral Cloud Storage access to model artifact.""" - name: Optional[str] - """Required. The resource name of the Skill to delete.""" + shared_resources: Optional[str] + """The resource name of the shared DeploymentResourcePool to deploy on. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`""" - config: Optional[DeleteSkillConfigDict] - """""" + title: Optional[str] + """Required. The title of the regional resource reference.""" -_DeleteSkillRequestParametersOrDict = Union[ - _DeleteSkillRequestParameters, _DeleteSkillRequestParametersDict +PublisherModelCallToActionDeployOrDict = Union[ + PublisherModelCallToActionDeploy, PublisherModelCallToActionDeployDict ] -class DeleteSkillOperation(_common.BaseModel): - """Operation for deleting a skill.""" +class PublisherModelCallToActionDeployGke(_common.BaseModel): + """Configurations for PublisherModel GKE deployment""" - name: Optional[str] = Field( - default=None, - description="""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}`.""", - ) - metadata: Optional[dict[str, Any]] = Field( - default=None, - description="""Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""", - ) - done: Optional[bool] = Field( - default=None, - description="""If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""", - ) - error: Optional[dict[str, Any]] = Field( + gke_yaml_configs: Optional[list[str]] = Field( default=None, - description="""The error result of the operation in case of failure or cancellation.""", + description="""Optional. GKE deployment configuration in yaml format.""", ) -class DeleteSkillOperationDict(TypedDict, total=False): - """Operation for deleting a skill.""" +class PublisherModelCallToActionDeployGkeDict(TypedDict, total=False): + """Configurations for PublisherModel GKE deployment""" - 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}`.""" + gke_yaml_configs: Optional[list[str]] + """Optional. GKE deployment configuration in yaml format.""" - metadata: Optional[dict[str, Any]] - """Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.""" - done: Optional[bool] - """If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.""" +PublisherModelCallToActionDeployGkeOrDict = Union[ + PublisherModelCallToActionDeployGke, PublisherModelCallToActionDeployGkeDict +] - error: Optional[dict[str, Any]] - """The error result of the operation in case of failure or cancellation.""" +class PublisherModelCallToActionDeployVertex(_common.BaseModel): + """Multiple setups to deploy the PublisherModel.""" -DeleteSkillOperationOrDict = Union[DeleteSkillOperation, DeleteSkillOperationDict] + multi_deploy_vertex: Optional[list[PublisherModelCallToActionDeploy]] = Field( + default=None, description="""Optional. One click deployment configurations.""" + ) -class GetSkillOperationConfig(_common.BaseModel): +class PublisherModelCallToActionDeployVertexDict(TypedDict, total=False): + """Multiple setups to deploy the PublisherModel.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + multi_deploy_vertex: Optional[list[PublisherModelCallToActionDeployDict]] + """Optional. One click deployment configurations.""" + + +PublisherModelCallToActionDeployVertexOrDict = Union[ + PublisherModelCallToActionDeployVertex, PublisherModelCallToActionDeployVertexDict +] + + +class PublisherModelCallToActionOpenFineTuningPipelines(_common.BaseModel): + """Open fine tuning pipelines.""" + + fine_tuning_pipelines: Optional[ + list[PublisherModelCallToActionRegionalResourceReferences] + ] = Field( + default=None, + description="""Required. Regional resource references to fine tuning pipelines.""", ) -class GetSkillOperationConfigDict(TypedDict, total=False): +class PublisherModelCallToActionOpenFineTuningPipelinesDict(TypedDict, total=False): + """Open fine tuning pipelines.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + fine_tuning_pipelines: Optional[ + list[PublisherModelCallToActionRegionalResourceReferencesDict] + ] + """Required. Regional resource references to fine tuning pipelines.""" -GetSkillOperationConfigOrDict = Union[ - GetSkillOperationConfig, GetSkillOperationConfigDict +PublisherModelCallToActionOpenFineTuningPipelinesOrDict = Union[ + PublisherModelCallToActionOpenFineTuningPipelines, + PublisherModelCallToActionOpenFineTuningPipelinesDict, ] -class _GetSkillOperationParameters(_common.BaseModel): - """Parameters for getting an operation.""" +class PublisherModelCallToActionOpenNotebooks(_common.BaseModel): + """Open notebooks.""" - operation_name: Optional[str] = Field( - default=None, description="""The server-assigned name for the operation.""" - ) - config: Optional[GetSkillOperationConfig] = Field( - default=None, description="""Used to override the default configuration.""" + notebooks: Optional[list[PublisherModelCallToActionRegionalResourceReferences]] = ( + Field( + default=None, + description="""Required. Regional resource references to notebooks.""", + ) ) -class _GetSkillOperationParametersDict(TypedDict, total=False): - """Parameters for getting an operation.""" - - operation_name: Optional[str] - """The server-assigned name for the operation.""" +class PublisherModelCallToActionOpenNotebooksDict(TypedDict, total=False): + """Open notebooks.""" - config: Optional[GetSkillOperationConfigDict] - """Used to override the default configuration.""" + notebooks: Optional[list[PublisherModelCallToActionRegionalResourceReferencesDict]] + """Required. Regional resource references to notebooks.""" -_GetSkillOperationParametersOrDict = Union[ - _GetSkillOperationParameters, _GetSkillOperationParametersDict +PublisherModelCallToActionOpenNotebooksOrDict = Union[ + PublisherModelCallToActionOpenNotebooks, PublisherModelCallToActionOpenNotebooksDict ] -class GetSkillRevisionConfig(_common.BaseModel): +class PublisherModelDocumentation(_common.BaseModel): + """A named piece of documentation.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" + content: Optional[str] = Field( + default=None, + description="""Required. Content of this piece of document (in Markdown format).""", + ) + title: Optional[str] = Field( + default=None, + description="""Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA, NODE.JS, etc..""", ) -class GetSkillRevisionConfigDict(TypedDict, total=False): +class PublisherModelDocumentationDict(TypedDict, total=False): + """A named piece of documentation.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + content: Optional[str] + """Required. Content of this piece of document (in Markdown format).""" + title: Optional[str] + """Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA, NODE.JS, etc..""" -GetSkillRevisionConfigOrDict = Union[GetSkillRevisionConfig, GetSkillRevisionConfigDict] + +PublisherModelDocumentationOrDict = Union[ + PublisherModelDocumentation, PublisherModelDocumentationDict +] -class _GetSkillRevisionRequestParameters(_common.BaseModel): +class PublisherModelCallToActionViewRestApi(_common.BaseModel): + """Rest API docs.""" - name: Optional[str] = Field( - default=None, - description="""The resource name of the Skill Revision to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}""", + documentations: Optional[list[PublisherModelDocumentation]] = Field( + default=None, description="""Required.""" + ) + title: Optional[str] = Field( + default=None, description="""Required. The title of the view rest API.""" ) - config: Optional[GetSkillRevisionConfig] = Field(default=None, description="""""") -class _GetSkillRevisionRequestParametersDict(TypedDict, total=False): +class PublisherModelCallToActionViewRestApiDict(TypedDict, total=False): + """Rest API docs.""" - name: Optional[str] - """The resource name of the Skill Revision to retrieve. Format: projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}""" + documentations: Optional[list[PublisherModelDocumentationDict]] + """Required.""" - config: Optional[GetSkillRevisionConfigDict] - """""" + title: Optional[str] + """Required. The title of the view rest API.""" -_GetSkillRevisionRequestParametersOrDict = Union[ - _GetSkillRevisionRequestParameters, _GetSkillRevisionRequestParametersDict +PublisherModelCallToActionViewRestApiOrDict = Union[ + PublisherModelCallToActionViewRestApi, PublisherModelCallToActionViewRestApiDict ] -class SkillRevision(_common.BaseModel): +class PublisherModelCallToAction(_common.BaseModel): + """Actions could take on this Publisher Model.""" - name: Optional[str] = Field( + create_application: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( default=None, - description="""Identifier. The resource name of the Skill Revision. Format: `projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}`""", + description="""Optional. Create application using the PublisherModel.""", ) - create_time: Optional[datetime.datetime] = Field( + deploy: Optional[PublisherModelCallToActionDeploy] = Field( default=None, - description="""Output only. Timestamp when this Skill Revision was created.""", + description="""Optional. Deploy the PublisherModel to Vertex Endpoint.""", ) - skill: Optional[Skill] = Field( + deploy_gke: Optional[PublisherModelCallToActionDeployGke] = Field( default=None, - description="""Output only. The state of the Skill at this revision. TODO(b/503772996) Use a different proto for skill data included in skill revision""", + description="""Optional. Deploy PublisherModel to Google Kubernetes Engine.""", ) - state: Optional[SkillState] = Field( - default=None, description="""Output only. The state of the Skill Revision.""" + multi_deploy_vertex: Optional[PublisherModelCallToActionDeployVertex] = Field( + default=None, + description="""Optional. Multiple setups to deploy the PublisherModel to Vertex Endpoint.""", + ) + open_evaluation_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Open evaluation pipeline of the PublisherModel.""", + ) + open_fine_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Open fine-tuning pipeline of the PublisherModel.""", + ) + open_fine_tuning_pipelines: Optional[ + PublisherModelCallToActionOpenFineTuningPipelines + ] = Field( + default=None, + description="""Optional. Open fine-tuning pipelines of the PublisherModel.""", + ) + open_generation_ai_studio: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field(default=None, description="""Optional. Open in Generation AI Studio.""") + open_genie: Optional[PublisherModelCallToActionRegionalResourceReferences] = Field( + default=None, description="""Optional. Open Genie / Playground.""" + ) + open_notebook: Optional[PublisherModelCallToActionRegionalResourceReferences] = ( + Field( + default=None, + description="""Optional. Open notebook of the PublisherModel.""", + ) + ) + open_notebooks: Optional[PublisherModelCallToActionOpenNotebooks] = Field( + default=None, description="""Optional. Open notebooks of the PublisherModel.""" + ) + open_prompt_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferences + ] = Field( + default=None, + description="""Optional. Open prompt-tuning pipeline of the PublisherModel.""", + ) + request_access: Optional[PublisherModelCallToActionRegionalResourceReferences] = ( + Field(default=None, description="""Optional. Request for access.""") + ) + view_rest_api: Optional[PublisherModelCallToActionViewRestApi] = Field( + default=None, description="""Optional. To view Rest API docs.""" ) -class SkillRevisionDict(TypedDict, total=False): +class PublisherModelCallToActionDict(TypedDict, total=False): + """Actions could take on this Publisher Model.""" - name: Optional[str] - """Identifier. The resource name of the Skill Revision. Format: `projects/{project}/locations/{location}/skills/{skill}/revisions/{revision}`""" + create_application: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Create application using the PublisherModel.""" - create_time: Optional[datetime.datetime] - """Output only. Timestamp when this Skill Revision was created.""" + deploy: Optional[PublisherModelCallToActionDeployDict] + """Optional. Deploy the PublisherModel to Vertex Endpoint.""" - skill: Optional[SkillDict] - """Output only. The state of the Skill at this revision. TODO(b/503772996) Use a different proto for skill data included in skill revision""" + deploy_gke: Optional[PublisherModelCallToActionDeployGkeDict] + """Optional. Deploy PublisherModel to Google Kubernetes Engine.""" - state: Optional[SkillState] - """Output only. The state of the Skill Revision.""" + multi_deploy_vertex: Optional[PublisherModelCallToActionDeployVertexDict] + """Optional. Multiple setups to deploy the PublisherModel to Vertex Endpoint.""" + open_evaluation_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open evaluation pipeline of the PublisherModel.""" -SkillRevisionOrDict = Union[SkillRevision, SkillRevisionDict] + open_fine_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open fine-tuning pipeline of the PublisherModel.""" + open_fine_tuning_pipelines: Optional[ + PublisherModelCallToActionOpenFineTuningPipelinesDict + ] + """Optional. Open fine-tuning pipelines of the PublisherModel.""" -class ListSkillRevisionsConfig(_common.BaseModel): + open_generation_ai_studio: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open in Generation AI Studio.""" - http_options: Optional[genai_types.HttpOptions] = Field( - default=None, description="""Used to override HTTP request options.""" - ) - page_size: Optional[int] = Field(default=None, description="""""") - page_token: Optional[str] = Field(default=None, description="""""") + open_genie: Optional[PublisherModelCallToActionRegionalResourceReferencesDict] + """Optional. Open Genie / Playground.""" + open_notebook: Optional[PublisherModelCallToActionRegionalResourceReferencesDict] + """Optional. Open notebook of the PublisherModel.""" -class ListSkillRevisionsConfigDict(TypedDict, total=False): + open_notebooks: Optional[PublisherModelCallToActionOpenNotebooksDict] + """Optional. Open notebooks of the PublisherModel.""" - http_options: Optional[genai_types.HttpOptionsDict] - """Used to override HTTP request options.""" + open_prompt_tuning_pipeline: Optional[ + PublisherModelCallToActionRegionalResourceReferencesDict + ] + """Optional. Open prompt-tuning pipeline of the PublisherModel.""" - page_size: Optional[int] - """""" + request_access: Optional[PublisherModelCallToActionRegionalResourceReferencesDict] + """Optional. Request for access.""" - page_token: Optional[str] - """""" + view_rest_api: Optional[PublisherModelCallToActionViewRestApiDict] + """Optional. To view Rest API docs.""" -ListSkillRevisionsConfigOrDict = Union[ - ListSkillRevisionsConfig, ListSkillRevisionsConfigDict +PublisherModelCallToActionOrDict = Union[ + PublisherModelCallToAction, PublisherModelCallToActionDict ] -class _ListSkillRevisionsRequestParameters(_common.BaseModel): - """Parameters for ListSkillRevisionsRequest.""" +class PublisherModel(_common.BaseModel): + """Publisher model from Model Garden.""" + frameworks: Optional[list[str]] = Field( + default=None, + description="""Optional. Additional information about the model's Frameworks.""", + ) + launch_stage: Optional[LaunchStage] = Field( + default=None, + description="""Optional. Indicates the launch stage of the model.""", + ) name: Optional[str] = Field( default=None, - description="""Required. The name of the Skill to list revisions for.""", + description="""Output only. Identifier. The resource name of the PublisherModel.""", + ) + open_source_category: Optional[OpenSourceCategory] = Field( + default=None, + description="""Required. Indicates the open source category of the publisher model.""", + ) + parent: Optional[PublisherModelParent] = Field( + default=None, + description="""Optional. The parent that this model was customized from. E.g., Vision API, Natural Language API, LaMDA, T5, etc. Foundation models don't have parents.""", + ) + predict_schemata: Optional[PredictSchemata] = Field( + default=None, + description="""Optional. The schemata that describes formats of the PublisherModel's predictions and explanations as given and returned via PredictionService.Predict.""", + ) + publisher_model_template: Optional[str] = Field( + default=None, + description="""Optional. Output only. Immutable. Used to indicate this model has a publisher model and provide the template of the publisher model resource name.""", + ) + supported_actions: Optional[PublisherModelCallToAction] = Field( + default=None, description="""Optional. Supported call-to-action options.""" + ) + version_id: Optional[str] = Field( + default=None, + description="""Output only. Immutable. The version ID of the PublisherModel. A new version is committed when a new model version is uploaded under an existing model id. It is an auto-incrementing decimal number in string representation.""", + ) + version_state: Optional[VersionState] = Field( + default=None, + description="""Optional. Indicates the state of the model version.""", ) - config: Optional[ListSkillRevisionsConfig] = Field(default=None, description="""""") -class _ListSkillRevisionsRequestParametersDict(TypedDict, total=False): - """Parameters for ListSkillRevisionsRequest.""" +class PublisherModelDict(TypedDict, total=False): + """Publisher model from Model Garden.""" + + frameworks: Optional[list[str]] + """Optional. Additional information about the model's Frameworks.""" + + launch_stage: Optional[LaunchStage] + """Optional. Indicates the launch stage of the model.""" name: Optional[str] - """Required. The name of the Skill to list revisions for.""" + """Output only. Identifier. The resource name of the PublisherModel.""" - config: Optional[ListSkillRevisionsConfigDict] - """""" + open_source_category: Optional[OpenSourceCategory] + """Required. Indicates the open source category of the publisher model.""" + parent: Optional[PublisherModelParentDict] + """Optional. The parent that this model was customized from. E.g., Vision API, Natural Language API, LaMDA, T5, etc. Foundation models don't have parents.""" -_ListSkillRevisionsRequestParametersOrDict = Union[ - _ListSkillRevisionsRequestParameters, _ListSkillRevisionsRequestParametersDict -] + predict_schemata: Optional[PredictSchemataDict] + """Optional. The schemata that describes formats of the PublisherModel's predictions and explanations as given and returned via PredictionService.Predict.""" + publisher_model_template: Optional[str] + """Optional. Output only. Immutable. Used to indicate this model has a publisher model and provide the template of the publisher model resource name.""" -class ListSkillRevisionsResponse(_common.BaseModel): + supported_actions: Optional[PublisherModelCallToActionDict] + """Optional. Supported call-to-action options.""" + + version_id: Optional[str] + """Output only. Immutable. The version ID of the PublisherModel. A new version is committed when a new model version is uploaded under an existing model id. It is an auto-incrementing decimal number in string representation.""" + + version_state: Optional[VersionState] + """Optional. Indicates the state of the model version.""" + + +PublisherModelOrDict = Union[PublisherModel, PublisherModelDict] + + +class ListPublisherModelsResponse(_common.BaseModel): + """Response for listing publisher models.""" sdk_http_response: Optional[genai_types.HttpResponse] = Field( default=None, description="""Used to retain the full HTTP response.""" ) - next_page_token: Optional[str] = Field(default=None, description="""""") - skill_revisions: Optional[list[SkillRevision]] = Field( - default=None, description="""List of Skill Revisions.""" + next_page_token: Optional[str] = Field( + default=None, + description="""A token to retrieve next page of results. Pass to ListPublisherModels.page_token to obtain that page.""", + ) + publisher_models: Optional[list[PublisherModel]] = Field( + default=None, description="""List of PublisherModels in the requested page.""" ) -class ListSkillRevisionsResponseDict(TypedDict, total=False): +class ListPublisherModelsResponseDict(TypedDict, total=False): + """Response for listing publisher models.""" sdk_http_response: Optional[genai_types.HttpResponseDict] """Used to retain the full HTTP response.""" next_page_token: Optional[str] - """""" + """A token to retrieve next page of results. Pass to ListPublisherModels.page_token to obtain that page.""" - skill_revisions: Optional[list[SkillRevisionDict]] - """List of Skill Revisions.""" + publisher_models: Optional[list[PublisherModelDict]] + """List of PublisherModels in the requested page.""" -ListSkillRevisionsResponseOrDict = Union[ - ListSkillRevisionsResponse, ListSkillRevisionsResponseDict +ListPublisherModelsResponseOrDict = Union[ + ListPublisherModelsResponse, ListPublisherModelsResponseDict ] @@ -20775,3 +24962,55 @@ class AgentEngineRuntimeRevisionDict(TypedDict, total=False): AgentEngineRuntimeRevisionOrDict = Union[ AgentEngineRuntimeRevision, AgentEngineRuntimeRevisionDict ] + + +class ListDeployableModelsConfig(_common.BaseModel): + """Config for listing deployable models.""" + + include_hugging_face_models: Optional[bool] = Field( + default=None, description="""Whether to list Hugging Face models.""" + ) + model_filter: Optional[str] = Field( + default=None, description="""Optional. A string to filter the models by.""" + ) + + +class ListDeployableModelsConfigDict(TypedDict, total=False): + """Config for listing deployable models.""" + + include_hugging_face_models: Optional[bool] + """Whether to list Hugging Face models.""" + + model_filter: Optional[str] + """Optional. A string to filter the models by.""" + + +ListDeployableModelsConfigOrDict = Union[ + ListDeployableModelsConfig, ListDeployableModelsConfigDict +] + + +class ListModelGardenModelsConfig(_common.BaseModel): + """Config for listing Model Garden models.""" + + include_hugging_face_models: Optional[bool] = Field( + default=None, description="""Whether to list Hugging Face models.""" + ) + model_filter: Optional[str] = Field( + default=None, description="""Optional. A string to filter the models by.""" + ) + + +class ListModelGardenModelsConfigDict(TypedDict, total=False): + """Config for listing Model Garden models.""" + + include_hugging_face_models: Optional[bool] + """Whether to list Hugging Face models.""" + + model_filter: Optional[str] + """Optional. A string to filter the models by.""" + + +ListModelGardenModelsConfigOrDict = Union[ + ListModelGardenModelsConfig, ListModelGardenModelsConfigDict +]