Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions lib/agents/tools/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down