Gemini googleSearch grounding tool is dropped when running prompts via invoke / OpenAI-compat proxy
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
まず、Gemini の googleSearch ツールを使って prompt invoke と /v1/proxy/chat/completions 経由で問題を再現し、次にそのリクエストをネイティブな braintrustproxy.com generateContent パスと比較します。これらのエントリーポイントで使用されているプロキシルーティングとリクエスト形式の検出を追跡します。Gemini リクエストに対してツールが転送され、サポートされている Braintrust フローを通じて groundingMetadata を生成できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
A Braintrust prompt configured with Gemini's search-grounding tool (tools: [{ "googleSearch": {} }]) does not perform grounding when the prompt is run through Braintrust (prompt invoke, experiments, or the /v1/proxy/chat/completions endpoint). The tool is silently dropped — the logged LLM span shows tools: null — so the model answers from training data only, and groundingMetadata is never produced.
This looks like the request-side root cause of braintrustdata/braintrust-sdk-javascript#1700 (grounding metadata not captured): grounding never actually runs via the OpenAI-compatible proxy path, so there is no metadata to capture.
Environment
braintrustJS SDK: 3.15.0- Model:
gemini-2.5-pro/gemini-2.5-flash - Prompt
prompt_data.tools:"[{\"googleSearch\":{}}]"
Reproduction
- Create a prompt for
gemini-2.5-prowhose tools array is the Gemini grounding tool[{ "googleSearch": {} }]. - Run it via the prompt
invokeAPI (or as an experiment task viainvoke()). - Inspect the logged LLM span.
Observed: span request metadata has tools: null; the model responds without searching; fields that require fresh web data come back empty. No groundingMetadata.
Direct proxy evidence
The OpenAI-compatible proxy rejects/drops the Gemini-native grounding tool:
# (A) googleSearch on the OpenAI-compat endpoint -> gateway error
curl https://api.braintrust.dev/v1/proxy/chat/completions \
-H "Authorization: Bearer $BT" -H "Content-Type: application/json" \
-d '{"model":"gemini-2.5-flash","messages":[{"role":"user","content":"latest news?"}],"tools":[{"googleSearch":{}}]}'
# -> "Braintrust gateway error: Unable to detect request source format"
# (B) {"type":"web_search"} -> same gateway error
# (C) a normal function tool (e.g. google_web_search) -> returned as finish_reason=tool_calls,
# never executed, so no grounding actually happens
The same grounding tool works through the native Google passthrough endpoint — but only on braintrustproxy.com, not api.braintrust.dev:
curl https://braintrustproxy.com/v1/proxy/google/models/gemini-2.5-flash:generateContent \
-H "Authorization: Bearer $BT" -H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"latest news?"}]}],"tools":[{"googleSearch":{}}]}'
# -> candidates[0].groundingMetadata present (webSearchQueries + groundingChunks)
For comparison, the same path on api.braintrust.dev returns HTTP 405 "Method POST not supported".
Expected
Running a prompt with the Gemini googleSearch grounding tool through Braintrust (invoke / experiments / playground) should forward it to Gemini so grounding actually runs — e.g. by routing gemini + googleSearch to the native generateContent request — instead of dropping the tool on the OpenAI-compatible path.
Workaround
Bypass invoke and call the native passthrough (https://braintrustproxy.com/v1/proxy/google/models/{model}:generateContent) with the native tools: [{ "googleSearch": {} }] body. Grounding runs and uses the Braintrust-configured Google key.
Related
- braintrustdata/braintrust-sdk-javascript#1700 — Google GenAI grounding metadata not captured (this issue is the request-side cause).
- 主要言語
- TypeScript
- スター
- 28
- フォーク
- 15
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
braintrustdata/braintrust-sdk-javascript のほかの issue
-
typescript
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
braintrustdata/braintrust-sdk-javascript#2578 ·
メンテナーはふだん 1 日以内に返信
-
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 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
braintrustdata/braintrust-sdk-javascript#2482 ·
メンテナーはふだん 1 日以内に返信
braintrustdata/braintrust-sdk-javascript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cameri/nostream#811 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug p3 triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug javascript P2-medium python release:v3.1
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
adrirubio/claude-deck#546 ·
メンテナーはふだん 1 日以内に返信
-
area: desktop area: website priority: P2 type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
appandflow/stim#3411 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rjsf-team/react-jsonschema-form#5485 ·
メンテナーはふだん 2 日以内に返信