mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 14:04:41 -07:00
refactor(core): revert unique delimiter in web_fetch fallback
This commit is contained in:
@@ -374,11 +374,9 @@ class WebFetchToolInvocation extends BaseToolInvocation<
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const randomDelimiter = `---${Math.random().toString(36).substring(2, 15)}---`;
|
|
||||||
|
|
||||||
const aggregatedContent = results
|
const aggregatedContent = results
|
||||||
.map((content, i) => `URL: ${uniqueUrls[i]}\nContent:\n${content}`)
|
.map((content, i) => `URL: ${uniqueUrls[i]}\nContent:\n${content}`)
|
||||||
.join(`\n\n${randomDelimiter}\n\n`);
|
.join('\n\n---\n\n');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const geminiClient = this.config.getGeminiClient();
|
const geminiClient = this.config.getGeminiClient();
|
||||||
@@ -386,9 +384,9 @@ class WebFetchToolInvocation extends BaseToolInvocation<
|
|||||||
|
|
||||||
I was unable to access the URL(s) directly using the primary fetch tool. Instead, I have fetched the raw content of the page(s). Please use the following content to answer the request. Do not attempt to access the URL(s) again.
|
I was unable to access the URL(s) directly using the primary fetch tool. Instead, I have fetched the raw content of the page(s). Please use the following content to answer the request. Do not attempt to access the URL(s) again.
|
||||||
|
|
||||||
${randomDelimiter}
|
---
|
||||||
${aggregatedContent}
|
${aggregatedContent}
|
||||||
${randomDelimiter}
|
---
|
||||||
`;
|
`;
|
||||||
const result = await geminiClient.generateContent(
|
const result = await geminiClient.generateContent(
|
||||||
{ model: 'web-fetch-fallback' },
|
{ model: 'web-fetch-fallback' },
|
||||||
|
|||||||
Reference in New Issue
Block a user