[bot] Google GenAI Batch API (`ai.batches.create()`) not instrumented
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 js/src/instrumentation/plugins/google-genai-channels.ts 中现有的四个 channel 入手,跟踪它们在 js/src/wrappers/google-genai.ts 和 google-genai-plugin.ts 中是如何被封装和处理的。然后检查 vendored types、auto-instrumentation 配置以及现有的 e2e 场景。当这些区域都表示了批量操作,并且为最终的 instrumentation 提供了 e2e 覆盖时,即可视为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
The @google/genai SDK's Batch API (ai.batches.create() / client.batches.*) is a documented, GA generative-execution surface for asynchronous, high-throughput generateContent (and embeddings) processing at a 50% cost discount. It is not instrumented anywhere in this repository — no wrapper support, no channel definitions, no plugin, no auto-instrumentation config entry, and no e2e coverage.
What instrumentation is missing
Channels (js/src/instrumentation/plugins/google-genai-channels.ts)
googleGenAIChannels (lines 20–57) defines only four channels: generateContent, generateContentStream, embedContent, and interactionsCreate. There is no batches-related channel.
Wrapper (js/src/wrappers/google-genai.ts)
wrapModels() (lines 118–133) proxies only generateContent, generateContentStream, and embedContent on instance.models. The instance.batches namespace (ai.batches.create(), .get(), .list(), .cancel()) is not proxied at all and passes through completely untraced.
Plugin (js/src/instrumentation/plugins/google-genai-plugin.ts)
Only subscribes to the four existing channels above — no batch handler exists.
Vendored types (js/src/vendor-sdk-types/google-genai.ts)
No type exists for the batches namespace or its request/response/job-status shapes.
Auto-instrumentation config (js/src/auto-instrumentations/configs/google-genai.ts)
No batch-related entry.
e2e coverage (e2e/scenarios/google-genai-instrumentation/)
No batch-related scenario, cassette, or span-tree snapshot among the existing google-genai-v1/v2 (pinned + latest) scenarios.
Upstream operations not instrumented
ai.batches.create({ model, src, config })— submit a batch job (file-based or inline requests) forgenerateContentai.batches.create_embeddings(...)— submit a batch job for embeddingsai.batches.get(name)— poll job status (JOB_STATE_SUCCEEDED, etc.)ai.batches.list()— list batch jobsai.batches.cancel(name)— cancel a batch job
Braintrust docs status
not_found. The Braintrust Gemini integration guide (https://www.braintrust.dev/docs/integrations/ai-providers/gemini) documents generateContent/generateContentStream, embedContent, grounding metadata, generate_images (Python only), and interactions/Live API (Python only) — but does not mention batch processing anywhere.
Upstream references
- Gemini API Batch Mode guide: https://ai.google.dev/gemini-api/docs/batch-mode
- Gemini API Batch API reference: https://ai.google.dev/gemini-api/docs/batch-api
@google/genainpm package: https://www.npmjs.com/package/@google/genai- SDK source: https://github.com/googleapis/js-genai
Braintrust docs sources checked
Local files inspected
js/src/instrumentation/plugins/google-genai-channels.ts(full file — only 4 channels defined, no batches)js/src/instrumentation/plugins/google-genai-plugin.ts(subscribes only to the 4 existing channels)js/src/wrappers/google-genai.ts(full file —wrapModels()proxies onlygenerateContent/generateContentStream/embedContent;instance.batchesuntouched)js/src/vendor-sdk-types/google-genai.ts(no batches type)js/src/auto-instrumentations/configs/google-genai.ts(no batches entry)e2e/scenarios/google-genai-instrumentation/(full directory listing — no batch scenario/cassette/snapshot)- Repo-wide case-insensitive grep for
batchunderjs/src— zero matches related to Google GenAI
- 主要语言
- TypeScript
- 星标
- 29
- 派生
- 16
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 70
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
braintrustdata/braintrust-sdk-javascript 的其他 Issue
-
High TypeScript checking cost from generated Zod 3 schemas可能已有人在做 @lforst 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 22/100
braintrustdata/braintrust-sdk-javascript#2624 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
typescript
难度 4/5 3-5 天 新手友好度 55/100
braintrustdata/braintrust-sdk-javascript#2578 ·
维护者通常 1 天内回复
-
[bot] Instrument Letta Agent SDK (87,205 weekly downloads)可能已有人在做 @karthiksenv 于 3 天前认领。 未关闭typescript
难度 4/5 3-5 天 新手友好度 55/100
braintrustdata/braintrust-sdk-javascript#2577 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
braintrustdata/braintrust-sdk-javascript#2527 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 65/100
braintrustdata/braintrust-sdk-javascript#2526 ·
维护者通常 1 天内回复
查看 braintrustdata/braintrust-sdk-javascript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#639 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
aws/agentcore-cli#2606 ·
维护者通常 1 天内回复
-
ai-driven-qa bug Cosmetic
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
ai-driven-qa bug claude Minor
难度 2/5 1-3 小时 新手友好度 64/100
linagora/twake-mail-admin#301 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复