Feat: Add url_context tool to Google :online

Co-authored-by: gemini-3.6-flash <noreply@google.com>
This commit is contained in:
2026-07-21 19:24:24 -07:00
parent 8fe94b2b58
commit 25dc642db8

View File

@@ -233,7 +233,7 @@ export async function streamGoogle({ apiKey, body, signal, onDelta, isRunning })
const payload = { const payload = {
contents: mapToGoogleContents(body.messages), contents: mapToGoogleContents(body.messages),
...(Object.keys(generationConfig).length && { generationConfig }), ...(Object.keys(generationConfig).length && { generationConfig }),
...((body.model ?? '').endsWith(':online') && { tools: [{ google_search: {} }] }), ...((body.model ?? '').endsWith(':online') && { tools: [{ google_search: {} }, { url_context: {} }] }),
} }
const resp = await fetch( const resp = await fetch(