Skip to content

feat(agentplatform): add turn_type for model evaluation metrics - #1186

Merged
anup-deka merged 5 commits into
digitalocean:mainfrom
achiang-do:feat/genai-evaluation-metric-turn-type
Nov 6, 2026
Merged

anup-deka merged 5 commits into
digitalocean:mainfrom
achiang-do:feat/genai-evaluation-metric-turn-type

Conversation

@achiang-do

@achiang-do achiang-do commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to cthulhu#181229: expose GenAI custom/builtin evaluation metric turn_type in godo so Go clients can create/list with single- vs multi-turn compatibility.

  • EvaluationMetricTurnType enum (UNSPECIFIED / SINGLE_TURN / MULTI_TURN).
  • TurnType on EvaluationMetric and CustomEvaluationMetricConfig (create/update send it via existing Config; responses unmarshal it).
  • List: keep ListModelEvaluationMetrics(ctx) unchanged (forwards with nil); add ListModelEvaluationMetricsWithOptions(ctx, opt) with ModelEvaluationMetricListOptions.TurnType → ?turn_type= (same pattern as ListConsents / ListConsentsWithOptions).

Depends on the backend API having turn_type deployed (preview already verified).

Not a breaking Go change: existing ListModelEvaluationMetrics(ctx) callers keep compiling.

Test plan

Unit Tests

-TestListModelEvaluationMetricsByTurnType makes sure client contract matches expectations

Manual Testing (Using Preview)

Case Result
List all metrics (unfiltered) success → 61 metrics; every row has turn_type
List with turn_type=MULTI_TURN via WithOptions success → 7 metrics; sample rows MULTI_TURN (builtins)
Create multi-turn custom eval without GT success → uuid=81d452b6-…, turn_type=MULTI_TURN on metric + config
Delete created custom metric success

PR Checklist

Submitter checklist

  • Changes are covered by tests
  • Proof of testing below

Proof of testing

Have you provided proof of testing for all logical paths in this change?

  • Yes
  • Not required

Reviewer checklist

  • Validate that the changes are covered by tests
  • Confirm List signature remains non-breaking (WithOptions additive)

Made with Cursor

Expose EvaluationMetricTurnType on metrics and custom config, and add
ListModelEvaluationMetricsWithOptions so callers can filter by turn type
without breaking the existing ListModelEvaluationMetrics(ctx) signature.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread agentplatform.go
ListModelEvaluationRuns(ctx context.Context, opt *ModelEvaluationRunListOptions) (*ModelEvaluationRunListResponse, *Response, error)
ListModelEvaluationPresets(ctx context.Context) (*ModelEvaluationPresetListResponse, *Response, error)
ListModelEvaluationMetrics(ctx context.Context) (*ModelEvaluationMetricListResponse, *Response, error)
ListModelEvaluationMetricsWithOptions(ctx context.Context, opt *ModelEvaluationMetricListOptions) (*ModelEvaluationMetricListResponse, *Response, error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need 2 interfaces exposed ?
Can opt can be a variadic param ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make it variadic, but the pattern in godo seems to be to add an extra interface for WithOptions, like:

signals.go — ListConsents → ListConsentsWithOptions(ctx, opts *SignalsListConsentsOptions) (no-arg calls WithOptions(ctx, nil))
nfs.go — List → ListWithOptions(ctx, opts *NfsListOptions)
nfs.go — Delete → DeleteWithOptions(ctx, id, opts *NfsDeleteOptions)

@anup-deka
anup-deka merged commit 5313b28 into digitalocean:main Nov 6, 2026
8 checks passed
@achiang-do
achiang-do deleted the feat/genai-evaluation-metric-turn-type branch November 6, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

⌂ 换网址