[bot] OpenAI: Realtime API (`client.realtime.connect()`) has zero instrumentation
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- devtools, observability-sre
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 19
- Forks
- 17
- Ø Merge
- 1 T. 5 Std.
- Gemergte PRs (30 T.)
- 61
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus braintrustdata/braintrust-sdk-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
Alle Issues in braintrustdata/braintrust-sdk-python
Ähnliche Issues
-
bug priority:low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
NousResearch/hermes-agent#122386 · 1 Kommentar ·
-
ai-generated
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
vllm-project/production-stack#1105 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100