Model Context Registry

Register and manage assistant-ui model context providers that contribute instructions and app state.

API Reference

ModelContextRegistry

ModelContextRegistry
constructor?() => ModelContextRegistry

getModelContext?() => ModelContext

subscribe?(callback: () => void) => Unsubscribe

addTool?(tool: AssistantToolProps<TArgs, TResult>) => ModelContextRegistryToolHandle<TArgs, TResult>

addInstruction?(config: string | AssistantInstructionsConfig) => ModelContextRegistryInstructionHandle

addProvider?(provider: ModelContextProvider) => ModelContextRegistryProviderHandle