An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
refactor: update tool definitions for AI SDK v5 beta
Yoshiki Miura933451d14756
diff --git a/lib/tools/question.ts b/lib/tools/question.tsindex 1a6972a3..42b3ebc6 100644--- a/lib/tools/question.ts+++ b/lib/tools/question.ts@@ -9,7 +9,7 @@ export function createQuestionTool(fullModel: string) {return tool({description:'Ask a clarifying question with multiple options when more information is needed',- parameters: getQuestionSchemaForModel(fullModel)+ inputSchema: getQuestionSchemaForModel(fullModel)// execute function removed to enable frontend confirmation})}diff --git a/lib/tools/retrieve.ts b/lib/tools/retrieve.tsindex af1ca62f..7b8f96e7 100644--- a/lib/tools/retrieve.ts+++ b/lib/tools/retrieve.ts@@ -79,7 +79,7 @@ async function fetchTavilyExtractData(export const retrieveTool = tool({description: 'Retrieve content from the web',- parameters: retrieveSchema,+ inputSchema: retrieveSchema,execute: async ({ url }) => {let results: SearchResultsType | nulldiff --git a/lib/tools/search.ts b/lib/tools/search.tsindex 6869fc05..ca3efaf9 100644--- a/lib/tools/search.ts+++ b/lib/tools/search.ts@@ -16,7 +16,7 @@ import {export function createSearchTool(fullModel: string) {return tool({description: 'Search the web for information',- parameters: getSearchSchemaForModel(fullModel),+ inputSchema: getSearchSchemaForModel(fullModel),execute: async ({query,max_results = 20,diff --git a/lib/tools/video-search.ts b/lib/tools/video-search.tsindex ebe3255e..2b462fb5 100644--- a/lib/tools/video-search.ts+++ b/lib/tools/video-search.ts@@ -8,7 +8,7 @@ import { getSearchSchemaForModel } from '@/lib/schema/search'export function createVideoSearchTool(fullModel: string) {return tool({description: 'Search for videos from YouTube',- parameters: getSearchSchemaForModel(fullModel),+ inputSchema: getSearchSchemaForModel(fullModel),execute: async ({ query }) => {try {const response = await fetch('https://google.serper.dev/videos', {