10000 feat: add PSCAutomationConfig to PrivateServiceConnectConfig in service_networking.proto by gcf-owl-bot[bot] · Pull Request #5445 · googleapis/python-aiplatform · GitHub
[go: up one dir, main page]

Skip to content

feat: add PSCAutomationConfig to PrivateServiceConnectConfig in service_networking.proto #5445

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/aiplatform_v1beta1/memory_bank_service.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MemoryBankService
-----------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.memory_bank_service
:members:
:inherited-members:

.. automodule:: google.cloud.aiplatform_v1beta1.services.memory_bank_service.pagers
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/aiplatform_v1beta1/services_.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Services for Google Cloud Aiplatform v1beta1 API
job_service
llm_utility_service
match_service
memory_bank_service
metadata_service
migration_service
model_garden_service
Expand Down
10 changes: 10 additions & 0 deletions google/cloud/aiplatform_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
from .types.endpoint import DeployedModel
from .types.endpoint import Endpoint
from .types.endpoint import FasterDeploymentConfig
from .types.endpoint import GenAiAdvancedFeaturesConfig
from .types.endpoint import PredictRequestResponseLoggingConfig
from .types.endpoint import PrivateEndpoints
from .types.endpoint import SpeculativeDecodingSpec
Expand Down Expand Up @@ -680,6 +681,9 @@
)
from .types.model_evaluation import ModelEvaluation
from .types.model_evaluation_slice import ModelEvaluationSlice
from .types.model_garden_service import DeployOperationMetadata
from .types.model_garden_service import DeployRequest
from .types.model_garden_service import DeployResponse
from .types.model_garden_service import GetPublisherModelRequest
from .types.model_garden_service import PublisherModelView
from .types.model_monitoring import ModelMonitoringAlertConfig
Expand Down Expand Up @@ -863,6 +867,7 @@
from .types.service_networking import PscAutomatedEndpoints
from .types.service_networking import PSCAutomationConfig
from .types.service_networking import PscInterfaceConfig
from .types.service_networking import PSCAutomationState
from .types.specialist_pool import SpecialistPool
from .types.specialist_pool_service import CreateSpecialistPoolOperationMetadata
from .types.specialist_pool_service import CreateSpecialistPoolRequest
Expand Down Expand Up @@ -1302,6 +1307,9 @@
"DeployModelOperationMetadata",
"DeployModelRequest",
"DeployModelResponse",
"DeployOperationMetadata",
"DeployRequest",
"DeployResponse",
"DeployedIndex",
"DeployedIndexAuthConfig",
"DeployedIndexRef",
Expand Down Expand Up @@ -1409,6 +1417,7 @@
"FunctionResponse",
"GcsDestination",
"GcsSource",
"GenAiAdvancedFeaturesConfig",
"GenAiCacheServiceClient",
"GenAiTuningServiceClient",
"GenerateContentRequest",
Expand Down Expand D7AE Up @@ -1678,6 +1687,7 @@
"NotebookServiceClient",
"NotebookSoftwareConfig",
"PSCAutomationConfig",
"PSCAutomationState",
"PairwiseChoice",
"PairwiseMetricInput",
"PairwiseMetricInstance",
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/aiplatform_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3097,6 +3097,11 @@
"grpc": {
"libraryClient": "ModelGardenServiceClient",
"rpcs": {
"Deploy": {
"methods": [
"deploy"
]
},
"GetPublisherModel": {
"methods": [
"get_publisher_model"
Expand All @@ -3107,6 +3112,11 @@
"grpc-async": {
"libraryClient": "ModelGardenServiceAsyncClient",
"rpcs": {
"Deploy": {
"methods": [
"deploy"
]
},
"GetPublisherModel": {
"methods": [
"get_publisher_model"
Expand All @@ -3117,6 +3127,11 @@
"rest": {
"libraryClient": "ModelGardenServiceClient",
"rpcs": {
"Deploy": {
"methods": [
"deploy"
]
},
"GetPublisherModel": {
"methods": [
"get_publisher_model"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,6 @@ async def sample_deploy_model():
# Initialize request argument(s)
deployed_model = aiplatform_v1.DeployedModel()
deployed_model.dedicated_resources.min_replica_count = 1803
deployed_model.model = "model_value"

request = aiplatform_v1.DeployModelRe F438 quest(
endpoint="endpoint_value",
Expand Down Expand Up @@ -1482,7 +1481,6 @@ async def sample_mutate_deployed_model():
# Initialize request argument(s)
deployed_model = aiplatform_v1.DeployedModel()
deployed_model.dedicated_resources.min_replica_count = 1803
deployed_model.model = "model_value"

request = aiplatform_v1.MutateDeployedModelRequest(
endpoint="endpoint_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,6 @@ def sample_deploy_model():
# Initialize request argument(s)
deployed_model = aiplatform_v1.DeployedModel()
deployed_model.dedicated_resources.min_replica_count = 1803
deployed_model.model = "model_value"

request = aiplatform_v1.DeployModelRequest(
endpoint="endpoint_value",
Expand Down Expand Up @@ -2008,7 +2007,6 @@ def sample_mutate_deployed_model():
# Initialize request argument(s)
deployed_model = aiplatform_v1.DeployedModel()
deployed_model.dedicated_resources.min_replica_count = 1803
deployed_model.model = "model_value"

request = aiplatform_v1.MutateDeployedModelRequest(
endpoint="endpoint_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.aiplatform_v1.types import model
from google.cloud.aiplatform_v1.types import model_garden_service
from google.cloud.aiplatform_v1.types import publisher_model
Expand Down Expand Up @@ -78,6 +80,10 @@ class ModelGardenServiceAsyncClient:
_DEFAULT_ENDPOINT_TEMPLATE = ModelGardenServiceClient._DEFAULT_ENDPOINT_TEMPLATE
_DEFAULT_UNIVERSE = ModelGardenServiceClient._DEFAULT_UNIVERSE

endpoint_path = staticmethod(ModelGardenServiceClient.endpoint_path)
parse_endpoint_path = staticmethod(ModelGardenServiceClient.parse_endpoint_path)
model_path = staticmethod(ModelGardenServiceClient.model_path)
parse_model_path = staticmethod(ModelGardenServiceClient.parse_model_path)
publisher_model_path = staticmethod(ModelGardenServiceClient.publisher_model_path)
parse_publisher_model_path = staticmethod(
ModelGardenServiceClient.parse_publisher_model_path
Expand Down Expand Up @@ -414,6 +420,107 @@ async def sample_get_publisher_model():
# Done; return the response.
return response

async def deploy(
self,
request: Optional[Union[model_garden_service.DeployRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> operation_async.AsyncOperation:
r"""Deploys a model to a new endpoint.

.. code-block:: 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_deploy():
# Create a client
client = aiplatform_v1.ModelGardenServiceAsyncClient()

# Initialize request argument(s)
request = aiplatform_v1.DeployRequest(
publisher_model_name="publisher_model_name_value",
destination="destination_value",
)

# Make the request
operation = client.deploy(request=request)

print("Waiting for operation to complete...")

response = (await operation).result()

# Handle the response
print(response)

Args:
request (Optional[Union[google.cloud.aiplatform_v1.types.DeployRequest, dict]]):
The request object. Request message for
[ModelGardenService.Deploy][google.cloud.aiplatform.v1.ModelGardenService.Deploy].
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): 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`.

Returns:
google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.

The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.DeployResponse` Response message for
[ModelGardenService.Deploy][google.cloud.aiplatform.v1.ModelGardenService.Deploy].

"""
# Create or coerce a protobuf request object.
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, model_garden_service.DeployRequest):
request = model_garden_service.DeployRequest(request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[self._client._transport.deploy]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("destination", request.destination),)
),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
response,
self._client._transport.operations_client,
model_garden_service.DeployResponse,
metadata_type=model_garden_service.DeployOperationMetadata,
)

# Done; return the response.
return response

async def list_operations(
self,
request: Optional[operations_pb2.ListOperationsRequest] = None,
Expand Down
Loading
0