Documentation Index
Fetch the complete documentation index at: https://docs.xpertai.cn/llms.txt
Use this file to discover all available pages before exploring further.
Show a draggable animated ChatKit Pet in the host page viewport.
Enable Pet
By default, ChatKit shows the chat iframe and does not show Pet. You can enable it either from configuration or from the ChatKit UI with/pet or the global settings panel.
pet: true uses the default included Pet with bottom-right placement, dragging, and persisted position.
Pet Launcher Mode
UsedisplayMode: 'pet' when the page should initially show only Pet. The ChatKit iframe opens when the user clicks Pet.
Included Pets
ChatKit ships file-backed Pet presets with the ChatKit UI static assets. Current included characters are:- Batmeme
- Boba
- Bolt
- Einstein
- Lando
- Mini Sama
- Miso
- Noir Webling
- Nukey
- Steve
frameUrl, so /pets/... should be served by the ChatKit UI static asset host, not necessarily by the host page.
Custom Pet Images
Pet animation uses a spritesheet atlas. The default atlas contract is:- 8 columns x 9 rows
- 192 x 208 pixels per cell
- one animation state per row
| State | Purpose |
|---|---|
idle | Resting |
running-right | Dragging right |
running-left | Dragging left |
waving | Click or first appearance greeting |
jumping | Short success animation after a run completes |
failed | Conversation error |
waiting | Initialization, thread loading, or waiting for a client secret |
running | Request is running |
review | Assistant response is streaming |
Position, Dragging, and Scale
Pet position and dragging are relative to the host page viewport, not the iframe viewport. The chat panel stays in its host layout position while Pet moves.scale: 1 is not the raw 192 x 208 spritesheet cell size. Start around 0.25 to 0.5 for most pages.
The default boundsPadding is 0, so Pet stops at the viewport edges. If your page has a fixed footer or floating action area, add padding only for the affected edge.
While the user drags Pet, ChatKit switches animation based on horizontal drag direction: running-right or running-left. After the pointer leaves and dragging stops, Pet waits briefly before reducing its animation refresh rate.
Conversation Bubble
When the active conversation has assistant output or an error, Pet shows a compact conversation bubble:- title: current thread title, with the latest user message as fallback
- message: latest assistant message, or the error message when the conversation fails
- status: running, completed, or failed
- hide the current bubble
- expand or collapse message text
- reply quickly to the current conversation
1.
Reply input sends on Enter and exits on Esc. Sending a reply calls ChatKit sendUserMessage.
Local Settings and Commands
Users can adjust Pet from the global settings panel. These settings are stored in browser localStorage. The/pet command is also available:
/pet toggles Pet, and /pet settings opens the global settings panel at the Pet section.
Localization
Pet settings and bubble actions followChatKitOptions.locale. English and Simplified Chinese copy is currently included. If locale is not configured, ChatKit falls back to browser language or the local ChatKit language setting.