Skip to main content

online_evaluators

Creates, updates, deletes, gets or lists an online_evaluators resource.

Overview

Nameonline_evaluators
TypeResource
Idgoogle.aiplatform.online_evaluators

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The resource name of the OnlineEvaluator. Format: projects/{project}/locations/{location}/onlineEvaluators/{id}.
agentResourcestringRequired. Immutable. The name of the agent that the OnlineEvaluator evaluates periodically. This value is used to filter the traces with a matching cloud.resource_id and link the evaluation results with relevant dashboards/UIs. This field is immutable. Once set, it cannot be changed.
cloudObservabilityobjectData source for the OnlineEvaluator, based on Google Cloud Observability stack (Cloud Trace & Cloud Logging). (id: GoogleCloudAiplatformV1OnlineEvaluatorCloudObservability)
configobjectRequired. Configuration for the OnlineEvaluator. (id: GoogleCloudAiplatformV1OnlineEvaluatorConfig)
createTimestring (google-datetime)Output only. Timestamp when the OnlineEvaluator was created.
displayNamestringOptional. Human-readable name for the OnlineEvaluator. The name doesn't have to be unique. The name can consist of any UTF-8 characters. The maximum length is 63 characters. If the display name exceeds max characters, an INVALID_ARGUMENT error is returned.
metricSourcesarrayRequired. A list of metric sources to be used for evaluating samples. At least one MetricSource must be provided. Right now, only predefined metrics and registered metrics are supported. Every registered metric must have display_name (or title) and score_range defined. Otherwise, the evaluations will fail. The maximum number of metric_sources is 25.
statestringOutput only. The state of the OnlineEvaluator. (STATE_UNSPECIFIED, ACTIVE, SUSPENDED, FAILED, WARNING)
stateDetailsarrayOutput only. Contains additional information about the state of the OnlineEvaluator. This is used to provide more details in the event of a failure.
updateTimestring (google-datetime)Output only. Timestamp when the OnlineEvaluator was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, onlineEvaluatorsIdGets details of an OnlineEvaluator.
listselectprojectsId, locationsIdpageSize, filter, pageToken, orderByLists the OnlineEvaluators for the given project and location.
createinsertprojectsId, locationsIdCreates an OnlineEvaluator in the given project and location.
patchupdateprojectsId, locationsId, onlineEvaluatorsIdupdateMaskUpdates the fields of an OnlineEvaluator.
deletedeleteprojectsId, locationsId, onlineEvaluatorsIdDeletes an OnlineEvaluator.
suspendexecprojectsId, locationsId, onlineEvaluatorsIdSuspends an OnlineEvaluator. When an OnlineEvaluator is suspended, it won't run any evaluations until it is activated again.
activateexecprojectsId, locationsId, onlineEvaluatorsIdActivates an OnlineEvaluator.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
onlineEvaluatorsIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of an OnlineEvaluator.

SELECT
name,
agentResource,
cloudObservability,
config,
createTime,
displayName,
metricSources,
state,
stateDetails,
updateTime
FROM google.aiplatform.online_evaluators
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND onlineEvaluatorsId = '{{ onlineEvaluatorsId }}' -- required
;

INSERT examples

Creates an OnlineEvaluator in the given project and location.

INSERT INTO google.aiplatform.online_evaluators (
data__metricSources,
data__name,
data__config,
data__cloudObservability,
data__displayName,
data__agentResource,
projectsId,
locationsId
)
SELECT
'{{ metricSources }}',
'{{ name }}',
'{{ config }}',
'{{ cloudObservability }}',
'{{ displayName }}',
'{{ agentResource }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the fields of an OnlineEvaluator.

UPDATE google.aiplatform.online_evaluators
SET
data__metricSources = '{{ metricSources }}',
data__name = '{{ name }}',
data__config = '{{ config }}',
data__cloudObservability = '{{ cloudObservability }}',
data__displayName = '{{ displayName }}',
data__agentResource = '{{ agentResource }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND onlineEvaluatorsId = '{{ onlineEvaluatorsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an OnlineEvaluator.

DELETE FROM google.aiplatform.online_evaluators
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND onlineEvaluatorsId = '{{ onlineEvaluatorsId }}' --required
;

Lifecycle Methods

Suspends an OnlineEvaluator. When an OnlineEvaluator is suspended, it won't run any evaluations until it is activated again.

EXEC google.aiplatform.online_evaluators.suspend
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@onlineEvaluatorsId='{{ onlineEvaluatorsId }}' --required
;