mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-15 12:10:16 +00:00
💄 style: Enable googleSearch Tool for gemini-2.0-flash-exp (#4997)
* Update index.ts * Update index.ts
This commit is contained in:
@@ -91,7 +91,12 @@ export class LobeGoogleAI implements LobeRuntimeAI {
|
||||
.generateContentStream({
|
||||
contents,
|
||||
systemInstruction: payload.system as string,
|
||||
tools: this.buildGoogleTools(payload.tools),
|
||||
tools: (() => {
|
||||
if (!payload.tools && model.startsWith('gemini-2.0')) {
|
||||
return [{ googleSearch: {} } as GoogleFunctionCallTool];
|
||||
}
|
||||
return this.buildGoogleTools(payload.tools);
|
||||
})(),
|
||||
});
|
||||
|
||||
const googleStream = convertIterableToStream(geminiStreamResult.stream);
|
||||
|
||||
Reference in New Issue
Block a user