Skip to content

Commit

Permalink
Update 01-chatbot.mdx (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
elitan authored May 26, 2024
1 parent 2e2fd6b commit 48abfe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/docs/05-ai-sdk-ui/01-chatbot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ export default function Page() {
```

```ts filename='app/api/chat/route.ts'
import { streamText } from 'ai';
import { type CoreMessage, streamText } from 'ai';
import { openai } from '@ai-sdk/openai';

export async function POST(req: Request) {
const { prompt }: { prompt: string } = await req.json();
const { messages }: { messages: CoreMessage[] } = await req.json();

const result = await streamText({
model: openai('gpt-4'),
Expand Down

0 comments on commit 48abfe5

Please sign in to comment.