Skip to content

Commit

Permalink
Deprecate <Tokens /> (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel authored Apr 9, 2024
1 parent a6b2500 commit 149fe26
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-cherries-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ai': patch
---

Deprecate <Tokens/>
8 changes: 8 additions & 0 deletions docs/pages/docs/api-reference/tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ layout:
The Tokens component is a React Server Component for streaming in tokens in a React Component.
You can view a live demo with Next.js [here](https://rsc-llm-on-the-edge.vercel.app)

<Callout>
<strong>
This API has been deprecated and will be removed in a future release. See
[Generative UI](/docs/concepts/ai-rsc) for the recommended approach to
streaming React UI.
</strong>
</Callout>

## Props

```typescript
Expand Down
6 changes: 4 additions & 2 deletions packages/core/react/tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ type Props = {
};

/**
* A React Server Component that recursively renders a stream of tokens.
* Can only be used inside of server components.
A React Server Component that recursively renders a stream of tokens.
Can only be used inside of server components.
@deprecated Use RSCs / Generative AI instead.
*/
export async function Tokens(props: Props) {
const { stream } = props;
Expand Down

0 comments on commit 149fe26

Please sign in to comment.