Skip to content

Commit 6332d33

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- 65a6e4f by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add asyncQueryReasoningEngine to aiplatform v1 API PiperOrigin-RevId: 900907134 Source-Link: googleapis/googleapis@1a00cec Source-Link: googleapis/googleapis-gen@f356560 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjM1NjU2MDY5Y2M4MGRiZTMyZmUzNmE2NjAzZTUxNTYyY2ViYTJjNCJ9 feat: Model Registry CopyModel BYOSA PiperOrigin-RevId: 899215526 Source-Link: googleapis/googleapis@62e4ecb Source-Link: googleapis/googleapis-gen@1363385 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTM2MzM4NWY0N2M0ZTBhM2Y1NGMxYzkzYWYzZDA5ZThmYTUxOGQwYSJ9 feat: new field CopyModelRequest.custome_service_account for Model Registry CopyModel BYOSA PiperOrigin-RevId: 899197055 Source-Link: googleapis/googleapis@5f39e35 Source-Link: googleapis/googleapis-gen@0d5d2b0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGQ1ZDJiMDAyY2Q0ODVhOWRkNjMxMjA4Y2UzZGRhOTUyYjBiYWUyNCJ9 feat: synchronize google/api/expr/v1alpha1 docs: update various comments PiperOrigin-RevId: 893555698 Source-Link: googleapis/googleapis@c8ca5bc Source-Link: googleapis/googleapis-gen@4fd6e2a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZkNmUyYWIzMDZkNThlZmZlZDFkMmZkNzc5ZWU3OWNkY2EzZDEzNiJ9 feat: add evaluation metrics and autorater configuration to the AI Platform v1 API feat: add evaluation configuration and dataset runs to TuningJob feat: add multimodal input support and custom output formats to evaluation metrics PiperOrigin-RevId: 893059415 Source-Link: googleapis/googleapis@582172d Source-Link: googleapis/googleapis-gen@b8fd776 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjhmZDc3Njc2ZGUwMDYzZTQ2MjY1NGE5NGYzOGM5YjE3YzQwNDJmNyJ9 docs: update SelectiveGapicGeneration usage doc PiperOrigin-RevId: 892649773 Source-Link: googleapis/googleapis@06a20b2 Source-Link: googleapis/googleapis-gen@d9ae664 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 feat: add origin to AttributeContext.Request docs: update comments and formatting PiperOrigin-RevId: 892442206 Source-Link: googleapis/googleapis@ebd1d23 Source-Link: googleapis/googleapis-gen@fc58cd7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmM1OGNkNzE4OWIyYTZmYjkzNDI0ODliOWVhZmVkYjAwMWExMTQyNCJ9 -- 9b92b20 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 -- 2f4e6aa by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add asyncQueryReasoningEngine to aiplatform v1beta1 API PiperOrigin-RevId: 902815104 Source-Link: googleapis/googleapis@a78b583 Source-Link: googleapis/googleapis-gen@7eace83 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2VhY2U4MzcxMWQ5MDIxNjkxZGM3MGQ5MmIzNWRkOGM2MDg1MGIxNyJ9 -- 4a28d81 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 -- 8496b95 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Support VeoLoraTuningSpec in the tuning jobs PiperOrigin-RevId: 903331273 Source-Link: googleapis/googleapis@939ba3b Source-Link: googleapis/googleapis-gen@13be7f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTNiZTdmOWE0ODkzZjNjNmVhN2MxZTBlNzkzYjFhMTg5N2JjOTRiMyJ9 -- 0de2ee6 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 -- 08b3db0 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add OnlineEvaluator API and update Evaluation API PiperOrigin-RevId: 903986874 Source-Link: googleapis/googleapis@a19bd07 Source-Link: googleapis/googleapis-gen@3d2f58e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2QyZjU4ZTA3MThjZDFmYzU2MWEwYjhkMzI1NTE3YmExMzk2NGE0NSJ9 -- 09af63c 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=#6525 from googleapis:owl-bot-copy 46bc099 PiperOrigin-RevId: 904767750
1 parent a7acc97 commit 6332d33

181 files changed

Lines changed: 60626 additions & 1586 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
OnlineEvaluatorService
2+
----------------------------------------
3+
4+
.. automodule:: google.cloud.aiplatform_v1beta1.services.online_evaluator_service
5+
:members:
6+
:inherited-members:
7+
8+
.. automodule:: google.cloud.aiplatform_v1beta1.services.online_evaluator_service.pagers
9+
:members:
10+
:inherited-members:

docs/aiplatform_v1beta1/services_.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Services for Google Cloud Aiplatform v1beta1 API
2929
model_monitoring_service
3030
model_service
3131
notebook_service
32+
online_evaluator_service
3233
persistent_resource_service
3334
pipeline_service
3435
prediction_service

google/cloud/aiplatform_v1/__init__.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@
261261
from .types.evaluated_annotation import ErrorAnalysisAnnotation
262262
from .types.evaluated_annotation import EvaluatedAnnotation
263263
from .types.evaluated_annotation import EvaluatedAnnotationExplanation
264+
from .types.evaluation_service import AggregationOutput
265+
from .types.evaluation_service import AggregationResult
266+
from .types.evaluation_service import AutoraterConfig
264267
from .types.evaluation_service import BleuInput
265268
from .types.evaluation_service import BleuInstance
266269
from .types.evaluation_service import BleuMetricValue
@@ -274,8 +277,14 @@
274277
from .types.evaluation_service import CometInstance
275278
from .types.evaluation_service import CometResult
276279
from .types.evaluation_service import CometSpec
280+
from .types.evaluation_service import ComputationBasedMetricSpec
281+
from .types.evaluation_service import ContentMap
282+
from .types.evaluation_service import CustomOutput
283+
from .types.evaluation_service import CustomOutputFormatConfig
284+
from .types.evaluation_service import EvaluateDatasetResponse
277285
from .types.evaluation_service import EvaluateInstancesRequest
278286
from .types.evaluation_service import EvaluateInstancesResponse
287+
from .types.evaluation_service import EvaluationDataset
279288
from .types.evaluation_service import ExactMatchInput
280289
from .types.evaluation_service import ExactMatchInstance
281290
from .types.evaluation_service import ExactMatchMetricValue
@@ -293,10 +302,15 @@
293302
from .types.evaluation_service import GroundednessInstance
294303
from .types.evaluation_service import GroundednessResult
295304
from .types.evaluation_service import GroundednessSpec
305+
from .types.evaluation_service import LLMBasedMetricSpec
306+
from .types.evaluation_service import Metric
307+
from .types.evaluation_service import MetricResult
296308
from .types.evaluation_service import MetricxInput
297309
from .types.evaluation_service import MetricxInstance
298310
from .types.evaluation_service import MetricxResult
299311
from .types.evaluation_service import MetricxSpec
312+
from .types.evaluation_service import OutputConfig
313+
from .types.evaluation_service import OutputInfo
300314
from .types.evaluation_service import PairwiseMetricInput
301315
from .types.evaluation_service import PairwiseMetricInstance
302316
from .types.evaluation_service import PairwiseMetricResult
@@ -313,6 +327,7 @@
313327
from .types.evaluation_service import PointwiseMetricInstance
314328
from .types.evaluation_service import PointwiseMetricResult
315329
from .types.evaluation_service import PointwiseMetricSpec
330+
from .types.evaluation_service import PredefinedMetricSpec
316331
from .types.evaluation_service import QuestionAnsweringCorrectnessInput
317332
from .types.evaluation_service import QuestionAnsweringCorrectnessInstance
318333
from .types.evaluation_service import QuestionAnsweringCorrectnessResult
@@ -329,6 +344,7 @@
329344
from .types.evaluation_service import QuestionAnsweringRelevanceInstance
330345
from .types.evaluation_service import QuestionAnsweringRelevanceResult
331346
from .types.evaluation_service import QuestionAnsweringRelevanceSpec
347+
from .types.evaluation_service import RawOutput
332348
from .types.evaluation_service import RougeInput
333349
from .types.evaluation_service import RougeInstance
334350
from .types.evaluation_service import RougeMetricValue
@@ -879,6 +895,11 @@
879895
from .types.publisher_model import PublisherModel
880896
from .types.reasoning_engine import ReasoningEngine
881897
from .types.reasoning_engine import ReasoningEngineSpec
898+
from .types.reasoning_engine_execution_service import (
899+
AsyncQueryReasoningEngineOperationMetadata,
900+
)
901+
from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineRequest
902+
from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineResponse
882903
from .types.reasoning_engine_execution_service import QueryReasoningEngineRequest
883904
from .types.reasoning_engine_execution_service import QueryReasoningEngineResponse
884905
from .types.reasoning_engine_execution_service import StreamQueryReasoningEngineRequest
@@ -1023,6 +1044,8 @@
10231044
from .types.training_pipeline import StratifiedSplit
10241045
from .types.training_pipeline import TimestampSplit
10251046
from .types.training_pipeline import TrainingPipeline
1047+
from .types.tuning_job import EvaluateDatasetRun
1048+
from .types.tuning_job import EvaluationConfig
10261049
from .types.tuning_job import PreTunedModel
10271050
from .types.tuning_job import SupervisedHyperParameters
10281051
from .types.tuning_job import SupervisedTuningDatasetDistribution
@@ -1253,6 +1276,8 @@ def _get_version(dependency_name):
12531276
"AddExecutionEventsRequest",
12541277
"AddExecutionEventsResponse",
12551278
"AddTrialMeasurementRequest",
1279+
"AggregationOutput",
1280+
"AggregationResult",
12561281
"Annotation",
12571282
"AnnotationSpec",
12581283
"ApiAuth",
@@ -1263,13 +1288,17 @@ def _get_version(dependency_name):
12631288
"AskContextsResponse",
12641289
"AssignNotebookRuntimeOperationMetadata",
12651290
"AssignNotebookRuntimeRequest",
1291+
"AsyncQueryReasoningEngineOperationMetadata",
1292+
"AsyncQueryReasoningEngineRequest",
1293+
"AsyncQueryReasoningEngineResponse",
12661294
"AsyncRetrieveContextsOperationMetadata",
12671295
"AsyncRetrieveContextsRequest",
12681296
"AsyncRetrieveContextsResponse",
12691297
"Attribution",
12701298
"AugmentPromptRequest",
12711299
"AugmentPromptResponse",
12721300
"AutomaticResources",
1301+
"AutoraterConfig",
12731302
"AutoscalingMetricSpec",
12741303
"AvroSource",
12751304
"BatchCancelPipelineJobsOperationMetadata",
@@ -1338,11 +1367,13 @@ def _get_version(dependency_name):
13381367
"CometSpec",
13391368
"CompleteTrialRequest",
13401369
"CompletionStats",
1370+
"ComputationBasedMetricSpec",
13411371
"ComputeTokensRequest",
13421372
"ComputeTokensResponse",
13431373
"ContainerRegistryDestination",
13441374
"ContainerSpec",
13451375
"Content",
1376+
"ContentMap",
13461377
"Context",
13471378
"CopyModelOperationMetadata",
13481379
"CopyModelRequest",
@@ -1419,6 +1450,8 @@ def _get_version(dependency_name):
14191450
"CsvSource",
14201451
"CustomJob",
14211452
"CustomJobSpec",
1453+
"CustomOutput",
1454+
"CustomOutputFormatConfig",
14221455
"DataFoundryServiceClient",
14231456
"DataItem",
14241457
"DataItemView",
@@ -1513,10 +1546,14 @@ def _get_version(dependency_name):
15131546
"EntityType",
15141547
"EnvVar",
15151548
"ErrorAnalysisAnnotation",
1549+
"EvaluateDatasetResponse",
1550+
"EvaluateDatasetRun",
15161551
"EvaluateInstancesRequest",
15171552
"EvaluateInstancesResponse",
15181553
"EvaluatedAnnotation",
15191554
"EvaluatedAnnotationExplanation",
1555+
"EvaluationConfig",
1556+
"EvaluationDataset",
15201557
"EvaluationServiceClient",
15211558
"Event",
15221559
"EventActions",
@@ -1704,6 +1741,7 @@ def _get_version(dependency_name):
17041741
"JiraSource",
17051742
"JobServiceClient",
17061743
"JobState",
1744+
"LLMBasedMetricSpec",
17071745
"LargeModelReference",
17081746
"LineageSubgraph",
17091747
"ListAnnotationsRequest",
@@ -1828,6 +1866,8 @@ def _get_version(dependency_name):
18281866
"MetadataSchema",
18291867
"MetadataServiceClient",
18301868
"MetadataStore",
1869+
"Metric",
1870+
"MetricResult",
18311871
"MetricxInput",
18321872
"MetricxInstance",
18331873
"MetricxResult",
@@ -1885,7 +1925,9 @@ def _get_version(dependency_name):
18851925
"NotebookRuntimeType",
18861926
"NotebookServiceClient",
18871927
"NotebookSoftwareConfig",
1928+
"OutputConfig",
18881929
"OutputFieldSpec",
1930+
"OutputInfo",
18891931
"PSCAutomationConfig",
18901932
"PSCAutomationState",
18911933
"PairwiseChoice",
@@ -1924,6 +1966,7 @@ def _get_version(dependency_name):
19241966
"PostStartupScriptConfig",
19251967
"PreTunedModel",
19261968
"PrebuiltVoiceConfig",
1969+
"PredefinedMetricSpec",
19271970
"PredefinedSplit",
19281971
"PredictRequest",
19291972
"PredictRequestResponseLoggingConfig",
@@ -1984,6 +2027,7 @@ def _get_version(dependency_name):
19842027
"RagQuery",
19852028
"RagRetrievalConfig",
19862029
"RagVectorDbConfig",
2030+
"RawOutput",
19872031
"RawPredictRequest",
19882032
"RayLogsSpec",
19892033
"RayMetricSpec",

google/cloud/aiplatform_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,6 +4310,11 @@
43104310
"grpc": {
43114311
"libraryClient": "ReasoningEngineExecutionServiceClient",
43124312
"rpcs": {
4313+
"AsyncQueryReasoningEngine": {
4314+
"methods": [
4315+
"async_query_reasoning_engine"
4316+
]
4317+
},
43134318
"QueryReasoningEngine": {
43144319
"methods": [
43154320
"query_reasoning_engine"
@@ -4325,6 +4330,11 @@
43254330
"grpc-async": {
43264331
"libraryClient": "ReasoningEngineExecutionServiceAsyncClient",
43274332
"rpcs": {
4333+
"AsyncQueryReasoningEngine": {
4334+
"methods": [
4335+
"async_query_reasoning_engine"
4336+
]
4337+
},
43284338
"QueryReasoningEngine": {
43294339
"methods": [
43304340
"query_reasoning_engine"
@@ -4340,6 +4350,11 @@
43404350
"rest": {
43414351
"libraryClient": "ReasoningEngineExecutionServiceClient",
43424352
"rpcs": {
4353+
"AsyncQueryReasoningEngine": {
4354+
"methods": [
4355+
"async_query_reasoning_engine"
4356+
]
4357+
},
43434358
"QueryReasoningEngine": {
43444359
"methods": [
43454360
"query_reasoning_engine"

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

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
from google.iam.v1 import policy_pb2 # type: ignore
5454
from google.longrunning import operations_pb2 # type: ignore
5555
import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore
56+
import google.api_core.operation as operation # type: ignore
57+
import google.api_core.operation_async as operation_async # type: ignore
5658
import google.protobuf.any_pb2 as any_pb2 # type: ignore
5759
import google.protobuf.struct_pb2 as struct_pb2 # type: ignore
5860
from .transports.base import (
@@ -561,6 +563,117 @@ async def sample_stream_query_reasoning_engine():
561563
# Done; return the response.
562564
return response
563565

566+
async def async_query_reasoning_engine(
567+
self,
568+
request: Optional[
569+
Union[
570+
reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest,
571+
dict,
572+
]
573+
] = None,
574+
*,
575+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
576+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
577+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
578+
) -> operation_async.AsyncOperation:
579+
r"""Async query using a reasoning engine.
580+
581+
.. code-block:: python
582+
583+
# This snippet has been automatically generated and should be regarded as a
584+
# code template only.
585+
# It will require modifications to work:
586+
# - It may require correct/in-range values for request initialization.
587+
# - It may require specifying regional endpoints when creating the service
588+
# client as shown in:
589+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
590+
from google.cloud import aiplatform_v1
591+
592+
async def sample_async_query_reasoning_engine():
593+
# Create a client
594+
client = aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient()
595+
596+
# Initialize request argument(s)
597+
request = aiplatform_v1.AsyncQueryReasoningEngineRequest(
598+
name="name_value",
599+
)
600+
601+
# Make the request
602+
operation = client.async_query_reasoning_engine(request=request)
603+
604+
print("Waiting for operation to complete...")
605+
606+
response = (await operation).result()
607+
608+
# Handle the response
609+
print(response)
610+
611+
Args:
612+
request (Optional[Union[google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineRequest, dict]]):
613+
The request object. Request message for
614+
[ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine].
615+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
616+
should be retried.
617+
timeout (float): The timeout for this request.
618+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
619+
sent along with the request as metadata. Normally, each value must be of type `str`,
620+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
621+
be of type `bytes`.
622+
623+
Returns:
624+
google.api_core.operation_async.AsyncOperation:
625+
An object representing a long-running operation.
626+
627+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineResponse` Response message for
628+
[ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine].
629+
630+
"""
631+
# Create or coerce a protobuf request object.
632+
# - Use the request object if provided (there's no risk of modifying the input as
633+
# there are no flattened fields), or create one.
634+
if not isinstance(
635+
request, reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest
636+
):
637+
request = (
638+
reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest(
639+
request
640+
)
641+
)
642+
643+
# Wrap the RPC method; this adds retry and timeout information,
644+
# and friendly error handling.
645+
rpc = self._client._transport._wrapped_methods[
646+
self._client._transport.async_query_reasoning_engine
647+
]
648+
649+
# Certain fields should be provided within the metadata header;
650+
# add these here.
651+
metadata = tuple(metadata) + (
652+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
653+
)
654+
655+
# Validate the universe domain.
656+
self._client._validate_universe_domain()
657+
658+
# Send the request.
659+
response = await rpc(
660+
request,
661+
retry=retry,
662+
timeout=timeout,
663+
metadata=metadata,
664+
)
665+
666+
# Wrap the response in an operation future.
667+
response = operation_async.from_gapic(
668+
response,
669+
self._client._transport.operations_client,
670+
reasoning_engine_execution_service.AsyncQueryReasoningEngineResponse,
671+
metadata_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineOperationMetadata,
672+
)
673+
674+
# Done; return the response.
675+
return response
676+
564677
async def list_operations(
565678
self,
566679
request: Optional[operations_pb2.ListOperationsRequest] = None,

0 commit comments

Comments
 (0)