### Install Vertex AI SDK (Windows) Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Installs the virtualenv tool and the google-cloud-aiplatform library in a Python virtual environment on Windows systems. ```bash pip install virtualenv virtualenv \Scripts\activate \Scripts\pip.exe install google-cloud-aiplatform ``` -------------------------------- ### Install Vertex AI SDK (Mac/Linux) Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Installs the virtualenv tool and the google-cloud-aiplatform library in a Python virtual environment on Mac/Linux systems. ```bash pip install virtualenv virtualenv source /bin/activate /bin/pip install google-cloud-aiplatform ``` -------------------------------- ### Update a Memory using MemoryBankServiceClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Demonstrates how to update a Memory resource using the MemoryBankServiceClient. This example shows the basic structure for making the request and handling the long-running operation. Ensure correct values for request initialization and consider regional endpoints for client creation. ```python from google.cloud import aiplatform_v1beta1 def sample_update_memory(): # Create a client client = aiplatform_v1beta1.MemoryBankServiceClient() # Initialize request argument(s) memory = aiplatform_v1beta1.Memory() memory.fact = "fact_value" request = aiplatform_v1beta1.UpdateMemoryRequest( memory=memory, ) # Make the request operation = client.update_memory(request=request) print("Waiting for operation to complete...") response = operation.result() # Handle the response print(response) ``` -------------------------------- ### Generate Synthetic Data with DataFoundryServiceAsyncClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Use this snippet to generate synthetic data based on a provided task description and output specifications. Ensure the client is initialized with correct regional endpoints if necessary. The example requires modifications for actual use, including valid request parameter values. ```python # This snippet has been automatically generated and should be regarded as a # code template only. # It will require modifications to work: # - It may require correct/in-range values for request initialization. # - It may require specifying regional endpoints when creating the service #   client as shown in: #   https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import aiplatform_v1 async def sample_generate_synthetic_data():     # Create a client     client = aiplatform_v1.DataFoundryServiceAsyncClient()     # Initialize request argument(s)     task_description = aiplatform_v1.TaskDescriptionStrategy()     task_description.task_description = "task_description_value"     output_field_specs = aiplatform_v1.OutputFieldSpec()     output_field_specs.field_name = "field_name_value"     request = aiplatform_v1.GenerateSyntheticDataRequest(         task_description=task_description,         location="location_value",         count=553,         output_field_specs=output_field_specs,     )     # Make the request     response = await client.generate_synthetic_data(request=request)     # Handle the response     print(response) ``` -------------------------------- ### Get Predictions from Endpoint Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Send instances to an endpoint to get predictions. The instances should be in a format compatible with the deployed model. ```python endpoint.predict(instances=[[6.7, 3.1, 4.7, 1.5], [4.6, 3.1, 1.5, 0.2]]) ``` -------------------------------- ### Initialize Client from Service Account Info Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Creates an instance of MemoryBankServiceClient using provided service account credentials in dictionary format. Pass the dictionary containing the credentials. ```python from_service_account_info(info: dict, *args, **kwargs) ``` -------------------------------- ### SystemLabelsEntry Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.DeployRequest.DeployConfig.SystemLabelsEntry Demonstrates how to initialize a SystemLabelsEntry object with various parameters. ```APIDOC ## SystemLabelsEntry ### Description The abstract base class for a message. It can be initialized with keyword arguments, a mapping, or both. An option to ignore unknown fields is also available. ### Parameters - **kwargs** (dict) - Keys and values corresponding to the fields of the message. - **mapping** (Union[dict, `.Message`]) - A dictionary or message to be used to determine the values for this message. - **ignore_unknown_fields** (Optional[bool]) - If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ### Example ```python # Example using keyword arguments system_labels_entry = SystemLabelsEntry(key1='value1', key2='value2') # Example using a mapping mapping_data = {'key3': 'value3'} system_labels_entry_from_mapping = SystemLabelsEntry(mapping=mapping_data) # Example ignoring unknown fields system_labels_entry_ignore = SystemLabelsEntry(unknown_field='some_value', ignore_unknown_fields=True) ``` ``` -------------------------------- ### Initialize Client from Service Account File Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Creates an instance of MemoryBankServiceClient using credentials from a service account JSON file. Specify the path to the credentials file. ```python from_service_account_file(filename: str, *args, **kwargs) ``` -------------------------------- ### Initializing the SDK Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Initialize the Vertex AI SDK with your project details, region, and other configurations. ```APIDOC aiplatform.init( project='my-project', location='us-central1', staging_bucket='gs://my_staging_bucket', credentials=my_credentials, encryption_spec_key_name=my_encryption_key_name, experiment='my-experiment', experiment_description='my experiment description' ) ``` -------------------------------- ### get_location Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Gets information about a location. ```APIDOC ## get_location ### Description Gets information about a location. ### Method get_location ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Location** (google.cloud.location.locations_pb2.Location) - Location object. #### Response Example None ``` -------------------------------- ### Get Operation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Retrieves the latest state of a long-running operation. ```APIDOC ## GET OPERATION ### Description Gets the latest state of a long-running operation. ### Method GET ### Endpoint `/operations/{operation_id}` ### Parameters #### Path Parameters - **operation_id** (string) - Required - The ID of the operation to retrieve. #### Query Parameters - **retry** (google.api_core.retry.Retry) - Optional - Designation of what errors, if any, should be retried. - **timeout** (float) - Optional - The timeout for this request. - **metadata** (Sequence[Tuple[str, Union[str, bytes]]]) - Optional - Key/value pairs which should be sent along with the request as metadata. ### Response #### Success Response (200) - **Operation** (google.longrunning.operations_pb2.Operation) - An Operation object. #### Response Example { "done": false, "name": "operations/12345", "response": {} } ``` -------------------------------- ### Initialize KNN Configuration Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.RagVectorDbConfig.RagManagedDb.KNN Instantiate the KNN configuration object. This is used to set up parameters for KNN search. ```python KNN(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Get Model Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves a model resource using its resource name. ```APIDOC ## Get Model ### Description Retrieves a model resource by its resource name. ### Method `aiplatform.Model` ### Parameters - **model_name** (string) - Required - The resource name of the model (e.g., 'projects/my-project/locations/us-central1/models/{MODEL_ID}'). ### Request Example ```python model = aiplatform.Model('projects/my-project/locations/us-central1/models/{MODEL_ID}') ``` ``` -------------------------------- ### Get Predictions from Endpoint Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves predictions from a deployed model on an endpoint using a list of instances. ```APIDOC ## Get Predictions from Endpoint To get predictions from endpoints: ```python endpoint.predict(instances=[[6.7, 3.1, 4.7, 1.5], [4.6, 3.1, 1.5, 0.2]]) ``` ``` -------------------------------- ### Initialize ResourceLimitsEntry Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.ReasoningEngineSpec.DeploymentSpec.ResourceLimitsEntry Instantiate ResourceLimitsEntry with optional mapping and ignore_unknown_fields parameters. Use mapping for initial values or keyword arguments for direct field assignment. ```python ResourceLimitsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Get Operation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Retrieves the latest status of a long-running operation. Use this method to check the progress or result of an asynchronous task. ```python get_operation( request: typing.Optional[ google.longrunning.operations_pb2.GetOperationRequest ] = None, *, retry: typing.Optional[ typing.Union[ google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault, ] ] = _MethodDefault._DEFAULT_VALUE, timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = () ) -> google.longrunning.operations_pb2.Operation ``` -------------------------------- ### Get Memory Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Retrieves a specific memory resource using its name. This method allows you to fetch details about a stored memory. ```APIDOC ## get_memory ### Description Get a Memory. ### Method `get_memory` ### Parameters #### Request Body - **request** (Union[google.cloud.aiplatform_v1beta1.types.GetMemoryRequest, dict]) - Optional. The request object. Request message for MemoryBankService.GetMemory. - **name** (str) - Optional. Required. The resource name of the Memory. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}`. This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. - **retry** (google.api_core.retry.Retry) - Optional. Designation of what errors, if any, should be retried. - **timeout** (float) - Optional. The timeout for this request. - **metadata** (Sequence[Tuple[str, Union[str, bytes]]]) - Optional. Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. ### Response #### Success Response (200) - **Memory** (google.cloud.aiplatform_v1beta1.types.Memory) - A memory. ### Request Example ```python # This snippet has been automatically generated and should be regarded as a # code template only. # It will require modifications to work: # - It may require correct/in-range values for request initialization. # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import aiplatform_v1beta1 def sample_get_memory(): # Create a client client = aiplatform_v1beta1.MemoryBankServiceClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetMemoryRequest( name="name_value", ) # Make the request response = client.get_memory(request=request) # Handle the response print(response) ``` ``` -------------------------------- ### Instantiate ReviewSnippet Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.GroundingChunk.Maps.PlaceAnswerSources.ReviewSnippet Demonstrates how to instantiate the ReviewSnippet class. Use this to create a new ReviewSnippet object, optionally providing a mapping and specifying whether to ignore unknown fields. ```python ReviewSnippet(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### get_iam_policy Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set. ```APIDOC ## get_iam_policy ### Description Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set. ### Method get_iam_policy ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Policy** (google.iam.v1.policy_pb2.Policy) - Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions (defined by IAM or configured by users). A `binding` can optionally specify a `condition`, which is a logic expression that further constrains the role binding based on attributes about the request and/or target resource. #### Response Example ```json { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01t00:00:00.000z')" } } ] } ``` ``` -------------------------------- ### List Memories using MemoryBankServiceClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Demonstrates how to list memories using the MemoryBankServiceClient. Ensure the client is initialized and a valid parent resource name is provided. ```python from google.cloud import aiplatform_v1beta1 def sample_list_memories(): # Create a client client = aiplatform_v1beta1.MemoryBankServiceClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListMemoriesRequest( parent="parent_value", ) # Make the request page_result = client.list_memories(request=request) # Handle the response for response in page_result: print(response) ``` -------------------------------- ### Initialize Client from Service Account JSON File (Alias) Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Creates an instance of MemoryBankServiceClient using credentials from a service account JSON file. This is an alternative method for initializing the client with file-based credentials. ```python from_service_account_json(filename: str, *args, **kwargs) ``` -------------------------------- ### Get Explainable AI Metadata (TensorFlow 2) Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves explainable AI metadata from TensorFlow 2 models in dictionary format. ```APIDOC ## Explainable AI: Get Metadata (TensorFlow 2) To get metadata in dictionary format from TensorFlow 2 models: ```python from google.cloud.aiplatform.explain.metadata.tf.v2 import saved_model_metadata_builder builder = saved_model_metadata_builder.SavedModelMetadataBuilder('gs://python/to/my/model/dir') generated_md = builder.get_metadata() ``` ``` -------------------------------- ### Create a Memory using MemoryBankServiceClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Demonstrates how to create a Memory resource using the MemoryBankServiceClient. Ensure correct values for request initialization and consider specifying regional endpoints. ```python from google.cloud import aiplatform_v1beta1 def sample_create_memory(): # Create a client client = aiplatform_v1beta1.MemoryBankServiceClient() # Initialize request argument(s) memory = aiplatform_v1beta1.Memory() memory.fact = "fact_value" request = aiplatform_v1beta1.CreateMemoryRequest( parent="parent_value", memory=memory, ) # Make the request operation = client.create_memory(request=request) print("Waiting for operation to complete...") response = operation.result() # Handle the response print(response) ``` -------------------------------- ### Get Explainable AI Metadata (TensorFlow 1) Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves explainable AI metadata from TensorFlow 1 models in dictionary format. ```APIDOC ## Explainable AI: Get Metadata (TensorFlow 1) To get metadata in dictionary format from TensorFlow 1 models: ```python from google.cloud.aiplatform.explain.metadata.tf.v1 import saved_model_metadata_builder builder = saved_model_metadata_builder.SavedModelMetadataBuilder( 'gs://python/to/my/model/dir', tags=[tf.saved_model.tag_constants.SERVING] ) generated_md = builder.get_metadata() ``` ``` -------------------------------- ### Deploy Model with Explanation Metadata Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Deploy a model to an endpoint, including explanation metadata. This allows for generating explanations for predictions. ```python explanation_metadata = builder.get_metadata_protobuf() # To deploy a model to an endpoint with explanation model.deploy(..., explanation_metadata=explanation_metadata) # To deploy a model to a created endpoint with explanation endpoint.deploy(..., explanation_metadata=explanation_metadata) ``` -------------------------------- ### Get TensorFlow 2 SavedModel Metadata Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Build metadata for TensorFlow 2 SavedModel in dictionary format. Specify the GCS path. ```python from google.cloud.aiplatform.explain.metadata.tf.v2 import saved_model_metadata_builder builder = saved_model_metadata_builder.SavedModelMetadataBuilder('gs://python/to/my/model/dir') generated_md = builder.get_metadata() ``` -------------------------------- ### DataFoundryServiceAsyncClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Initializes the DataFoundryServiceAsyncClient. ```APIDOC ## DataFoundryServiceAsyncClient ### Description Initializes the DataFoundryServiceAsyncClient. This client is used for organizing, saving, and categorizing content based on user preferences, and for generating and preparing datasets for Gen AI evaluation. ### Parameters * **credentials** (google.auth.credentials.Credentials, optional): The `Credentials` to use for this client. If not specified, the client will attempt to determine credentials automatically. * **transport** (typing.Union[str, google.cloud.aiplatform_v1.services.data_foundry_service.transports.base.DataFoundryServiceTransport, typing.Callable[..., google.cloud.aiplatform_v1.services.data_foundry_service.transports.base.DataFoundryServiceTransport]], optional): The transport to use for the API. Defaults to `grpc_asyncio`. * **client_options** (google.api_core.client_options.ClientOptions, optional): Client options for the client. If not specified, default client options will be used. * **client_info** (google.api_core.gapic_v1.client_info.ClientInfo, optional): Client information for the client. If not specified, default client information will be used. ``` -------------------------------- ### Cancel Operation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Starts asynchronous cancellation on a long-running operation. Success is not guaranteed, and the server may return `google.rpc.Code.UNIMPLEMENTED` if it doesn't support this method. ```python cancel_operation( request: typing.Optional[ google.longrunning.operations_pb2.CancelOperationRequest ] = None, *, retry: typing.Optional[ typing.Union[ google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault, ] ] = _MethodDefault._DEFAULT_VALUE, timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = () ) -> None ``` -------------------------------- ### SystemLabelsEntry Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.DeployRequest.DeployConfig.SystemLabelsEntry Initializes a new instance of the SystemLabelsEntry class. ```APIDOC ## SystemLabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs) ### Description Initializes a new instance of the SystemLabelsEntry class. ### Parameters #### Parameters - **kwargs** (dict) - Required/Optional - Keys and values corresponding to the fields of the message. - **mapping** (Union[dict, `.Message`]) - Required/Optional - A dictionary or message to be used to determine the values for this message. - **ignore_unknown_fields** (Optional[bool]) - Required/Optional - If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ``` -------------------------------- ### Get TensorFlow 1 SavedModel Metadata Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Build metadata for TensorFlow 1 SavedModel in dictionary format. Specify the GCS path and serving tags. ```python from google.cloud.aiplatform.explain.metadata.tf.v1 import saved_model_metadata_builder builder = saved_model_metadata_builder.SavedModelMetadataBuilder( 'gs://python/to/my/model/dir', tags=[tf.saved_model.tag_constants.SERVING] ) generated_md = builder.get_metadata() ``` -------------------------------- ### Get Model Evaluation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves a specific model evaluation resource for a given model. It can return the first evaluation by default or a specific evaluation if an ID is provided. ```APIDOC ## Get Model Evaluation ### Description Retrieves a model evaluation resource. ### Method `model.get_model_evaluation` ### Parameters - **evaluation_id** (string) - Optional - The ID of the specific model evaluation to retrieve. ### Request Example ```python model = aiplatform.Model('projects/my-project/locations/us-central1/models/{MODEL_ID}') # Returns the first evaluation with no arguments evaluation = model.get_model_evaluation() # To get a specific evaluation by ID: # evaluation = model.get_model_evaluation(evaluation_id='{EVALUATION_ID}') eval_metrics = evaluation.metrics ``` ``` -------------------------------- ### Create and Run Vertex AI Pipeline Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Instantiate a PipelineJob and execute it synchronously, monitoring until completion. Configure pipeline parameters, template path, root, and service account. ```python # Instantiate PipelineJob object pl = PipelineJob( display_name="My first pipeline", # Whether or not to enable caching # True = always cache pipeline step result # False = never cache pipeline step result # None = defer to cache option for each pipeline component in the pipeline definition enable_caching=False, # Local or GCS path to a compiled pipeline definition template_path="pipeline.json", # Dictionary containing input parameters for your pipeline parameter_values=parameter_values, # GCS path to act as the pipeline root pipeline_root=pipeline_root, ) # Execute pipeline in Vertex AI and monitor until completion pl.run( # Email address of service account to use for the pipeline run # You must have iam.serviceAccounts.actAs permission on the service account to use it service_account=service_account, # Whether this function call should be synchronous (wait for pipeline run to finish before terminating) # or asynchronous (return immediately) sync=True ) ``` -------------------------------- ### LabelsEntry Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.PredictRequest.LabelsEntry Demonstrates how to initialize a LabelsEntry object with various parameters. ```APIDOC ## LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs) ### Description Initializes a LabelsEntry object. This is an abstract base class for messages used to stay organized with collections and save/categorize content based on preferences. ### Parameters - **kwargs** (dict) - Optional. Keys and values corresponding to the fields of the message. - **mapping** (Union[dict, `.Message`]) - Optional. A dictionary or message to be used to determine the values for this message. - **ignore_unknown_fields** (Optional[bool]) - Optional. If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ``` -------------------------------- ### Get Vertex AI Model Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves a Vertex AI Model resource using its resource name. This allows for subsequent operations like deployment or export. ```python model = aiplatform.Model('/projects/my-project/locations/us-central1/models/{MODEL_ID}') ``` -------------------------------- ### Get Existing Image Dataset Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves a previously created Vertex AI Image Dataset using its resource name. Replace '{DATASET_ID}' with the actual ID of your dataset. ```python dataset = aiplatform.ImageDataset('projects/my-project/location/us-central1/datasets/{DATASET_ID}') ``` -------------------------------- ### Common Project Path Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Returns a fully-qualified project string. ```python common_project_path(project: str) -> str ``` -------------------------------- ### Initialize Vertex AI SDK Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Initializes the Vertex AI SDK with common configurations such as project ID, region, and staging bucket. Ensure your Google Cloud Project ID, Vertex AI region, and a Cloud Storage bucket are correctly specified. ```python aiplatform.init( # your Google Cloud Project ID or number # environment default used is not set project='my-project', # the Vertex AI region you will use # defaults to us-central1 location='us-central1', # Google Cloud Storage bucket in same region as location # used to stage artifacts staging_bucket='gs://my_staging_bucket', # custom google.auth.credentials.Credentials # environment default credentials used if not set credentials=my_credentials, # customer managed encryption key resource name # will be applied to all Vertex AI resources if set encryption_spec_key_name=my_encryption_key_name, # the name of the experiment to use to track # logged metrics and parameters experiment='my-experiment', # description of the experiment above experiment_description='my experiment description' ) ``` -------------------------------- ### cancel_operation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. ```APIDOC ## cancel_operation ### Description Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. ### Method `cancel_operation` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **request** (`google.longrunning.operations_pb2.CancelOperationRequest`, optional) - The request object. Request message for `CancelOperation` method. - **retry** (`google.api_core.retry.retry_unary_async.AsyncRetry` or `google.api_core.gapic_v1.method._MethodDefault`, optional) - Designation of what errors, if any, should be retried. - **timeout** (`float` or `object`, optional) - The timeout for this request. - **metadata** (`Sequence[Tuple[str, Union[str, bytes]]]`, optional) - Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. ``` -------------------------------- ### from_service_account_file Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Creates an instance of this client using the provided credentials file. ```APIDOC ## from_service_account_file ### Description Creates an instance of this client using the provided credentials file. ### Method `from_service_account_file` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **filename** (`str`) - The path to the service account private key json file. - **args** - Additional positional arguments. - **kwargs** - Additional keyword arguments. ### Returns - **Type**: `DataFoundryServiceAsyncClient` - **Description**: The constructed client. ``` -------------------------------- ### Get Model Evaluation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Retrieves a specific model evaluation resource for a given Vertex AI Model. By default, it returns the first evaluation. An evaluation ID can be provided to fetch a specific one. ```python model = aiplatform.Model('projects/my-project/locations/us-central1/models/{MODEL_ID}') # returns the first evaluation with no arguments, you can also pass the evaluation ID evaluation = model.get_model_evaluation() eval_metrics = evaluation.metrics ``` -------------------------------- ### Recommendation Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.RecommendSpecResponse.Recommendation Initializes a Recommendation object. This object represents a recommendation for a deployment option based on custom weights for a model in a specific region. It includes machine and container specifications, as well as the user's accelerator quota status. ```APIDOC ## Recommendation ### Description Represents a recommendation of one deployment option for a given custom weights model in one region. Contains the machine and container spec, and user accelerator quota state. ### Method Signature ```python Recommendation(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` ### Parameters * `mapping` (Optional): A mapping for the recommendation. * `ignore_unknown_fields` (Optional, bool): If true, unknown fields will be ignored during deserialization. * `**kwargs` (Optional): Additional keyword arguments. ``` -------------------------------- ### Get a Memory using MemoryBankServiceClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Retrieves a specific Memory resource by its name. Ensure the client is initialized with appropriate credentials and regional endpoints if necessary. The `name` parameter requires a fully qualified resource name. ```python from google.cloud import aiplatform_v1beta1 def sample_get_memory(): # Create a client client = aiplatform_v1beta1.MemoryBankServiceClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetMemoryRequest( name="name_value", ) # Make the request response = client.get_memory(request=request) # Handle the response print(response) ``` -------------------------------- ### from_service_account_info Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Creates an instance of this client using the provided credentials info. ```APIDOC ## from_service_account_info ### Description Creates an instance of this client using the provided credentials info. ### Method `from_service_account_info` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **info** (`dict`) - The service account private key info. - **args** - Additional positional arguments. - **kwargs** - Additional keyword arguments. ### Returns - **Type**: `DataFoundryServiceAsyncClient` - **Description**: The constructed client. ``` -------------------------------- ### Unprovisioned Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.RagManagedDbConfig.Unprovisioned 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. ```APIDOC ## Unprovisioned ### Description Disables the RAG Engine service and deletes all your data held within this service. This will halt the billing of the service. 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. ### Method Signature ```python Unprovisioned(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` ``` -------------------------------- ### Instantiate DeploymentTier Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.DeployedIndex.DeploymentTier Instantiate a DeploymentTier object by providing its value. This is useful for configuring deployment settings. ```python DeploymentTier(value) ``` -------------------------------- ### SystemLabelsEntry Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.DeployRequest.DeployConfig.SystemLabelsEntry Initializes a new instance of the SystemLabelsEntry class. It accepts keyword arguments for message fields, an optional mapping for initial values, and a flag to ignore unknown fields. ```APIDOC ## Class SystemLabelsEntry ### Description The abstract base class for a message. Stay organized with collections. Save and categorize content based on your preferences. ### Parameters * **kwargs** (`dict`) - Keys and values corresponding to the fields of the message. * **mapping** (`Union[dict, `.Message`]`) A dictionary or message to be used to determine the values for this message. * **ignore_unknown_fields** (`Optional[bool]`) If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ### Methods (No specific methods documented in the provided text) ``` -------------------------------- ### Initialize Recommendation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.RecommendSpecResponse.Recommendation Initializes a Recommendation object. This is typically used internally by the SDK. ```python Recommendation(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### ScopeEntry Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.Memory.ScopeEntry Demonstrates how to initialize a ScopeEntry object. It can be initialized with keyword arguments, a mapping, or a combination of both. The ignore_unknown_fields parameter can be set to True to prevent errors when unknown fields are present. ```APIDOC ```python ScopeEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` ``` -------------------------------- ### ThinkingConfig Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.GenerationConfig.ThinkingConfig Initializes the ThinkingConfig object. Use `ignore_unknown_fields=True` to ignore fields not recognized by the client. ```python ThinkingConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Instantiate SourceFlaggingUri Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.GroundingMetadata.SourceFlaggingUri Instantiates the SourceFlaggingUri class. It accepts optional mapping and keyword arguments, with ignore_unknown_fields defaulting to False. ```python SourceFlaggingUri(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Instantiate VeoTuningSpec Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.VeoTuningSpec Instantiate the VeoTuningSpec class. The `mapping` parameter can be set to None, and `ignore_unknown_fields` can be set to False. Additional keyword arguments can be passed. ```python VeoTuningSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Initialize DocumentCorpus Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.RagCorpus.CorpusTypeConfig.DocumentCorpus Instantiate the DocumentCorpus class to configure document collections. Accepts optional mapping and ignore_unknown_fields parameters. ```python DocumentCorpus(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Instantiate UrlContextMetadata Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.UrlContextMetadata Instantiates the UrlContextMetadata class. Use this to create a new metadata object, optionally providing a mapping and specifying whether to ignore unknown fields. ```python UrlContextMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### LabelsEntry Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.PredictRequest.LabelsEntry This snippet shows how to instantiate the LabelsEntry class with its available parameters. ```APIDOC ## LabelsEntry Constructor ### Description Instantiates a LabelsEntry object. ### Parameters - **kwargs** (dict) - Keys and values corresponding to the fields of the message. - **mapping** (Union[dict, `.Message`]) - A dictionary or message to be used to determine the values for this message. - **ignore_unknown_fields** (Optional[bool]) - If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ### Request Example ```python from google.cloud.aiplatform_v1beta1.types import LabelsEntry # Example with keyword arguments entry = LabelsEntry(key='my_key', value='my_value') # Example with mapping mapping_data = {'key': 'another_key', 'value': 'another_value'} entry_from_mapping = LabelsEntry(mapping=mapping_data) # Example with ignore_unknown_fields entry_ignore_unknown = LabelsEntry(mapping=mapping_data, ignore_unknown_fields=True) ``` ### Response #### Success Response An instance of the LabelsEntry class. ### Response Example ```json { "key": "my_key", "value": "my_value" } ``` ``` -------------------------------- ### Initialize PlaceAnswerSources Class Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.GroundingChunk.Maps Instantiate the PlaceAnswerSources class, used to detail the sources for a place answer within a Maps chunk. It accepts initialization arguments similar to the Maps class. ```python PlaceAnswerSources(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### from_service_account_json Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.data_foundry_service.DataFoundryServiceAsyncClient Creates an instance of this client using the provided credentials file. ```APIDOC ## from_service_account_json ### Description Creates an instance of this client using the provided credentials file. ### Method `from_service_account_json` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **filename** (`str`) - The path to the service account private key json file. - **args** - Additional positional arguments. - **kwargs** - Additional keyword arguments. ### Returns - **Type**: `DataFoundryServiceAsyncClient` - **Description**: The constructed client. ``` -------------------------------- ### ResourceLimitsEntry Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.ReasoningEngineSpec.DeploymentSpec.ResourceLimitsEntry Initializes a new instance of the ResourceLimitsEntry class. It accepts keyword arguments for fields and an optional mapping for initial values. ```APIDOC ## Class ResourceLimitsEntry ### Description The abstract base class for a message. Stay organized with collections. Save and categorize content based on your preferences. ### Parameters * **kwargs** (dict) - Keys and values corresponding to the fields of the message. * **mapping** (Union[dict, `.Message`]) - A dictionary or message to be used to determine the values for this message. * **ignore_unknown_fields** (Optional[bool]) - If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ### Methods (No specific methods are documented in the provided text.) ### Example ```python ResourceLimitsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` ``` -------------------------------- ### Initialize DraftModelSpeculation Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.SpeculativeDecodingSpec.DraftModelSpeculation Instantiate the DraftModelSpeculation class. The `draft_model` attribute is required and specifies the resource name of the draft model. ```python DraftModelSpeculation(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Upload Model with Explanation Metadata Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Use this method to upload a model to Vertex AI, including metadata for explanations. Ensure explanation_metadata is properly defined before calling. ```python aiplatform.Model.upload(..., explanation_metadata=explanation_metadata) ``` -------------------------------- ### LlmParser Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.RagFileParsingConfig.LlmParser Initializes the LlmParser with optional mapping and ignore_unknown_fields settings. ```APIDOC ## Class LlmParser ```python LlmParser(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` Specifies the advanced parsing for RagFiles. ``` -------------------------------- ### Creating and Importing a Text Dataset Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Create a text dataset and import data from Google Cloud Storage with a specified schema. ```APIDOC from google.cloud import aiplatform my_dataset = aiplatform.TextDataset.create( display_name="my-dataset" ) my_dataset.import_data( gcs_source=['gs://path/to/my/dataset.csv'], import_schema_uri=aiplatform.schema.dataset.ioformat.text.multi_label_classification ) ``` -------------------------------- ### Instantiate DataKeyAndFeatureValues Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.FeatureViewDirectWriteRequest.DataKeyAndFeatureValues Instantiate DataKeyAndFeatureValues with optional mapping and ignore_unknown_fields parameters. ```python DataKeyAndFeatureValues(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### ResourceLimitsEntry Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.ReasoningEngineSpec.DeploymentSpec.ResourceLimitsEntry Initializes a ResourceLimitsEntry object. It accepts keyword arguments for message fields, an optional mapping for initial values, and a flag to ignore unknown fields. ```APIDOC ## ResourceLimitsEntry ### Description Initializes a ResourceLimitsEntry object. It accepts keyword arguments for message fields, an optional mapping for initial values, and a flag to ignore unknown fields. ### Parameters #### Keyword Arguments - **kwargs** (dict) - Keys and values corresponding to the fields of the message. - **mapping** (Union[dict, `.Message`]) - A dictionary or message to be used to determine the values for this message. - **ignore_unknown_fields** (Optional[bool]) - If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ``` -------------------------------- ### Creating a Tabular Dataset Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Create a managed tabular dataset in Vertex AI using data from Google Cloud Storage. ```APIDOC my_dataset = aiplatform.TabularDataset.create( display_name="my-dataset", gcs_source=['gs://path/to/my/dataset.csv'] ) ``` -------------------------------- ### Create and Import Text Dataset Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Creates a text dataset and then imports data from a specified GCS source. The import schema URI should match the type of text data being imported. ```python from google.cloud import aiplatform my_dataset = aiplatform.TextDataset.create( display_name="my-dataset") my_dataset.import_data( gcs_source=['gs://path/to/my/dataset.csv'], import_schema_uri=aiplatform.schema.dataset.ioformat.text.multi_label_classification ) ``` -------------------------------- ### ModelConfig Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.DeployRequest.ModelConfig Initializes a ModelConfig object. Use this to set deployment-specific configurations for a model. ```python ModelConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Initialize MemoryBankServiceClient Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Instantiates the memory bank service client. Use credentials for authorization and optionally specify transport, client options, or client info. Client options can override the API endpoint and universe domain. ```python MemoryBankServiceClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.aiplatform_v1beta1.services.memory_bank_service.transports.base.MemoryBankServiceTransport, typing.Callable[ [...], google.cloud.aiplatform_v1beta1.services.memory_bank_service.transports.base.MemoryBankServiceTransport, ], ] ] = None, client_options: typing.Optional[ typing.Union[google.api_core.client_options.ClientOptions, dict] ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### BigQuerySourceConfig Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.ImportIndexRequest.ConnectorConfig Initializes a BigQuerySourceConfig object. Use this to configure data import from a BigQuery table. ```python BigQuerySourceConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### ReviewSnippet Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.GroundingChunk.Maps.PlaceAnswerSources.ReviewSnippet Initializes a new instance of the ReviewSnippet class. It can optionally take a mapping and a flag to ignore unknown fields. ```APIDOC ## ReviewSnippet ### Description Encapsulates a review snippet. ### Method Signature ```python ReviewSnippet(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` ### Parameters * `mapping` (any, optional): An object to map fields from. * `ignore_unknown_fields` (bool, optional): If True, unknown fields will be ignored. Defaults to False. * `**kwargs`: Additional keyword arguments. ``` -------------------------------- ### Deploy Model to Endpoint Source: https://cloud.google.com/python/docs/reference/aiplatform/latest Deploy a model to a created endpoint. Configure replica counts, machine type, and accelerator type/count as needed. ```python model = aiplatform.Model('/projects/my-project/locations/us-central1/models/{MODEL_ID}') endpoint.deploy( model, min_replica_count=1, max_replica_count=5, machine_type='n1-standard-4', accelerator_type='NVIDIA_TESLA_K80', accelerator_count=1 ) ``` -------------------------------- ### MemoryBankServiceClient.from_service_account_file Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Creates an instance of the MemoryBankServiceClient using the provided credentials file. ```APIDOC ### from_service_account_file ```python from_service_account_file(filename: str, *args, **kwargs) ``` Creates an instance of this client using the provided credentials file. **Parameter** --- **Name** | **Description** `filename` | `str` - The path to the service account private key json file. **Returns** --- **Type** | **Description** `MemoryBankServiceClient` | The constructed client. ``` -------------------------------- ### Environment Class Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.Tool.ComputerUse.Environment Initializes an Environment object. Use this to represent the environment, such as a web browser. ```python Environment(value) ``` -------------------------------- ### WriteResponse Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.FeatureViewDirectWriteResponse.WriteResponse Initializes a new instance of the WriteResponse class. ```APIDOC ## WriteResponse ### Description Initializes a new instance of the `WriteResponse` class. This class provides details about the write for each key. ### Method ```python WriteResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` ### Parameters * **mapping** (Optional) - A mapping of keys to their write details. * **ignore_unknown_fields** (Optional, bool) - If true, unknown fields are ignored. * **kwargs** - Additional keyword arguments. ``` -------------------------------- ### ResourceLimitsEntry Constructor Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.ReasoningEngineSpec.DeploymentSpec.ResourceLimitsEntry Initializes a new instance of the ResourceLimitsEntry class. It can be initialized with a mapping or keyword arguments. ```APIDOC ## Class ResourceLimitsEntry ### Description The abstract base class for a message. Stay organized with collections. Save and categorize content based on your preferences. ### Parameters * **kwargs** (dict) - Optional. Keys and values corresponding to the fields of the message. * **mapping** (Union[dict, `.Message`]) - Optional. A dictionary or message to be used to determine the values for this message. * **ignore_unknown_fields** (Optional[bool]) - Optional. If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. ### Methods (No methods are explicitly documented in the provided source.) ### Example ```python # Example usage (assuming ResourceLimitsEntry is subclassed or used in a context where it's defined) # This is a conceptual example as the direct instantiation details are limited in the source. # from google.cloud.aiplatform_v1beta1.types import ResourceLimitsEntry # # # Example with keyword arguments # entry_kwargs = ResourceLimitsEntry(key='value', another_field=123) # # # Example with a mapping # mapping_data = {'key': 'value', 'another_field': 123} # entry_mapping = ResourceLimitsEntry(mapping=mapping_data) # # # Example with ignore_unknown_fields # entry_ignore = ResourceLimitsEntry(mapping=mapping_data, ignore_unknown_fields=True) ``` ``` -------------------------------- ### TuningMode Class Initialization Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.SupervisedTuningSpec.TuningMode Represents supported tuning modes. ```APIDOC ## Methods ### TuningMode ``` TuningMode(value) ``` Supported tuning modes. ``` -------------------------------- ### Instantiate DatapointFieldMapping Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.ImportIndexRequest.ConnectorConfig.DatapointFieldMapping Instantiate the DatapointFieldMapping class. Use this to define how datapoint fields correspond to columns in your data. ```python DatapointFieldMapping(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Instantiate GranularTtlConfig Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.ReasoningEngineContextSpec.MemoryBankConfig.TtlConfig.GranularTtlConfig Instantiate GranularTtlConfig with optional TTL configurations for different memory actions. ```python GranularTtlConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### MemoryBankServiceClient.from_service_account_info Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.services.memory_bank_service.MemoryBankServiceClient Creates an instance of the MemoryBankServiceClient using the provided credentials info. ```APIDOC ### from_service_account_info ```python from_service_account_info(info: dict, *args, **kwargs) ``` Creates an instance of this client using the provided credentials info. **Parameter** --- **Name** | **Description** `info` | `dict` - The service account private key info. **Returns** --- **Type** | **Description** `MemoryBankServiceClient` | The constructed client. ``` -------------------------------- ### Initialize DefsEntry Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1beta1.types.Schema.DefsEntry Instantiate a DefsEntry object. Use keyword arguments for message fields or a mapping for initial values. Set ignore_unknown_fields to True to prevent errors with unrecognized fields. ```python DefsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs) ```