本页还没有译文
本页 8 段还没译成简体中文,下面显示的是英文原文。useAIState
还没翻译译自英文(ai-sdk.dev)本页 8 段都还没译
Warning
AI SDK RSC is currently experimental. We recommend using AI SDK UI for production. For guidance on migrating from RSC to UI, see our migration guide.
It is a hook that enables you to read and update the AI state. The AI state is shared globally between all useAIState hooks under the same <AI/> provider.
The AI state is intended to contain context and information shared with the AI model, such as system messages, function responses, and other relevant data.
Import
import { useAIState } from "@ai-sdk/rsc"API Signature
Returns
Similar to useState, it is an array where the first element is the current AI state and the second element is a function to update the state.
AI 翻译查看英文原文