RTVI Client Web includes a LLM helper for typical LLM tasks and workflows.
Using the LLM helper
import { VoiceClient, LLMHelper } from "realtime-ai";const voiceClient = new VoiceClient({ // ... services: { llm: "openai", },});const llmHelper = new LLMHelper({ callbacks: { // ... },});voiceClient.registerHelper("llm", llmHelper);
Actions
All of the below are abstracted actions.As with all actions, they can be awaited or chained with .then().If the bot is unable to process the action, it will trigger the onMessageError callback and MessageError event.
getContext()
llm:get_contextRetrieve LLM context from bot. Returns Promise<LLMContext>