Skip to content

fix(client): match the evaluation request and response contract - #6181

Open
Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/client-evaluation-contract
Open

Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/client-evaluation-contract

Conversation

@Yzzz88

@Yzzz88 Yzzz88 commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Description

A Go SDK caller cannot complete the evaluation workflow against the current server. EvaluationRequest has an embedding ID but no knowledge-base ID, while the handler requires the knowledge base to select its embedding configuration. Both evaluation endpoints return data.task and data.metric; the SDK decodes a flat object instead, silently returning an empty task ID/status and no metrics.

Add the knowledge-base request field and decode the server's nested detail into the existing SDK return types. Numeric task states become the documented status strings, progress comes from finished/total, err_msg is retained, and retrieval/generation metrics are exposed through the existing metrics map. Existing flat response fixtures remain supported. The legacy embedding field is retained and marked deprecated; the server selects that model from the knowledge base.

Type of Change

  • Bug fix
  • Test

Testing

The regressions failed on main: the outgoing knowledge-base ID was empty, and start/poll returned empty task data. They now cover the knowledge-base request, pending/running/completed/failed responses, task ID, 50% progress, failure messages, retrieval/generation metrics, and the previous flat response format. Fixtures follow internal/types/evaluation.go and the real handler's response envelope.

  • go test -count=1 ./... in client/ passes in full.
  • golangci-lint v2.12.2 run --new-from-rev origin/main ./... in client/ reports 0 issues.
  • git diff --check passes.

Tests execute the actual client methods with an HTTP transport fixture; no paid-model evaluation run or backend service was started.

This branch has not been deployed

No deployments
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.

1 participant