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] Google GenAI Multimodal Live API sessions not instrumented

Đang mở
#120 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
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()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 turns
  • sendRealtimeInput(LiveSendRealtimeInputParameters) — streams real-time audio/video input
  • sendToolResponse(LiveSendToolResponseParameters) — responds to model tool calls
  • receive(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, not client.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: only request() and asyncRequest() are overridden; no WebSocket or Live API interception
  • braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustInstrumentation.java — wraps ApiClient into Client; no live client wrapping
  • braintrust-sdk/instrumentation/genai_1_18_0/src/test/java/dev/braintrust/instrumentation/genai/v1_18_0/BraintrustGenAITest.java — tests only sync/async generateContent; 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

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-java

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

Issue tương tự

Thêm issue về Java

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.