useAssistantInstructions
useAssistantInstructions
is a React hook that allows you to set system instructions for your assistant-ui components.
Usage
API Reference
Parameters
The hook accepts either:
- A string containing the system instructions
- A configuration object with:
instruction
: The system instructionsdisabled
: Optional boolean to disable the instructions
Behavior
The hook will:
- Register the provided instructions as system instructions in the model context
- Automatically clean up when the component unmounts
- Update when the instructions change
- Do nothing if disabled is set to true