diff --git a/.env.local.example b/.env.local.example index e52eec0c..e116efa3 100644 --- a/.env.local.example +++ b/.env.local.example @@ -20,6 +20,10 @@ NEXT_PUBLIC_COMPOSIO_USER_ID=user@example.com # Gemini 3.1 Pro (Google Generative AI) GEMINI_3_PRO_API_KEY=your_gemini_3_pro_api_key_here +# Search API (https://tavily.com) +# If not set, the `search` tool is skipped and the LLM answers from its own knowledge. +TAVILY_API_KEY=your_tavily_api_key + # Supabase Credentials NEXT_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL_HERE NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY_HERE diff --git a/lib/agents/tools/index.tsx b/lib/agents/tools/index.tsx index 4c22b887..2491cf9c 100644 --- a/lib/agents/tools/index.tsx +++ b/lib/agents/tools/index.tsx @@ -14,10 +14,6 @@ export interface ToolProps { export const getTools = ({ uiStream, fullResponse, mapProvider }: ToolProps) => { const tools: any = { - search: searchTool({ - uiStream, - fullResponse - }), retrieve: retrieveTool({ uiStream, fullResponse @@ -28,6 +24,13 @@ export const getTools = ({ uiStream, fullResponse, mapProvider }: ToolProps) => }) } + if (process.env.TAVILY_API_KEY) { + tools.search = searchTool({ + uiStream, + fullResponse + }) + } + if (process.env.SERPER_API_KEY) { tools.videoSearch = videoSearchTool({ uiStream,