diff --git a/.env.example b/.env.example index 99207ca..6817851 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,11 @@ # Get your xAI API Key here for chat models: https://console.x.ai/ XAI_API_KEY=**** -# Get your OpenAI API Key here for chat models: https://platform.openai.com/account/api-keys -OPENAI_API_KEY=**** +# Get your Groq API Key here for reasoning models: https://console.groq.com/keys +GROQ_API_KEY=**** -# Get your Fireworks AI API Key here for reasoning models: https://fireworks.ai/account/api-keys -FIREWORKS_API_KEY=**** +# Get your Fal AI API Key here for image models: https://docs.fal.ai/authentication/key-based +FAL_API_KEY=**** # Generate a random secret: https://generate-secret.vercel.app/32 or `openssl rand -base64 32` AUTH_SECRET=**** diff --git a/.vscode/settings.json b/.vscode/settings.json index 8f96874..fb5a7ca 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,18 +1,17 @@ { - "editor.formatOnSave": true, - "[javascript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[typescript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "typescript.tsdk": "node_modules/typescript/lib", - "eslint.workingDirectories": [ - { "pattern": "app/*" }, - { "pattern": "packages/*" } - ] - } - \ No newline at end of file + "editor.formatOnSave": true, + "[javascript]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.workingDirectories": [ + { "pattern": "app/*" }, + { "pattern": "packages/*" } + ] +} diff --git a/README.md b/README.md index 6fdc36e..7d506fc 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ This template ships with [xAI](https://x.ai) `grok-2-1212` as the default chat m You can deploy your own version of the Next.js AI Chatbot to Vercel with one click: -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET,OPENAI_API_KEY,XAI_API_KEY,FIREWORKS_API_KEY&envDescription=Learn%20more%20about%20how%20to%20get%20the%20API%20Keys%20for%20the%20application&envLink=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot%2Fblob%2Fmain%2F.env.example&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel.&demo-url=https%3A%2F%2Fchat.vercel.ai&stores=[{%22type%22:%22postgres%22},{%22type%22:%22blob%22}]) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET&envDescription=Learn%20more%20about%20how%20to%20get%20the%20API%20Keys%20for%20the%20application&envLink=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot%2Fblob%2Fmain%2F.env.example&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel.&demo-url=https%3A%2F%2Fchat.vercel.ai&stores=[{%22type%22:%22postgres%22},{%22type%22:%22blob%22}]&integration-ids=oac_g1tOx3546WuLOQ4QeyAX1n1P,oac_G6x10PjgSxUUTu6Pi25ZAtbp,oac_GzhR3rwEIUyQEpKEsmAiEjfi) ## Running locally diff --git a/app/(chat)/api/chat/route.ts b/app/(chat)/api/chat/route.ts index 830ae2c..e574d7d 100644 --- a/app/(chat)/api/chat/route.ts +++ b/app/(chat)/api/chat/route.ts @@ -137,7 +137,7 @@ export async function POST(request: Request) { }, ], }); - } catch (error) { + } catch (_) { console.error('Failed to save chat'); } } diff --git a/components/multimodal-input.tsx b/components/multimodal-input.tsx index d47a7a8..19b2810 100644 --- a/components/multimodal-input.tsx +++ b/components/multimodal-input.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { Attachment, Message } from 'ai'; +import type { Attachment, Message, UIMessage } from 'ai'; import cx from 'classnames'; import type React from 'react'; import { @@ -22,7 +22,7 @@ import { Button } from './ui/button'; import { Textarea } from './ui/textarea'; import { SuggestedActions } from './suggested-actions'; import equal from 'fast-deep-equal'; -import { UseChatHelpers, UseChatOptions } from '@ai-sdk/react'; +import { UseChatHelpers } from '@ai-sdk/react'; function PureMultimodalInput({ chatId, @@ -45,8 +45,8 @@ function PureMultimodalInput({ stop: () => void; attachments: Array; setAttachments: Dispatch>>; - messages: Array; - setMessages: Dispatch>>; + messages: Array; + setMessages: UseChatHelpers['setMessages']; append: UseChatHelpers['append']; handleSubmit: UseChatHelpers['handleSubmit']; className?: string; @@ -308,7 +308,7 @@ function PureStopButton({ setMessages, }: { stop: () => void; - setMessages: Dispatch>>; + setMessages: UseChatHelpers['setMessages']; }) { return (