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 video generation (generateVideos / Veo) traced with materially less detail than text generation

Đang mở
#176 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
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
observability-sre

Hướng nghiên cứu

Bắt đầu với BraintrustApiClient.java, đặc biệt là tagSpan và bốn phần ghi đè transport, sau đó kiểm tra BraintrustGenAITest.java cùng các API generateVideos và getVideosOperation của Google GenAI. Thêm coverage tập trung cho việc tạo video và xác minh rằng chi tiết yêu cầu, việc phân loại span, các metric khả dụng và việc polling các operation chạy dài được thể hiện với độ trung thực như dự kiến.

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 (com.google.genai, v1.18.0, the version this module targets) exposes Models.generateVideos(...) (Veo video-generation models) and the associated long-running-operation polling API (client.operations.getVideosOperation(...)). Braintrust's Java GenAI instrumentation intercepts these calls only incidentally, through a generic HTTP-transport hook that was designed for generateContent. The result is spans that are silently mislabeled and largely empty for video generation — not a total absence of spans, but instrumentation with materially less detail/fidelity than the documented generate_content path.

What is missing

BraintrustApiClient (braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java) intercepts every HTTP call made by the SDK by overriding the transport-level methods on ApiClient:

  • request(String, String, String, Optional<HttpOptions>) — line 186
  • request(String, String, byte[], Optional<HttpOptions>) — line 210
  • asyncRequest(String, String, String, Optional<HttpOptions>) — line 239
  • asyncRequest(String, String, byte[], Optional<HttpOptions>) — line 277

Because this hook is transport-level, a generateVideos call (and each operations.getVideosOperation poll of the resulting long-running operation) does produce a span — but tagSpan (lines 50–161) was written exclusively for the generateContent request/response shape:

  • Line 156 unconditionally sets braintrust.span_attributes to {"type": "llm"} for every call this client makes, including video-generation calls, which are not LLM chat-completion calls.
  • Lines 65–76 and 81–95 only promote model/systemInstruction/tools/toolConfig/safetySettings/cachedContent and generationConfig.{temperature,topP,topK,candidateCount,maxOutputTokens,stopSequences,responseMimeType,responseSchema} into braintrust.metadata/input_json. generateVideos requests use an entirely different shape (instances/parameters or prompt/image/video + a GenerateVideosConfig with fields like numberOfVideos, durationSeconds, aspectRatio, enhancePrompt, personGeneration) — none of these fields are extracted, so input_json for a video-generation span is effectively empty.
  • Lines 127–149 only look for usageMetadata.{promptTokenCount,candidatesTokenCount,totalTokenCount,cachedContentTokenCount} to populate braintrust.metrics. Video-generation responses have no such field, so metrics are silently skipped (not wrong, just absent) while the span is still tagged type: llm.
  • generateVideos returns a GenerateVideosOperation that is not done immediately; the caller polls client.operations.getVideosOperation(...) repeatedly until completion. Each poll produces its own disconnected span (named via URL-derived getOperation, e.g. get_videos_operation) rather than being correlated to the originating video-generation request — there is no long-running-operation span model, unlike the single request/response span Braintrust produces for generate_content.

There is no reference anywhere in this module (or its tests) to generateVideos, GenerateVideosOperation, GenerateVideosConfig, Veo, or getVideosOperation — confirmed via full-directory grep of braintrust-sdk/instrumentation/genai_1_18_0/.

Braintrust docs status

Checked https://www.braintrust.dev/docs/integrations/ai-providers/gemini (current as of this audit):

  • Java section documents only content-generation spans (generate_content, sync/async) and generateContentStream, with request metadata (model, contents, generation config), response, and token metrics.
  • No mention of video generation, generateVideos, or Veo models for any language (Java, Python, TypeScript, Go).
  • Status: not_found — video generation tracing is undocumented for Java (and for every other language) in the current docs.

Upstream sources

Local files inspected

  • braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java — full file read; tagSpan (lines 50–161) and the four transport overrides (lines 186, 210, 239, 277) are the only interception points, and are generateContent-shaped.
  • braintrust-sdk/instrumentation/genai_1_18_0/src/test/java/dev/braintrust/instrumentation/genai/v1_18_0/BraintrustGenAITest.java — only tests sync generateContent; no video-generation test coverage.
  • Full-directory grep of braintrust-sdk/instrumentation/genai_1_18_0/ for generateImages|GenerateImages|predictLongRunning|generate_videos|video — zero matches.
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.