Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
sxjeru committed Dec 12, 2024
1 parent b1af766 commit a43bbd4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libs/agent-runtime/google/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ export class LobeGoogleAI implements LobeRuntimeAI {
.generateContentStream({
contents,
systemInstruction: payload.system as string,
tools: this.buildGoogleTools(payload.tools),
tools: (() => {
const processedTools = this.buildGoogleTools(payload.tools);
if (model.startsWith('gemini-2.0')) {
return [...(processedTools || []), { googleSearch: {} }];
}
return processedTools;
})(),
});

const googleStream = convertIterableToStream(geminiStreamResult.stream);
Expand Down

0 comments on commit a43bbd4

Please sign in to comment.