Documentation Index
Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Chat hooks
Use chat hooks when you need state and runtime integration without the preset UI. The examples below assume your app has an AG-UI chat endpoint at/api/ag-ui. Use the route from Chat UI or Agents, then run veryfront dev and open the page that renders the hook.
Prerequisites
- A page that can render React client components.
- An AG-UI route mounted at
/api/ag-ui(or another path you pass viaapi). - For
useCompletion, an API route that returns plain text or SSE for thecompletecall.
useChat
useChat exposes messages, input state, submit handlers, stop/reload handlers, model state, branch helpers, and inference status. It uses AG-UI for Veryfront AG-UI routes created with createAgUiHandler.
useAgent
UseuseAgent for direct agent invocation without the chat protocol:
useCompletion
Inference mode
useChat exposes inferenceMode so your UI can show whether inference is running through cloud, server-local, or browser runtime.
Verify it worked
Render the hook in a page and exercise the surface you care about:useChat: submit a message.chat.messagesshould grow andisLoadingshould flip while the response streams.useAgent: callinvoke.statusshould move throughrunningtoidleandmessagesshould contain the agent’s reply.useCompletion: callcomplete.completionshould populate andisLoadingshould flip back tofalsewhen the response ends.
isLoading never flips back, check the network tab for the request to
your API and the dev-server log for handler errors.
Next
- Chat theming: customize chat features and visuals
- Workflows: orchestrate multi-step AI execution
Related
- Chat UI: preset component
- Chat composition: custom layouts
veryfront/chat: chat reference