Repository navigation
feat(vertexai): add google_vertex_ai_online_evaluator resource - #18921
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
| Inline metric config, provided as a JSON-formatted string using | ||
| camelCase field names to match the API format (see the | ||
| [Metric API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/Metric)). | ||
| Suggested predefined `metricSpecName` values: |
There was a problem hiding this comment.
I think it would be better to list the metrics divided by the scope so that users don't specify trace scope metric and declare session scope ingestion only.
Btw what will happen in such case, will the metric silently not work, or will the apply fail with a pertinent error ?
There was a problem hiding this comment.
I agree, added a clarification. For predefined metrics scope mismatch isn't silent (we have validation on our control plane) and apply fails with INVALID_ARGUMENT (e.g. Metric 'multi_turn_trajectory_quality_v1' is not a valid predefined metric. Only [tool_use_quality_v1, final_response_quality_v1, hallucination_v1, safety_v1] are supported). For a registered metric_resource_name only the name format is checked on create, and invalid metrics are surfaced at runtime (we update OnlineEvaluator state and write a log in the project).
|
@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
|
We’re currently requesting a change in process for Googlers (or individuals on behalf of Googlers) contributing changes to the Terraform Provider for Google Cloud. Please see go/terraform-ssp-adjustment for details. |
roaks3
left a comment
There was a problem hiding this comment.
LGTM, just a couple small comments
| create_url: projects/{{project}}/locations/{{region}}/onlineEvaluators | ||
| update_verb: PATCH | ||
| update_mask: true | ||
| generate_list_resource: true |
There was a problem hiding this comment.
Was this done intentionally? (is there value in users querying all evaluators?)
Just checking
There was a problem hiding this comment.
Yes, the OnlineEvaluators API has a List method, so enumerating evaluators is a supported use case.
| type: String | ||
| description: The region of the OnlineEvaluator (e.g. us-central1). | ||
| url_param_only: true | ||
| required: true |
There was a problem hiding this comment.
Often we don't make region required because it can be set on the provider level, and normally users expect that setting to be used. From a quick look, it seems like most other vertexai resources make this optional.
Is there a reason region needs to be required here?
There was a problem hiding this comment.
No strong reason, made it optional, matching the common vertexai pattern. Thanks
| service/aiplatform-evaluation: | ||
| resources: | ||
| - google_vertex_ai_evaluation_.* | ||
| - google_vertex_ai_online_evaluator |
There was a problem hiding this comment.
FYI go/terraform-resource-owners-enrollment#manage-enrollment, the change here won't stick, it is reflective of an internal source
There was a problem hiding this comment.
Thanks, dropped the enrolled_teams.yml change. I'll add ourselves to internal proto instead.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 991212e: Diff reportYour PR generated the following diffs in downstream repositories:
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_vertex_ai_online_evaluator" "primary" {
cloud_observability {
log_view = # value needed
session_scope {
filter {
duration {
comparison_operator = # value needed
value = # value needed
}
model_call_errors {
comparison_operator = # value needed
value = # value needed
}
model_calls {
comparison_operator = # value needed
value = # value needed
}
tool_call_errors {
comparison_operator = # value needed
value = # value needed
}
tool_calls {
comparison_operator = # value needed
value = # value needed
}
user_turns {
comparison_operator = # value needed
value = # value needed
}
}
}
trace_scope {
filter {
total_token_usage {
comparison_operator = # value needed
value = # value needed
}
}
}
trace_view = # value needed
}
}
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. 🟡 Known Nightly Failures: 2 of the tests that failed in recording also fail or are flaky in the last 30 days of nightly runs, so they may be unrelated to this PR. In nightly findings, ⚪ means the test already fails in nightly, 🟡 that it is flaky there, and 🔴 that it is healthy in nightly and so more likely broken by this PR. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the recording VCR build log or the debug logs folder for detailed results. @iliesicatrinel, @maxgasztych VCR tests complete for 991212e! |
roaks3
left a comment
There was a problem hiding this comment.
LGTM, is there a reason we can't test the fields flagged by the check? It wouldn't be a strict blocker, but testing each field is generally important for us to confirm the fields are configured correctly, and it helps for flagging regressions.
Sure, added coverage for all the flagged fields. |
|
/gcbrun |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 7ab1fc8: Diff reportYour PR generated the following diffs in downstream repositories:
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. 🟡 Known Nightly Failures: 2 of the tests that failed in recording also fail or are flaky in the last 30 days of nightly runs, so they may be unrelated to this PR. In nightly findings, ⚪ means the test already fails in nightly, 🟡 that it is flaky there, and 🔴 that it is healthy in nightly and so more likely broken by this PR. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the recording VCR build log or the debug logs folder for detailed results. @iliesicatrinel, @roaks3, @maxgasztych VCR tests complete for 7ab1fc8! |
8abce74
Adds a new resource
google_vertex_ai_online_evaluator(GA + beta) for Vertex AIonline evaluation. It periodically samples traces/sessions from an agent and
evaluates them using configured metric sources, supporting both inline predefined
metrics and references to
google_vertex_ai_evaluation_metric(viametric_resource_name).Release Notes