Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[bot] OpenAI: Realtime API (`client.realtime.connect()`) has zero instrumentation

Đang mở
#798 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Local repo files inspected

  • py/src/braintrust/integrations/openai/integration.py (full file)
  • py/src/braintrust/integrations/openai/patchers.py (_WRAP_TARGETS registry)
  • Repo-wide case-insensitive grep for realtime across py/src/braintrust
Ngôn ngữ chính
Python
Star
19
Fork
17
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
61

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của braintrustdata/braintrust-sdk-python

Tất cả issue của braintrustdata/braintrust-sdk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.