OpenAI + LiteLLM: trace new decisions API

已關閉
#921 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@AbhiPrasad 已經在處理了。

開始於 2026年10月13日。

  • #927 來自 @AbhiPrasad —— 未關閉

評估

這個 Issue 還沒有評估資料。

描述

feature integration: litellm integration: openai python

OpenAI 3.26.0 added client.decisions.create (sync + async). It calls a model and returns usage, including cached, cache-write and reasoning tokens. LiteLLM 1.105.0 added matching litellm.decisions() / litellm.adecisions() (litellm/decisions/main.py).

Neither is traced today, so these calls produce no LLM spans.

Proposed change

  • py/src/braintrust/integrations/openai/: patch Decisions.create and AsyncDecisions.create to emit an LLM span, reusing the existing usage parsing.
  • py/src/braintrust/integrations/litellm/patchers.py: add patchers for decisions / adecisions.
  • Add cassette-backed tests for both, gated on the version that introduced the API (see integrations/versioning.py).

Found while reviewing the dependency bumps in #911 (openai 3.24.0 → 3.29.0, litellm 1.104.0 → 1.105.0).

主要語言
Python
星號
22
分支
30
平均合併
9 小時 19 分鐘
30 天內合併 PR
133

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

braintrustdata/braintrust-sdk-python 的其他 Issue

查看 braintrustdata/braintrust-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。