pydantic-ai: capture web-search and grounding counts from `RequestUsage.details`
維護者通常 1 天內回覆
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 72/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
Start in py/src/braintrust/integrations/pydantic_ai/tracing.py around lines 1388–1428, where RequestUsage.details currently provides reasoning and cached-token data. Review the existing cassette-backed integration tests and add coverage for a web-search tool run. Confirm that web-search and grounding counts are captured without breaking compatibility with the listed older pydantic-ai versions, and verify the workspace metadata behavior if included.
由索引模型根據 Issue 內容生成。
描述
pydantic-ai 2.52–2.54 started counting OpenAI native web searches (#8310) and Google grounding queries (#8891) in RequestUsage.details.
The usage extractor in py/src/braintrust/integrations/pydantic_ai/tracing.py (around lines 1388–1428) only reads reasoning and cached tokens from details.
Proposal
- Record the new counts as metrics (or metadata if they aren't token counts), read defensively so older versions (0.1.9, 1.0.1, 1.10.0) are unaffected.
- Optionally record the new
workspace=run kwarg's kind in metadata (_AGENT_INPUT_ALLOWLISTalready keeps the object itself out of spans). - Add cassette-backed coverage with a web-search tool run.
Parent: #858 (found while reviewing the 2026-10-05 weekly dependency update, #849).
🤖 Generated with Claude Code
- 主要語言
- Python
- 星號
- 22
- 分支
- 27
- 平均合併
- 14 小時 49 分鐘
- 30 天內合併 PR
- 126
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
braintrustdata/braintrust-sdk-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 77/100
braintrustdata/braintrust-sdk-python#962 ·
維護者通常 1 天內回覆
-
Temporal: add `workflow.Info.original_execution_run_id` to workflow span metadata可能已有人在做 @Ehsan-hash 於 3 天前認領。 未關閉feature python
難度 2/5 1-3 小時 新手友好度 76/100
braintrustdata/braintrust-sdk-python#868 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 20/100
braintrustdata/braintrust-sdk-python#957 ·
維護者通常 1 天內回覆
-
python
難度 5/5 一週以上 新手友好度 35/100
braintrustdata/braintrust-sdk-python#956 ·
維護者通常 1 天內回覆
-
python
braintrustdata/braintrust-sdk-python#839 ·
維護者通常 1 天內回覆
查看 braintrustdata/braintrust-sdk-python 的全部 Issue
相似的 Issue
-
Issue Triage-Needed
難度 2/5 1-3 小時 新手友好度 68/100
pulp/pulp_container#2581 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
521xueweihan/HelloGitHub#4040 ·
-
bug
難度 2/5 1-3 小時 新手友好度 64/100
ClanGenOfficial/clangen#6313 ·
維護者通常 2 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJob可能已有人在做 @avanishkasar 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆