[bot] Google GenAI Multimodal Live API sessions not instrumented
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
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- java
- Lĩnh vực
- observability-sre
Hướng nghiên cứu
Bắt đầu với braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java và BraintrustInstrumentation.java, sau đó kiểm tra các điểm vào client.aio.live.connect() và AsyncSession của Google GenAI. So sánh việc instrument request hiện có với Live API dựa trên WebSocket, đồng thời sử dụng BraintrustGenAITest.java làm điểm bắt đầu cho các bài kiểm thử. Hoàn thành khi các session Live API và những tương tác liên quan của chúng có phạm vi bao phủ instrumentation mà không làm hỏng các bài kiểm thử generateContent hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The Google GenAI Java SDK has a stable Multimodal Live API (client.aio.live.connect() → AsyncSession) that enables real-time, bidirectional text and audio generation over WebSocket. This API surface is completely invisible to the current Braintrust instrumentation because BraintrustApiClient only wraps HTTP-based ApiClient.request() and asyncRequest() methods — WebSocket connections use an entirely separate transport that is never intercepted.
Braintrust already documents Live API tracing for Python (client.aio.live.connect() sessions and "tool calls made during Live API sessions"), but there is no equivalent Java instrumentation.
What is missing
BraintrustApiClient (the core instrumentation class, placed in the com.google.genai package to access package-private ApiClient) overrides exactly four methods:
ApiResponse request(String, String, String, Optional<HttpOptions>) // line 186
ApiResponse request(String, String, byte[], Optional<HttpOptions>) // line 210
CompletableFuture<ApiResponse> asyncRequest(String, String, String, ...) // line 239
CompletableFuture<ApiResponse> asyncRequest(String, String, byte[], ...) // line 277
The Live API is not HTTP — it uses WebSocket (WSS) via org.java_websocket.client.WebSocketClient internally. The entry point is:
client.aio.live.connect(model, LiveConnectConfig) // → CompletableFuture<AsyncSession>
AsyncSession then provides:
sendClientContent(LiveSendClientContentParameters)— sends text/content turnssendRealtimeInput(LiveSendRealtimeInputParameters)— streams real-time audio/video inputsendToolResponse(LiveSendToolResponseParameters)— responds to model tool callsreceive(Consumer<LiveServerMessage>)— registers callback for server messages
None of these are reachable via ApiClient.request(), so no spans are created for Live API sessions.
Why this is a distinct gap from #61
Issue #61 covers generateContentStream() not being instrumented (missing streaming HTTP method overrides). The Live API is fundamentally different:
- Uses WebSocket (WSS), not HTTP SSE
- Accessed via
client.aio.live, notclient.models - Supports multi-turn real-time sessions, not single request/response
- Even if #61 is fixed, Live API sessions would remain completely uninstrumented
Braintrust docs status
Braintrust docs at https://www.braintrust.dev/docs/integrations/ai-providers/gemini document Live API tracing for Python:
client.aio.live.connect()— supported (Python)- "async Live API round-trips" — supported (Python)
- "tool calls made during Live API sessions" — supported (Python)
- Java Live API: not_found — no mention in Java SDK documentation
Upstream sources
- Google GenAI Java SDK Live API: introduced in v0.3.0 (2025-03-28), stable and progressively enhanced through v1.18.0 (the version this module targets) — https://github.com/googleapis/java-genai
- Google GenAI Java SDK changelog: v0.3.0 "add types for Live API" and "Support Live API", v1.0.0 "add async support for Live API"
- Gemini Live API docs: https://ai.google.dev/api/multimodal-live — real-time, bidirectional generative execution surface for text and audio
Local files inspected
braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java— lines 186–312: onlyrequest()andasyncRequest()are overridden; no WebSocket or Live API interceptionbraintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustInstrumentation.java— wrapsApiClientintoClient; noliveclient wrappingbraintrust-sdk/instrumentation/genai_1_18_0/src/test/java/dev/braintrust/instrumentation/genai/v1_18_0/BraintrustGenAITest.java— tests only sync/asyncgenerateContent; no Live API tests
- Ngôn ngữ chính
- Java
- Star
- 21
- Fork
- 5
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 8
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của braintrustdata/braintrust-sdk-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Tất cả issue của braintrustdata/braintrust-sdk-java
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wso2/dpdp-accelerator#287 ·