Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use ai/rsc #253

Merged
merged 22 commits into from
Mar 14, 2024
Merged

Refactor to use ai/rsc #253

merged 22 commits into from
Mar 14, 2024

Conversation

jeremyphilemon
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Mar 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-chatbot-rces ✅ Ready (Inspect) Visit Preview 8 resolved Mar 14, 2024 4:56pm
oss-ai-chatbot ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 14, 2024 4:56pm

app/actions.ts Outdated Show resolved Hide resolved
@Godrules500
Copy link

Out of curiosity, what all was changed? Trying to decide if it's worth merging these changes into my clone of this repo!

@MaxLeiter MaxLeiter deleted the jrmy/rsc branch March 15, 2024 17:32
@MaxLeiter
Copy link
Member

@Godrules500 we've migrated to using the new RSC + Server Action based API released in 3.0!

https://vercel.com/blog/ai-sdk-3-generative-ui

display:
message.role === 'function' ? (
message.name === 'listStocks' ? (
<BotCard>
Copy link

@li2109 li2109 Mar 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to me that only AI state is being updated for the whole project and UI state is converted from AI state via getUIStateFromAIState

Wondering what rationale is behind and design choices.

This makes me think about the pros and cons of maintaining "UIState and AIState" VS just "AIState" alone.
more specifically, why would we want an explicit UIState? instead of AIState with a bunch of function calls and their corresponding rendering methods (automatically convert it to UIState?).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@li2109 The AI state must be serializable as it is shared between the server and client. The UI state is only on the client, and can contain functions and react nodes.

chrissiwaffler added a commit to chrissiwaffler/ai-chatbot that referenced this pull request Apr 9, 2024
@@ -0,0 +1,509 @@
import 'server-only'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I ask you to explain why both 'import server-only' and 'use server' are used? It seems that both have similar effects, yet 'use server' offers the flexibility to be applied per function rather than per module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mattwoodco pushed a commit to mweser/ai-chatbot that referenced this pull request Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants