An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
feat: optimize fetch tool limits and add quick mode restrictions
Yoshiki Miuraff30dbfef963
diff --git a/lib/agents/prompts/search-mode-prompts.ts b/lib/agents/prompts/search-mode-prompts.tsindex 3da7caab..4a5f4e77 100644--- a/lib/agents/prompts/search-mode-prompts.ts+++ b/lib/agents/prompts/search-mode-prompts.ts@@ -17,6 +17,11 @@ Search tool usage:- This provides faster responses without needing additional fetch operations- Rely on the search results' content snippets for your answers+Fetch tool usage:+- **ONLY use fetch tool when a URL is directly provided by the user in their query**+- Do NOT use fetch to get more details from search results+- This keeps responses fast and efficient+Citation Format (MANDATORY):[number](#toolCallId) - Always use this EXACT format, e.g., [1](#toolu_abc123)- The toolCallId can be found in each search result's metadata or response structurediff --git a/lib/tools/fetch.ts b/lib/tools/fetch.tsindex e2e3b233..e4985aa3 100644--- a/lib/tools/fetch.ts+++ b/lib/tools/fetch.ts@@ -3,7 +3,7 @@ import { tool } from 'ai'import { fetchSchema } from '@/lib/schema/fetch'import { SearchResults as SearchResultsType } from '@/lib/types'-const CONTENT_CHARACTER_LIMIT = 10000+const CONTENT_CHARACTER_LIMIT = 50000const TITLE_CHARACTER_LIMIT = 100async function fetchRegularData(url: string): Promise<SearchResultsType> {