Skip to content

Keep Jev answer confidence for OpenRouter evaluation models in Vercel AI #24860

Description

@andreiborza

Vercel AI experimental_evaluate with openrouter.evaluationModel('typesafe/jev-1.13') (@openrouter/ai-sdk-provider 3.1.0) gives an evaluate span, but the answers in gen_ai.output.messages lose confidence and legend.

The OpenRouter provider moves these fields into providerMetadata.openrouter.answers[<question id>] ({ confidence, legend }). Our withProviderConfidence in packages/server-utils/src/integrations/vercel-ai/vercel-ai-dc-subscriber.ts only reads providerMetadata.typesafe.confidence, which is the shape of @ai-sdk/typesafe-ai.

Expected

Evaluate answers from the OpenRouter provider keep confidence (choice, score) and legend (score), the same as answers from @ai-sdk/typesafe-ai.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions