Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bot] Google GenAI Multimodal Live API sessions not instrumented

Open
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java

Research direction

Start with braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java and BraintrustInstrumentation.java, then inspect the Google GenAI client.aio.live.connect() and AsyncSession entry points. Compare the existing request instrumentation with the WebSocket-based Live API, and use BraintrustGenAITest.java as the test starting point. Done means Live API sessions and their relevant interactions produce instrumentation coverage without breaking existing generateContent tests.

Written by the indexing model from the issue text.

Description

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
Dominant language
Java
Stars
21
Forks
5
Avg merge
2d 7h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from braintrustdata/braintrust-sdk-java

All issues in braintrustdata/braintrust-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.