diff --git a/content/examples/01-next-app/04-state-management/02-save-and-restore-states.mdx b/content/examples/01-next-app/04-state-management/02-save-and-restore-states.mdx index a1de12bc4cdf..ed6650de3af8 100644 --- a/content/examples/01-next-app/04-state-management/02-save-and-restore-states.mdx +++ b/content/examples/01-next-app/04-state-management/02-save-and-restore-states.mdx @@ -7,7 +7,7 @@ description: Learn to save and restore AI and UI states with onGetUIState and on Sometimes conversations with language models can get interesting and you might want to save the state of so you can revisit it or continue the conversation later. -`createAI` has an experimental callback function called `unstable_onSetAI` that gets called whenever the AI state changes. You can use this to save the AI state to a filename or a database. +`createAI` has an experimental callback function called `onSetAIState` that gets called whenever the AI state changes. You can use this to save the AI state to a filename or a database. ## Client @@ -177,14 +177,14 @@ export const AI = createAI({ actions: { continueConversation, }, - unstable_onSetAIState: async ({ state, done }) => { + onSetAIState: async ({ state, done }) => { 'use server'; if (done) { saveChat(state); } }, - unstable_onGetUIState: async () => { + onGetUIState: async () => { 'use server'; const history: ServerMessage[] = getAIState();