The example-react demo integrates OpenAI’s chat completions with the Avaturn.Live SDK over the legacy text-echo flow. Users submit text inputs that either trigger an echo from the avatar or stream a GPT-4 response back through the avatar.Documentation Index
Fetch the complete documentation index at: https://docs.avaturn.live/llms.txt
Use this file to discover all available pages before exploring further.
Components
- OpenAI hook — manages the OpenAI client and streams responses.
- TokenPopup — modal for entering the OpenAI API token.
- SettingsForm — switches between Echo and OpenAI mode and captures API keys.
- Home — mounts the avatar video and the input form.
Flow
- The user picks a mode (Echo or OpenAI) and provides API keys via
SettingsForm. - The avatar is initialized with the Avaturn.Live SDK.
- On submit, text is either passed straight to
avatar.task(text)(echo) or streamed through OpenAI; each sentence chunk is pushed toavatar.task()as it arrives (see Streaming LLM output).