Skip to content

Commit e0bc3d8

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- 29637f2 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add support for developer connect based deployment docs: A comment for message `ReasoningEngineSpec` is changed docs: A comment for field `package_spec` in message `.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec` is changed PiperOrigin-RevId: 833917724 Source-Link: googleapis/googleapis@a17b84a Source-Link: googleapis/googleapis-gen@5840263 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTg0MDI2MzM4YTJiNjFjZGEwOTQ5ODAwNThjZGRmZDliYWE3NGYzNCJ9 feat: Add support for developer connect based deployment docs: A comment for message `ReasoningEngineSpec` is changed docs: A comment for field `package_spec` in message `.google.cloud.aiplatform.v1.ReasoningEngineSpec` is changed PiperOrigin-RevId: 833911903 Source-Link: googleapis/googleapis@8d526e8 Source-Link: googleapis/googleapis-gen@884e94d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODg0ZTk0ZDg5MWJjNmU5ZmUxMWU2NGUyNzkxMDljNWFhZDk4NTNjOCJ9 feat: add `gpu_partition_size` in `machine_spec` v1 api PiperOrigin-RevId: 833901564 Source-Link: googleapis/googleapis@df29a82 Source-Link: googleapis/googleapis-gen@13de57f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTNkZTU3ZmFiMjJlMzE2YzhiY2ExMjk3Nzg1YjU0Nzg4M2UyZjA1NyJ9 feat: add `ReplicatedVoiceConfig` to `VoiceConfig` to enable Gemini TTS voice replication PiperOrigin-RevId: 833560482 Source-Link: googleapis/googleapis@15fa97d Source-Link: googleapis/googleapis-gen@99a3196 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTlhMzE5NjdkM2ExZTlhOWVjN2JlNWU0ODMzMzU0MmMzMjA1ZDViYiJ9 feat: add `ReplicatedVoiceConfig` to `VoiceConfig` to enable Gemini TTS voice replication PiperOrigin-RevId: 833480721 Source-Link: googleapis/googleapis@136201b Source-Link: googleapis/googleapis-gen@3dea11e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2RlYTExZTg4OTQxMGYwZmY3Yzc5ZDc4OGRhZjRlNzAxNmZhMTBjNyJ9 feat: Add order_by to list_events docs: A comment for field `filter` in message `.google.cloud.aiplatform.v1beta1.ListSessionsRequest` is changed PiperOrigin-RevId: 827666468 Source-Link: googleapis/googleapis@faa7932 Source-Link: googleapis/googleapis-gen@cc55096 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2M1NTA5NjAwMjVlM2Y1Nzk0MDdmZWQ5ZmNhMzdlMGEzYWE3NzM1ZiJ9 feat: add new fields `SUCCESSFULLY_DEPLOYED` and `FAILED_TO_DEPLOY` to `DeploymentStage` PiperOrigin-RevId: 827616943 Source-Link: googleapis/googleapis@c8716fe Source-Link: googleapis/googleapis-gen@338df07 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzM4ZGYwNzllZTEzN2I0NDM1YTIxMjkzODUxNzg0Mzg4NGQ4YTM3MyJ9 feat: add new fields `SUCCESSFULLY_DEPLOYED` and `FAILED_TO_DEPLOY` to `DeploymentStage` PiperOrigin-RevId: 827616855 Source-Link: googleapis/googleapis@3c56d78 Source-Link: googleapis/googleapis-gen@814c558 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODE0YzU1ODhiY2RhZjM2YzdiODYwYjhjMThjYTE0MDFkMDhhNWNmMiJ9 docs: Remove comments for a non public feature PiperOrigin-RevId: 826149748 Source-Link: googleapis/googleapis@b6bb607 Source-Link: googleapis/googleapis-gen@958e53c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTU4ZTUzY2NkYzZhODY5MDY1MWNhNzgyN2M2NWQzZjVhN2Q1MDQ0MyJ9 fix!: An existing field `transfer_to_agent` is removed from message `.google.cloud.aiplatform.v1beta1.EventActions` PiperOrigin-RevId: 826141587 Source-Link: googleapis/googleapis@f49d0aa Source-Link: googleapis/googleapis-gen@05c2690 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDVjMjY5MDgwYTkwN2IxNTI3YzkzM2ZmODEyMjJhMzEwYTZhNGYxMyJ9 docs: fix idle_scaledown_period minimum from 3600 to 300 (5 minutes) PiperOrigin-RevId: 825640207 Source-Link: googleapis/googleapis@b4c05ae Source-Link: googleapis/googleapis-gen@d91045b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDkxMDQ1YjJlZjA4Y2M5MmY4ZTRiMmVkZjhiZmYzYjQwMjAyMmUzMSJ9 fix!: updating `bigtable_metadata` field name in `FeatureOnlineStore` fix!: updating `enableDirectBigtableAccess` field name in FeatureOnlineStore` fix!: updating `bigtable_metadata` field name in `FeatureView` PiperOrigin-RevId: 824609499 Source-Link: googleapis/googleapis@a2e6e8d Source-Link: googleapis/googleapis-gen@81c7098 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODFjNzA5ODg4OTczM2UyZDY1N2E3MTgzZDlkNTRmYjAwMGNjMWExMSJ9 feat: Add EmbedContent method v1 PiperOrigin-RevId: 823219007 Source-Link: googleapis/googleapis@0830bd9 Source-Link: googleapis/googleapis-gen@c7c90cd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzdjOTBjZGZjZWI3OGRmNzMwNDI3MmNkYmM4NjQwOGUyZjRhNTYwNyJ9 feat: Add EmbedContent method v1beta1 PiperOrigin-RevId: 822273804 Source-Link: googleapis/googleapis@bb4016f Source-Link: googleapis/googleapis-gen@9e09a79 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWUwOWE3OTM3NzI0ZTUxNzJiMWRkYTI5MTg0ZDgzMzMzNjAyMTk1MSJ9 feat: add FunctionResponsePart and excluded_predefined_functions in ComputerUse PiperOrigin-RevId: 821792067 Source-Link: googleapis/googleapis@c280079 Source-Link: googleapis/googleapis-gen@9f14f0a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWYxNGYwYTYxOTk0ZTUxNGFkZTJhN2ZlNTVhZGIzZWU1MGNhYWMyOCJ9 feat: add FunctionResponsePart and excluded_predefined_functions in ComputerUse PiperOrigin-RevId: 820916199 Source-Link: googleapis/googleapis@c288189 Source-Link: googleapis/googleapis-gen@51fbf7c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTFmYmY3YzZhMWI5OTAyNzEyN2VlNmFlNjc1Mzk3ZmFhYTk1MDYzNyJ9 feat: Continuous Tuning docs: Updated docs for related fields PiperOrigin-RevId: 820872021 Source-Link: googleapis/googleapis@d9bfa3b Source-Link: googleapis/googleapis-gen@4f90fc5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGY5MGZjNWM4NGE3YWFmMDllMGZhZGE0N2E2ZWVkN2M4M2ZjNmFkZiJ9 -- 29eeb2e by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#5933 from googleapis:owl-bot-copy 8fcec06 PiperOrigin-RevId: 834508221
1 parent c8a5f96 commit e0bc3d8

File tree

71 files changed

+6222
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+6222
-327
lines changed

.kokoro/test-samples-impl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env | grep KOKORO
3434

3535
# Install nox
3636
# `virtualenv==20.26.6` is added for Python 3.7 compatibility
37-
python3 -m pip install --upgrade --quiet nox uv virtualenv==20.26.6
37+
python3 -m pip install --upgrade --quiet nox virtualenv==20.26.6
3838

3939
# Use secrets acessor service account to get secrets
4040
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then

google/cloud/aiplatform_v1/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,21 @@
123123
from .types.content import LogprobsResult
124124
from .types.content import ModalityTokenCount
125125
from .types.content import ModelArmorConfig
126+
from .types.content import MultiSpeakerVoiceConfig
126127
from .types.content import Part
128+
from .types.content import PrebuiltVoiceConfig
129+
from .types.content import ReplicatedVoiceConfig
127130
from .types.content import RetrievalMetadata
128131
from .types.content import SafetyRating
129132
from .types.content import SafetySetting
130133
from .types.content import SearchEntryPoint
131134
from .types.content import Segment
135+
from .types.content import SpeakerVoiceConfig
136+
from .types.content import SpeechConfig
132137
from .types.content import UrlContextMetadata
133138
from .types.content import UrlMetadata
134139
from .types.content import VideoMetadata
140+
from .types.content import VoiceConfig
135141
from .types.content import HarmCategory
136142
from .types.content import Modality
137143
from .types.context import Context
@@ -837,6 +843,8 @@
837843
from .types.prediction_service import DirectPredictResponse
838844
from .types.prediction_service import DirectRawPredictRequest
839845
from .types.prediction_service import DirectRawPredictResponse
846+
from .types.prediction_service import EmbedContentRequest
847+
from .types.prediction_service import EmbedContentResponse
840848
from .types.prediction_service import ExplainRequest
841849
from .types.prediction_service import ExplainResponse
842850
from .types.prediction_service import GenerateContentRequest
@@ -963,6 +971,9 @@
963971
from .types.tool import FunctionCallingConfig
964972
from .types.tool import FunctionDeclaration
965973
from .types.tool import FunctionResponse
974+
from .types.tool import FunctionResponseBlob
975+
from .types.tool import FunctionResponseFileData
976+
from .types.tool import FunctionResponsePart
966977
from .types.tool import GoogleMaps
967978
from .types.tool import GoogleSearchRetrieval
968979
from .types.tool import RagRetrievalConfig
@@ -980,6 +991,7 @@
980991
from .types.training_pipeline import StratifiedSplit
981992
from .types.training_pipeline import TimestampSplit
982993
from .types.training_pipeline import TrainingPipeline
994+
from .types.tuning_job import PreTunedModel
983995
from .types.tuning_job import SupervisedHyperParameters
984996
from .types.tuning_job import SupervisedTuningDatasetDistribution
985997
from .types.tuning_job import SupervisedTuningDataStats
@@ -995,6 +1007,7 @@
9951007
from .types.types import StringArray
9961008
from .types.types import Tensor
9971009
from .types.unmanaged_container_model import UnmanagedContainerModel
1010+
from .types.usage_metadata import UsageMetadata
9981011
from .types.user_action_reference import UserActionReference
9991012
from .types.value import Value
10001013
from .types.vertex_rag_data import CorpusStatus
@@ -1348,6 +1361,8 @@
13481361
"DnsPeeringConfig",
13491362
"DoubleArray",
13501363
"DynamicRetrievalConfig",
1364+
"EmbedContentRequest",
1365+
"EmbedContentResponse",
13511366
"EncryptionSpec",
13521367
"Endpoint",
13531368
"EndpointServiceClient",
@@ -1438,6 +1453,9 @@
14381453
"FunctionCallingConfig",
14391454
"FunctionDeclaration",
14401455
"FunctionResponse",
1456+
"FunctionResponseBlob",
1457+
"FunctionResponseFileData",
1458+
"FunctionResponsePart",
14411459
"GcsDestination",
14421460
"GcsSource",
14431461
"GenAiAdvancedFeaturesConfig",
@@ -1689,6 +1707,7 @@
16891707
"ModelServiceClient",
16901708
"ModelSourceInfo",
16911709
"ModelVersionCheckpoint",
1710+
"MultiSpeakerVoiceConfig",
16921711
"MutateDeployedIndexOperationMetadata",
16931712
"MutateDeployedIndexRequest",
16941713
"MutateDeployedIndexResponse",
@@ -1752,6 +1771,8 @@
17521771
"PointwiseMetricSpec",
17531772
"Port",
17541773
"PostStartupScriptConfig",
1774+
"PreTunedModel",
1775+
"PrebuiltVoiceConfig",
17551776
"PredefinedSplit",
17561777
"PredictRequest",
17571778
"PredictRequestResponseLoggingConfig",
@@ -1840,6 +1861,7 @@
18401861
"RemoveContextChildrenResponse",
18411862
"RemoveDatapointsRequest",
18421863
"RemoveDatapointsResponse",
1864+
"ReplicatedVoiceConfig",
18431865
"ReservationAffinity",
18441866
"ResourcePool",
18451867
"ResourceRuntime",
@@ -1893,9 +1915,11 @@
18931915
"ShieldedVmConfig",
18941916
"SlackSource",
18951917
"SmoothGradConfig",
1918+
"SpeakerVoiceConfig",
18961919
"SpecialistPool",
18971920
"SpecialistPoolServiceClient",
18981921
"SpeculativeDecodingSpec",
1922+
"SpeechConfig",
18991923
"StartNotebookRuntimeOperationMetadata",
19001924
"StartNotebookRuntimeRequest",
19011925
"StartNotebookRuntimeResponse",
@@ -2061,6 +2085,7 @@
20612085
"UrlContext",
20622086
"UrlContextMetadata",
20632087
"UrlMetadata",
2088+
"UsageMetadata",
20642089
"UserActionReference",
20652090
"Value",
20662091
"VertexAISearch",
@@ -2070,6 +2095,7 @@
20702095
"VertexRagStore",
20712096
"VideoMetadata",
20722097
"VizierServiceClient",
2098+
"VoiceConfig",
20732099
"WorkerPoolSpec",
20742100
"WriteFeatureValuesPayload",
20752101
"WriteFeatureValuesRequest",

google/cloud/aiplatform_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4091,6 +4091,11 @@
40914091
"direct_raw_predict"
40924092
]
40934093
},
4094+
"EmbedContent": {
4095+
"methods": [
4096+
"embed_content"
4097+
]
4098+
},
40944099
"Explain": {
40954100
"methods": [
40964101
"explain"
@@ -4161,6 +4166,11 @@
41614166
"direct_raw_predict"
41624167
]
41634168
},
4169+
"EmbedContent": {
4170+
"methods": [
4171+
"embed_content"
4172+
]
4173+
},
41644174
"Explain": {
41654175
"methods": [
41664176
"explain"
@@ -4231,6 +4241,11 @@
42314241
"direct_raw_predict"
42324242
]
42334243
},
4244+
"EmbedContent": {
4245+
"methods": [
4246+
"embed_content"
4247+
]
4248+
},
42344249
"Explain": {
42354250
"methods": [
42364251
"explain"

google/cloud/aiplatform_v1/services/prediction_service/async_client.py

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@
5050

5151
from google.api import httpbody_pb2 # type: ignore
5252
from google.cloud.aiplatform_v1.types import content
53+
from google.cloud.aiplatform_v1.types import content as gca_content
5354
from google.cloud.aiplatform_v1.types import explanation
5455
from google.cloud.aiplatform_v1.types import prediction_service
5556
from google.cloud.aiplatform_v1.types import types
57+
from google.cloud.aiplatform_v1.types import usage_metadata
5658
from google.cloud.location import locations_pb2 # type: ignore
5759
from google.iam.v1 import iam_policy_pb2 # type: ignore
5860
from google.iam.v1 import policy_pb2 # type: ignore
@@ -1931,6 +1933,127 @@ async def sample_stream_generate_content():
19311933
# Done; return the response.
19321934
return response
19331935

1936+
async def embed_content(
1937+
self,
1938+
request: Optional[Union[prediction_service.EmbedContentRequest, dict]] = None,
1939+
*,
1940+
model: Optional[str] = None,
1941+
content: Optional[gca_content.Content] = None,
1942+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1943+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1944+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1945+
) -> prediction_service.EmbedContentResponse:
1946+
r"""Embed content with multimodal inputs.
1947+
1948+
.. code-block:: python
1949+
1950+
# This snippet has been automatically generated and should be regarded as a
1951+
# code template only.
1952+
# It will require modifications to work:
1953+
# - It may require correct/in-range values for request initialization.
1954+
# - It may require specifying regional endpoints when creating the service
1955+
# client as shown in:
1956+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1957+
from google.cloud import aiplatform_v1
1958+
1959+
async def sample_embed_content():
1960+
# Create a client
1961+
client = aiplatform_v1.PredictionServiceAsyncClient()
1962+
1963+
# Initialize request argument(s)
1964+
request = aiplatform_v1.EmbedContentRequest(
1965+
)
1966+
1967+
# Make the request
1968+
response = await client.embed_content(request=request)
1969+
1970+
# Handle the response
1971+
print(response)
1972+
1973+
Args:
1974+
request (Optional[Union[google.cloud.aiplatform_v1.types.EmbedContentRequest, dict]]):
1975+
The request object. Request message for
1976+
[PredictionService.EmbedContent][google.cloud.aiplatform.v1.PredictionService.EmbedContent].
1977+
model (:class:`str`):
1978+
Required. The name of the publisher model requested to
1979+
serve the prediction. Format:
1980+
``projects/{project}/locations/{location}/publishers/*/models/*``
1981+
1982+
This corresponds to the ``model`` field
1983+
on the ``request`` instance; if ``request`` is provided, this
1984+
should not be set.
1985+
content (:class:`google.cloud.aiplatform_v1.types.Content`):
1986+
Required. Input content to be
1987+
embedded. Required.
1988+
1989+
This corresponds to the ``content`` field
1990+
on the ``request`` instance; if ``request`` is provided, this
1991+
should not be set.
1992+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1993+
should be retried.
1994+
timeout (float): The timeout for this request.
1995+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1996+
sent along with the request as metadata. Normally, each value must be of type `str`,
1997+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1998+
be of type `bytes`.
1999+
2000+
Returns:
2001+
google.cloud.aiplatform_v1.types.EmbedContentResponse:
2002+
Response message for
2003+
[PredictionService.EmbedContent][google.cloud.aiplatform.v1.PredictionService.EmbedContent].
2004+
2005+
"""
2006+
# Create or coerce a protobuf request object.
2007+
# - Quick check: If we got a request object, we should *not* have
2008+
# gotten any keyword arguments that map to the request.
2009+
flattened_params = [model, content]
2010+
has_flattened_params = (
2011+
len([param for param in flattened_params if param is not None]) > 0
2012+
)
2013+
if request is not None and has_flattened_params:
2014+
raise ValueError(
2015+
"If the `request` argument is set, then none of "
2016+
"the individual field arguments should be set."
2017+
)
2018+
2019+
# - Use the request object if provided (there's no risk of modifying the input as
2020+
# there are no flattened fields), or create one.
2021+
if not isinstance(request, prediction_service.EmbedContentRequest):
2022+
request = prediction_service.EmbedContentRequest(request)
2023+
2024+
# If we have keyword arguments corresponding to fields on the
2025+
# request, apply these.
2026+
if model is not None:
2027+
request.model = model
2028+
if content is not None:
2029+
request.content = content
2030+
2031+
# Wrap the RPC method; this adds retry and timeout information,
2032+
# and friendly error handling.
2033+
rpc = self._client._transport._wrapped_methods[
2034+
self._client._transport.embed_content
2035+
]
2036+
2037+
# Certain fields should be provided within the metadata header;
2038+
# add these here.
2039+
metadata = tuple(metadata) + (
2040+
gapic_v1.routing_header.to_grpc_metadata((("model", request.model),)),
2041+
)
2042+
2043+
# Validate the universe domain.
2044+
self._client._validate_universe_domain()
2045+
2046+
# Send the request.
2047+
response = await rpc(
2048+
request,
2049+
retry=retry,
2050+
timeout=timeout,
2051+
metadata=metadata,
2052+
)
2053+
2054+
# Done; return the response.
2055+
return response
2056+
19342057
async def list_operations(
19352058
self,
19362059
request: Optional[operations_pb2.ListOperationsRequest] = None,

0 commit comments

Comments
 (0)