[bot] OpenAI: Realtime API (`client.realtime.connect()`) has zero instrumentation
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
The missing instrumentation is for the OpenAI Python SDK's Realtime API (client.realtime.connect()). Start by examining the existing patchers in py/src/braintrust/integrations/openai/patchers.py and the integration setup in integration.py. Review the upstream OpenAI SDK's realtime module to understand the connection manager and event flow. The goal is to add a new patcher for the realtime resource, creating spans for the WebSocket session and individual events, similar to the existing Responses API instrumentation. Testing will involve verifying the new spans appear when using the realtime API.
由索引模型根據 Issue 內容生成。
描述
Summary
The OpenAI Python SDK's top-level Realtime/AsyncRealtime resource (client.realtime.connect() / client.realtime.client_secrets / client.realtime.calls) — the GA WebSocket API for real-time audio/text/tool-use sessions — has no instrumentation anywhere in this repo. This is a distinct, self-contained SDK surface from client.responses.connect() (already tracked in #188): it lives in its own module with its own connection manager and does not share implementation with the Responses API's websocket transport.
What is missing
py/src/braintrust/integrations/openai/integration.py registers exactly these patchers:
patchers = (
AgentsSessionsPatcher,
ChatCompletionsPatcher,
EmbeddingsPatcher,
ModerationsPatcher,
AudioSpeechPatcher,
AudioTranscriptionsPatcher,
AudioTranslationsPatcher,
ImagesPatcher,
ResponsesPatcher,
)
py/src/braintrust/integrations/openai/patchers.py's _WRAP_TARGETS registry (the authoritative list of every OpenAI SDK method this repo patches) contains no realtime entry:
_WRAP_TARGETS: tuple[tuple[str, type[CompositeFunctionWrapperPatcher]], ...] = (
("beta.agents.sessions", _WrapAgentsSessions),
("chat.completions", _WrapChatCompletions),
("embeddings", _WrapEmbeddings),
("moderations", _WrapModerations),
("audio.speech", _WrapAudioSpeech),
("audio.transcriptions", _WrapAudioTranscriptions),
("audio.translations", _WrapAudioTranslations),
("images", _WrapImages),
("responses", _WrapResponses),
("responses.with_raw_response", _WrapResponsesRaw),
("beta.chat.completions", _WrapChatCompletions),
)
A case-insensitive search for "realtime" across the entire py/src/braintrust tree returns zero hits related to OpenAI's Realtime API (the only matches are unrelated "real-time" prose in other integrations/docs). At minimum, instrumentation should provide a session-level span for connect() (model config, duration, aggregate usage) and turn/tool-call spans for events sent/received over the WebSocket connection, mirroring the pattern already used for streaming responses.
Braintrust docs status: not_found
The OpenAI integration page documents Chat Completions, Responses, Embeddings, Moderation, Batch, and the Agents API as traced. It does not describe any tracing support for the Realtime API or client.realtime/connect() — the only "realtime" mention on the page is a cookbook link title ("Evaluating audio with the OpenAI Realtime API"), with no SDK-level tracing detail.
Upstream sources
- OpenAI Python SDK
Realtime/AsyncRealtimeresource: https://github.com/openai/openai-python/blob/main/src/openai/resources/realtime/realtime.py — definesconnect()returningRealtimeConnectionManager/AsyncRealtimeConnectionManager, built directly onwebsockets/SendQueue/EventHandlerRegistry, with no shared code path with the Responses API'sconnect(). - OpenAI Realtime API guide: https://platform.openai.com/docs/guides/realtime
Local repo files inspected
py/src/braintrust/integrations/openai/integration.py(full file)py/src/braintrust/integrations/openai/patchers.py(_WRAP_TARGETSregistry)- Repo-wide case-insensitive grep for
realtimeacrosspy/src/braintrust
- 主要語言
- Python
- 星號
- 22
- 分支
- 24
- 平均合併
- 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 於 1 天前認領。 未關閉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
-
難度 2/5 1-3 小時 新手友好度 77/100
TomerAberbach/profiler-md#733 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
its-me-prash/vwgroup-connect-ha#1858 ·
維護者通常 1 天內回覆
-
area: client bug
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 85/100
leikoilja/ha-google-home#1107 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
Graphify-Labs/graphify#4524 · 1 則留言 ·
維護者通常 1 天內回覆