AI SDK RSCgetMutableAIState
getMutableAIState
Get a mutable copy of the AI state. You can use this to update the state in the server.
Import
import { getMutableAIState } from "ai/rsc"
Arguments
key?:
Returns the value of the specified key in the AI state, if it's an object.
Returns
The mutable AI state.
Methods
update:
Updates the AI state with the new state.
done:
Updates the AI state with the new state, marks it as finalized and closes the stream.