github vercel/ai @ai-sdk/openai-compatible@3.0.31

latest releases: @ai-sdk/workflow-harness@1.0.73, @ai-sdk/togetherai@3.0.32, @ai-sdk/sandbox-vercel@1.0.73...
4 hours ago

Patch Changes

  • 86892f3: fix(openai-compatible): preserve unmapped usage fields in usage.raw

    usage.raw is specified as usage "in the shape that the provider returns",
    and the chat model already parsed the usage object loosely so that extra
    top-level fields survived. The nested prompt_tokens_details and
    completion_tokens_details objects were still strict, so anything a provider
    reported inside them was dropped — which is where providers put their most
    distinguishing detail. The existing "should preserve extra usage fields"
    fixture was itself losing audio_tokens, image_tokens and text_tokens
    this way.

    Both nested objects are now parsed loosely, as is the completion model's usage
    schema, which was strict throughout despite feeding the same raw field.

    Only usage.raw changes. The mapped token counts are unaffected.

Don't miss a new ai release

NewReleases is sending notifications on new releases.