Custom REST API
Overview
assistant-ui
integrates with any custom REST API. To do so, you define a custom ChatModelAdapter
and pass it to the useLocalRuntime
hook.
Getting Started
Define a MyRuntimeProvider
component
Update the MyModelAdapter
below to integrate with your own custom API.
Streaming
Declare the run
function as an AsyncGenerator
(async *run
). This allows you to yield
the results as they are generated.