发布

  • [NA] [SDK] feat: allow passing provider name to track_openai (#7223)

    frostbyte_neo 发布于 2026-06-24 15:13:00 +00:00

    • [NA] [SDK] feat: allow passing provider name to track_openai

    Add an optional provider argument to track_openai that overrides the
    base-URL-derived provider on every LLM span created by the integration
    (chat completions, responses, videos, audio). Useful for OpenAI-compatible
    APIs where the host-based default is not descriptive enough.

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

    • docs(openai): document custom provider; accept LLMProvider; add tests
    • track_openai provider arg now accepts str or opik.LLMProvider; enum is
      normalized to its string value so spans never record "LLMProvider.OPENAI"
    • docstring lists the providers Opik recognizes for cost tracking
    • clarify in code that usage is always parsed with the OpenAI converter
      regardless of the (overridable) span provider label
    • document the custom-provider use case in the OpenAI integration docs (v1 + v2)
    • add library integration tests for chat completions (str + LLMProvider) and
      responses, asserting usage is still parsed as OpenAI

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com


    Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com

    下载附件