Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[bot] Google GenAI Batch API (`ai.batches.create()`) not instrumented

未关闭
#2,343 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@lforst 已经在做这个了。

开始于 2026年8月20日。

  • #2389 来自 @lforst —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
observability

调研方向

从 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 内容生成。

描述

stale

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) for generateContent
  • ai.batches.create_embeddings(...) — submit a batch job for embeddings
  • ai.batches.get(name) — poll job status (JOB_STATE_SUCCEEDED, etc.)
  • ai.batches.list() — list batch jobs
  • ai.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

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 only generateContent/generateContentStream/embedContent; instance.batches untouched)
  • 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 batch under js/src — zero matches related to Google GenAI
主要语言
TypeScript
星标
29
派生
16
平均合并
1 天 20 小时
30 天内合并 PR
70

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

braintrustdata/braintrust-sdk-javascript 的其他 Issue

查看 braintrustdata/braintrust-sdk-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。