Skip to content

Commit

Permalink
fix (docs): remove duplicate code in useAssistant example (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelKonie99 committed Jun 26, 2024
1 parent 827ef45 commit ef7bc10
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ export function Message({ textStream }: { textStream: StreamableValue }) {
}
```

```tsx filename='app/message.tsx'
'use client';

import { StreamableValue, useStreamableValue } from 'ai/rsc';

export function Message({ textStream }: { textStream: StreamableValue }) {
const [text] = useStreamableValue(textStream);

return <div>{text}</div>;
}
```

## Server

In your server action, you will create a function called `submitMessage` that adds the user's message to the thread. The function will create a new thread if one does not exist and add the user's message to the thread. If a thread already exists, the function will add the user's message to the existing thread. The function will then create a run and stream the assistant's response to the client. Furthermore, the run queue is used to manage multiple runs in the same thread during the lifetime of the server action.
Expand Down

0 comments on commit ef7bc10

Please sign in to comment.