Have your avatar perform a custom action from a prompt or a video clip.
Overview
Roleplay actions let your avatar break out of standard talking gestures to perform a specific action mid-call—like celebrating, dancing, or sipping a drink—before seamlessly resuming the conversation. Actions are triggered either from a text prompt or from a pre-registered video clip.There are two ways to ask for one:
On demand: a text description of what the avatar should do. We generate the action from the avatar’s current look.
Registered: a video clip you register when the session starts, then trigger by name.
On demand
Registered
Best for
Open-ended actions where the user can ask the avatar to do anything in real time.
A specific, curated action. Great when your UI offers a set of action buttons for the user to pick from.
Latency
Slower: takes a few seconds to generate before the action can start.
Starts within a few hundred milliseconds.
Predictability
Generated from the prompt, so results are more dynamic and less predictable.
Exact: always matches your video clip.
Setup
None: prompts are sent on the fly during the call.
You create the clips ahead of time and register them at session start. See clip requirements.
Roleplay actions are available on LiveKit only.
On-demand actions
Publish a data message on the LiveKit topic ls.roleplay-action with a prompt.
Only one roleplay action runs at a time. Any roleplay action you send while one is in progress is ignored until that action is over.
{ "prompt": "The person picks up a cup of coffee, sips it, and puts the cup back down", "duration": 5,}
Field
Required
Default
What it does
prompt
yes
—
What the avatar should do, up to 1000 characters. The action is generated from the avatar’s current look.
duration
no
5
Length in seconds, between 1.5 and 15.
generate_audio
no
false
true generates a soundtrack for the action. false makes it silent.
end_frame
no
None
An https:// URL, or a base64 image, of the look the avatar should end on. That image becomes the avatar’s look after the action. Without it, the avatar returns to the look it had when you sent the prompt. Prefer a URL; inline images must stay small enough to fit in a data message. See changing the avatar’s look.
An on-demand action takes a few seconds to generate. If the avatar is talking when it is ready, it waits until the avatar finishes, then starts.
When you send the request, have the avatar acknowledge it and keep talking while the action generates, for example “Sure, I can dance for you. I have been taking dancing lessons for this exact purpose.” After the action plays, have the avatar speak again and refer to what it just did, for example “I hope you liked my dance!” You can queue the response audio while the action is playing.
const payload = new TextEncoder().encode( JSON.stringify({ prompt: "The person picks up a cup of coffee, sips it, and puts the cup back down", duration: 5, }));await room.localParticipant.publishData(payload, { topic: "ls.roleplay-action", reliable: true,});
Pass your video clips as roleplay_actions when creating the AvatarSession. You can register up to 100 actions. Each key is the name you will use to trigger the action, and each value is an object with video_url and an optional new_image_url.
LemonSlice publishes roleplay_status events as JSON data messages on the LiveKit topic lemonslice. Use them to follow an action from request to finish.
prompt: the text you sent. action: an id for this action, such as prompt_a1b2c3d4. Later events for this action use the same id.
started
The action is accepted. It has started, or it is waiting for the avatar to finish talking.
Both
action: the name you registered, or the on-demand id from ready.
failed
The action will not play: it could not be generated, could not start, or another action is in progress.
Both
error: why it will not play. action: the registered name, or the on-demand id once one exists.
done
The action has finished. The avatar is back in conversation, and you can send the next roleplay action.
Both
action: the name you registered, or the on-demand id from ready.
Avatar Lifecycle during a Roleplay Action
Accepted. If the avatar is talking, the action waits until it finishes what it’s saying, then starts. For a registered action, set interrupt: true to skip the wait: the avatar stops talking and performs the action right away.
Performed. The avatar performs the action. If your agent responds during the action, the response is held until the action ends. Only the latest response is kept.
Done. When the action ends, the avatar speaks the held response, if there is one, and you can send the next roleplay action.
Changing the avatar’s look
A roleplay action can also change the avatar’s look, like walking into the garden or putting on a hat. Give us an image of the new look, and the avatar keeps that look after the action ends.
On demand: set end_frame to the new image. The action is generated to end on it.
Registered: set new_image_url to the new image, next to video_url. Your clip should end on that image.
If you leave these out, the avatar goes back to the look it had before the action.
Example: from the house to the garden
Say your avatar starts in a living room, and you want it to walk outside and keep talking from the garden. You need an image of the avatar standing in the garden, such as garden.jpg.On demand, describe the move and end on the garden image:
{ "prompt": "The person stands up, walks out the back door, and stops in the garden facing the camera", "duration": 10, "end_frame": "https://example.com/images/garden.jpg"}
Registered, use a clip of the avatar walking from the living room into the garden, and set the garden image as new_image_url:
Then trigger it with { "action": "to_garden" }. Either way, once the action ends, the avatar keeps talking from the garden for the rest of the session, until another action changes its look.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"LemonSlice","colors":{"primary":"#FF7819","light":"#FF9038","dark":"#FF7819"},"logo":{"light":"https://mintcdn.com/lemonslice/lgypzRYz7QfG2Mni/logo/light.png?fit=max\u0026auto=format\u0026n=lgypzRYz7QfG2Mni\u0026q=85\u0026s=1df3909ae480f4d50edb89d7eee724bf","dark":"https://mintcdn.com/lemonslice/lgypzRYz7QfG2Mni/logo/dark.png?fit=max\u0026auto=format\u0026n=lgypzRYz7QfG2Mni\u0026q=85\u0026s=3bcc684bdc17eaf258d3e358d0158061","href":"https://lemonslice.com"},"favicon":"https://mintcdn.com/lemonslice/cAJz2endTE7_5brM/favicon.ico?fit=max\u0026auto=format\u0026n=cAJz2endTE7_5brM\u0026q=85\u0026s=634dbbddf9aead83bfcaef4b7d3b7059","background":{"color":{"light":"#FFFFFF","dark":"#000000"}},"navbar":{"links":[],"primary":{"type":"button","label":"Get started","href":"https://lemonslice.com"}},"footer":{"socials":{"x":"https://x.com/LemonSliceAI"}},"contextual":{"options":["copy"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lemonslice","hasAudioNarration":false,"actualSubdomain":"lemonslice","customDomains":["lemonslice.com"],"gitSource":{"type":"github","owner":"lemonsliceai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10c9569ffae5051c4083fe"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b1445f73921ecc2da168bde","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Reference","count":25},{"language":"default","tag":"More","count":16},{"language":"default","tag":"Endpoints","count":14},{"language":"default","tag":"Examples","count":12},{"language":"default","tag":"Widget","count":9},{"language":"default","tag":"Hosted","count":7},{"language":"default","tag":"Advanced","count":7},{"language":"default","tag":"Integrations","count":5},{"language":"default","tag":"Using the widget","count":5},{"language":"default","tag":"Embedding guides","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@lemonslice.com"}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src*=\"/images/integrations/livekit.svg\"],.dark img[src*=\"/images/integrations/pipecat.svg\"],.dark img[src*=\"/images/integrations/websocket.svg\"]{filter:invert(1)}.playground-demo-link{position:relative;display:block;cursor:pointer;text-decoration:none;color:inherit}.playground-demo-link video,.hero-video{display:block;width:100%;aspect-ratio:4 / 3;object-fit:cover}.demo-video-frame{display:flex;justify-content:center;align-items:center;width:100%;padding:0!important;overflow:hidden;border:1px solid rgba(128, 128, 128, 0.28);border-radius:0.75rem;box-sizing:border-box;line-height:0}.demo-video-frame .demo-video-landscape{display:block;width:14rem;max-width:100%;height:auto;margin:0!important;padding:0!important}.demo-video-caption{margin-top:0.5rem;font-size:0.875rem;text-align:center;opacity:0.75}.playground-demo-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0, 0, 0, 0.3);transition:background 0.15s ease}.playground-demo-link:hover .playground-demo-overlay{background:rgba(0, 0, 0, 0.45)}.playground-demo-label{padding:0.35rem 0.8rem;border-radius:9999px;background:#fff;color:#111;font-size:0.875rem;font-weight:500}.capability-pair-frame{width:fit-content!important;max-width:100%!important;margin-left:auto!important;margin-right:auto!important}.capability-pair{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:1rem;flex-wrap:nowrap}.capability-clip{display:block;width:11rem;max-width:11rem;max-height:17rem;border-radius:0.75rem;object-fit:cover;aspect-ratio:2/3}.lite-demo-grid{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:0.75rem;max-width:52rem;margin:0 auto}@media (max-width: 768px){.lite-demo-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}}.lite-demo-card{position:relative;overflow:hidden;border-radius:1.15rem;cursor:pointer;aspect-ratio:2 / 3;background:transparent;pointer-events:auto}.lite-demo-card>*{pointer-events:none}.lite-demo-clip{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;z-index:0;border-radius:1.15rem}.lite-demo-poster{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;z-index:1;border-radius:1.15rem}.lite-demo-card[data-playing=\"true\"] .lite-demo-poster,.lite-demo-card[data-playing=\"true\"] .lite-demo-badge-wrap,.lite-demo-card[data-playing=\"true\"] .lite-demo-hover{display:none}.lite-demo-badge-wrap{position:absolute;top:0.65rem;left:0;right:0;z-index:2;display:flex;justify-content:center;padding:0 0.55rem}.lite-demo-badge{display:inline-flex!important;align-items:center!important;gap:0.35rem!important;max-width:100%!important;width:auto!important;padding:0.32rem 0.75rem!important;border-radius:9999px!important;background:rgba(0, 0, 0, 0.55)!important;color:#fff!important;font-size:0.72rem!important;font-weight:600!important;letter-spacing:0.01em!important;line-height:1.3!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;text-align:center!important}.lite-demo-badge-icon{width:0.7rem;height:0.7rem;flex-shrink:0}.lite-demo-hover{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:2.5rem 0.85rem 0.85rem;background:linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);border-radius:0 0 1.15rem 1.15rem}.lite-demo-kicker{color:rgba(255, 255, 255, 0.72);font-size:0.62rem;font-weight:600;letter-spacing:0.08em;text-transform:uppercase;margin-bottom:0.25rem}.lite-demo-scenario{color:#fff;font-size:0.82rem;font-weight:500;line-height:1.35}.meeting-platforms{margin:1.25rem 0 1.5rem;padding:1rem 1.15rem;border:1px solid rgba(128, 128, 128, 0.28);border-radius:0.75rem;pointer-events:none;user-select:none}.meeting-platforms-label{margin-bottom:0.75rem;font-size:0.75rem;font-weight:600;letter-spacing:0.04em;text-transform:uppercase;opacity:0.65}.meeting-logos{display:flex;flex-wrap:wrap;align-items:center;gap:1rem 1.75rem}.meeting-logos a{pointer-events:none;cursor:default;text-decoration:none}.meeting-logo{display:flex;align-items:center;gap:0.5rem;font-size:0.95rem;font-weight:500}.meeting-logos>img,.meeting-logo img{display:block;width:2rem;height:2rem;flex-shrink:0;border-radius:0.4rem}.av-carousel{margin:1.15rem 0 1.65rem;border-radius:0.5rem}.av-carousel-layout{display:flex;align-items:flex-start;justify-content:center;gap:0.7rem}.av-carousel-originals{display:flex;flex-direction:column;flex-shrink:0;gap:0.4rem;width:5.35rem;height:calc(17rem * 3 / 2)}.av-carousel-original{flex:1 1 0;min-height:0;padding:0;overflow:hidden;border:2px solid transparent;border-radius:0.5rem;background:transparent;opacity:0.5;cursor:pointer}.av-carousel-original img{display:block;width:100%;height:100%;object-fit:cover}.av-carousel-original[aria-pressed=\"true\"]{border-color:#ff7819;opacity:1}.av-carousel-main{width:17rem;max-width:calc(100% - 6.2rem)}.av-carousel-stage-wrap{position:relative}.av-carousel-image{display:block;width:100%;aspect-ratio:2 / 3;object-fit:cover;border:1px solid rgba(128, 128, 128, 0.28);border-radius:0.85rem}.av-carousel-label{position:absolute;left:50%;bottom:0.7rem;transform:translateX(-50%);padding:0.28rem 0.7rem;border-radius:9999px;background:rgba(0, 0, 0, 0.58);color:#fff;font-size:0.72rem;font-weight:600;letter-spacing:0.01em;pointer-events:none}.av-carousel-nav{position:absolute;top:50%;z-index:1;display:flex;align-items:center;justify-content:center;width:1.85rem;height:1.85rem;padding:0;border:0;border-radius:9999px;background:rgba(255, 255, 255, 0.94);box-shadow:0 4px 14px rgba(0, 0, 0, 0.16);color:#111;cursor:pointer;transform:translateY(-50%)}.av-carousel-nav--prev{left:0.55rem}.av-carousel-nav--next{right:0.55rem}.av-carousel-nav svg{width:0.85rem;height:0.85rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.dark .av-carousel-nav{background:rgba(24, 24, 24, 0.92);color:#fff}.av-carousel-thumbs{display:flex;justify-content:center;flex-wrap:wrap;gap:0.4rem;margin-top:0.75rem}.av-carousel-thumb{width:2.85rem;padding:0;overflow:hidden;border:2px solid transparent;border-radius:0.45rem;background:transparent;opacity:0.48;cursor:pointer}.av-carousel-thumb img{display:block;width:100%;aspect-ratio:2 / 3;object-fit:cover}.av-carousel-thumb[aria-current=\"true\"]{border-color:#ff7819;opacity:1}.av-carousel:focus-visible,.av-carousel-original:focus-visible,.av-carousel-nav:focus-visible,.av-carousel-thumb:focus-visible{outline:2px solid #ff7819;outline-offset:2px}.cwm-1-hero{display:block;width:100%;height:auto;margin:1.5rem 0 0.25rem}.cwm-action-name{display:inline-flex;align-items:center;gap:0.35rem}.cwm-actions th:nth-child(3),.cwm-actions td:nth-child(3){text-align:center}button.cwm-action-eye,button.cwm-action-close{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;box-shadow:none;cursor:pointer;line-height:0}button.cwm-action-eye{width:1.5rem;height:1.5rem;border-radius:0.375rem;opacity:0.72;flex:none}button.cwm-action-eye svg,button.cwm-action-close svg{width:1rem;height:1rem}button.cwm-action-eye:hover,button.cwm-action-eye:focus-visible{opacity:1;background:rgba(128, 128, 128, 0.16)}button.cwm-action-eye:focus-visible,button.cwm-action-close:focus-visible{outline:2px solid #ff7819;outline-offset:2px}.cwm-action-modal{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;padding:1.25rem;background:rgba(0, 0, 0, 0.72)}.cwm-action-dialog:focus{outline:none}.cwm-action-dialog{width:min(20rem, 100%);overflow:hidden;border-radius:0.75rem;background:#111;color:#fff;box-shadow:0 16px 50px rgba(0, 0, 0, 0.45)}.cwm-action-dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.55rem 0.65rem 0.55rem 0.9rem}.cwm-action-dialog-bar code{color:#fff;background:transparent;padding:0;font-size:0.8125rem}button.cwm-action-close{width:1.75rem;height:1.75rem;border-radius:0.375rem;color:#fff;flex:none}button.cwm-action-close:hover{background:rgba(255, 255, 255, 0.12)}.cwm-action-dialog video{display:block;width:100%;aspect-ratio:2 / 3;object-fit:cover;background:#000}@media (max-width: 520px){.av-carousel-layout{flex-direction:column;align-items:center}.av-carousel-originals{flex-direction:row;width:17rem;max-width:100%;height:auto}.av-carousel-original{aspect-ratio:2 / 3}.av-carousel-main{width:17rem;max-width:100%}}.method-pill{display:inline-block;padding:0.05rem 0.5rem;border-radius:9999px;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:0.75rem;font-weight:700;line-height:1.25rem;letter-spacing:0.02em}.method-pill[data-method=\"GET\"]{background:rgb(34 197 94 / 0.12);color:rgb(21 128 61)}.method-pill[data-method=\"POST\"]{background:rgb(59 130 246 / 0.12);color:rgb(29 78 216)}.method-pill[data-method=\"DELETE\"]{background:rgb(239 68 68 / 0.12);color:rgb(185 28 28)}.dark .method-pill[data-method=\"GET\"]{background:rgb(34 197 94 / 0.16);color:rgb(74 222 128)}.dark .method-pill[data-method=\"POST\"]{background:rgb(59 130 246 / 0.16);color:rgb(96 165 250)}.dark .method-pill[data-method=\"DELETE\"]{background:rgb(239 68 68 / 0.16);color:rgb(248 113 113)}.endpoint-bar{display:flex;align-items:center;gap:0.625rem;margin:0.75rem 0 1.25rem;padding:0.5rem 0.75rem;border:1px solid rgb(0 0 0 / 0.08);border-radius:0.75rem;overflow-x:auto}.dark .endpoint-bar{border-color:rgb(255 255 255 / 0.1)}.endpoint-bar .endpoint-url{padding:0;background:none;border:0;font-size:0.875rem;white-space:nowrap}.endpoint-bar .endpoint-base{opacity:0.5}"}]}
{"page":{"pagePath":"reference/roleplay-actions","slug":"/reference/roleplay-actions","pageMetadata":{"title":"Roleplay Actions","sidebarTitle":"Roleplay Actions","description":"Have your avatar perform a custom action from a prompt or a video clip.","hidden":true,"href":"/reference/roleplay-actions","hiddenSetByFrontmatter":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Have your avatar perform a custom action from a prompt or a video clip.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Note,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(_components.p,{children:`Roleplay actions let your avatar break out of standard talking gestures to perform a specific action mid-call—like celebrating, dancing, or sipping a drink—before seamlessly resuming the conversation. Actions are triggered either from a text prompt or from a pre-registered video clip.`}),`\n`,_jsx(_components.p,{children:`There are two ways to ask for one:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On demand`}),`: a text description of what the avatar should do. We generate the action from the avatar’s current look.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Registered`}),`: a video clip you register when the session starts, then trigger by name.`]}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{}),_jsx(_components.th,{children:`On demand`}),_jsx(_components.th,{children:`Registered`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Best for`})}),_jsx(_components.td,{children:`Open-ended actions where the user can ask the avatar to do anything in real time.`}),_jsx(_components.td,{children:`A specific, curated action. Great when your UI offers a set of action buttons for the user to pick from.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Latency`})}),_jsx(_components.td,{children:`Slower: takes a few seconds to generate before the action can start.`}),_jsx(_components.td,{children:`Starts within a few hundred milliseconds.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Predictability`})}),_jsx(_components.td,{children:`Generated from the prompt, so results are more dynamic and less predictable.`}),_jsx(_components.td,{children:`Exact: always matches your video clip.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Setup`})}),_jsx(_components.td,{children:`None: prompts are sent on the fly during the call.`}),_jsxs(_components.td,{children:[`You create the clips ahead of time and register them at session start. See `,_jsx(_components.a,{href:`#clip-requirements`,children:`clip requirements`}),`.`]})]})]})]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Roleplay actions are available on LiveKit only.`})}),`\n`,_jsx(Heading,{level:`2`,id:`on-demand-actions`,children:`On-demand actions`}),`\n`,_jsxs(_components.p,{children:[`Publish a data message on the LiveKit topic `,_jsx(_components.code,{children:`ls.roleplay-action`}),` with a `,_jsx(_components.code,{children:`prompt`}),`.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Only one roleplay action runs at a time. Any roleplay action you send while one is in progress is ignored until that action is over.`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The person picks up a cup of coffee, sips it, and puts the cup back down\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(`table`,{children:[_jsxs(`colgroup`,{children:[_jsx(`col`,{style:{width:`20%`}}),_jsx(`col`,{style:{width:`15%`}}),_jsx(`col`,{style:{width:`15%`}}),_jsx(`col`,{style:{width:`50%`}})]}),_jsx(`thead`,{children:_jsxs(`tr`,{children:[_jsx(`th`,{children:`Field`}),_jsx(`th`,{children:`Required`}),_jsx(`th`,{children:`Default`}),_jsx(`th`,{children:`What it does`})]})}),_jsxs(`tbody`,{children:[_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`prompt`})}),_jsx(`td`,{children:`yes`}),_jsx(`td`,{children:`—`}),_jsx(`td`,{children:`What the avatar should do, up to 1000 characters. The action is generated from the avatar’s current look.`})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`duration`})}),_jsx(`td`,{children:`no`}),_jsx(`td`,{children:_jsx(`code`,{children:`5`})}),_jsx(`td`,{children:`Length in seconds, between 1.5 and 15.`})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`generate_audio`})}),_jsx(`td`,{children:`no`}),_jsx(`td`,{children:_jsx(`code`,{children:`false`})}),_jsxs(`td`,{children:[_jsx(`code`,{children:`true`}),` generates a soundtrack for the action. `,_jsx(`code`,{children:`false`}),` makes it silent.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`end_frame`})}),_jsx(`td`,{children:`no`}),_jsx(`td`,{children:`None`}),_jsxs(`td`,{children:[`An `,_jsx(`code`,{children:`https://`}),` URL, or a base64 image, of the look the avatar should end on. That image becomes the avatar’s look after the action. Without it, the avatar returns to the look it had when you sent the prompt. Prefer a URL; inline images must stay small enough to fit in a data message. See `,_jsx(`a`,{href:`#changing-the-avatars-look`,children:`changing the avatar’s look`}),`.`]})]})]})]}),`\n`,_jsx(_components.p,{children:`An on-demand action takes a few seconds to generate. If the avatar is talking when it is ready, it waits until the avatar finishes, then starts.`}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`When you send the request, have the avatar acknowledge it and keep talking while the action generates, for example `,_jsx(_components.em,{children:`“Sure, I can dance for you. I have been taking dancing lessons for this exact purpose.”`}),` After the action plays, have the avatar speak again and refer to what it just did, for example `,_jsx(_components.em,{children:`“I hope you liked my dance!”`}),` You can queue the response audio while the action is playing.`]})}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`10`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` payload`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` TextEncoder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`encode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prompt:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"The person picks up a cup of coffee, sips it, and puts the cup back down\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` duration:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` room`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`localParticipant`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`publishData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payload`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` topic:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ls.roleplay-action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reliable:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` livekit `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` rtc`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` request_roleplay_action`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`room`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: rtc.Room, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`duration`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`float`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` room.local_participant.publish_data(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json.dumps({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"prompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: prompt, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"duration\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: duration}).encode(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` topic`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ls.roleplay-action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reliable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`registered-actions`,children:`Registered actions`}),`\n`,_jsx(Heading,{level:`3`,id:`register-clips-at-session-start`,children:`Register clips at session start`}),`\n`,_jsxs(_components.p,{children:[`Pass your video clips as `,_jsx(_components.code,{children:`roleplay_actions`}),` when creating the `,_jsx(_components.code,{children:`AvatarSession`}),`. You can register up to 100 actions. Each key is the name you will use to trigger the action, and each value is an object with `,_jsx(_components.code,{children:`video_url`}),` and an optional `,_jsx(_components.code,{children:`new_image_url`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`avatar `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lemonslice.AvatarSession(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` agent_image_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/avatar.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` roleplay_actions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"thinking\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"video_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/clips/thinking.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"to_work\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"video_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/clips/to-work.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"new_image_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/images/working.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`session_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` avatar.start(session, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`room`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ctx.room)`})]}),`\n`]})})}),`\n`,_jsxs(`table`,{children:[_jsxs(`colgroup`,{children:[_jsx(`col`,{style:{width:`20%`}}),_jsx(`col`,{style:{width:`15%`}}),_jsx(`col`,{style:{width:`15%`}}),_jsx(`col`,{style:{width:`50%`}})]}),_jsx(`thead`,{children:_jsxs(`tr`,{children:[_jsx(`th`,{children:`Field`}),_jsx(`th`,{children:`Required`}),_jsx(`th`,{children:`Default`}),_jsx(`th`,{children:`What it does`})]})}),_jsxs(`tbody`,{children:[_jsxs(`tr`,{children:[_jsx(`td`,{children:`key`}),_jsx(`td`,{children:`yes`}),_jsx(`td`,{children:`—`}),_jsxs(`td`,{children:[`The action name. Lowercase letters, digits, `,_jsx(`code`,{children:`_`}),` and `,_jsx(`code`,{children:`-`}),`, up to 64 characters. You use this name to trigger the action.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`video_url`})}),_jsx(`td`,{children:`yes`}),_jsx(`td`,{children:`—`}),_jsxs(`td`,{children:[`An `,_jsx(`code`,{children:`https://`}),` URL to the video. The video must be 30 seconds or less.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`new_image_url`})}),_jsx(`td`,{children:`no`}),_jsx(`td`,{children:`None`}),_jsxs(`td`,{children:[`An `,_jsx(`code`,{children:`https://`}),` URL to the image the avatar should `,_jsx(`em`,{children:`become`}),` after the action. See `,_jsx(`a`,{href:`#changing-the-avatars-look`,children:`changing the avatar’s look`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`clip-requirements`,children:`Clip requirements`}),`\n`,_jsx(_components.p,{children:`Generate each clip before the session starts. It should show the same character as the avatar’s image, performing the action.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Length:`}),` 30 seconds or less. Longer clips are skipped.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Dimensions:`}),` a 2:3 portrait of 416 × 672 pixels or 756 × 1220 pixels.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Format:`}),` MP4 (H.264) is the safest choice.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Audio:`}),` optional. If the clip has audio, it plays with the action. Without audio, the action is silent.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Start:`}),` the first frame should match the avatar’s current reference image.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`End:`}),` the last frame should match the current reference image, or the new image set by `,_jsx(_components.code,{children:`new_image_url`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Size:`}),` up to 256 MB per clip.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`trigger-a-registered-action`,children:`Trigger a registered action`}),`\n`,_jsxs(_components.p,{children:[`Publish a data message on the LiveKit topic `,_jsx(_components.code,{children:`ls.roleplay-action`}),` with the action name.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Only one roleplay action runs at a time. Any roleplay action you send while one is in progress is ignored until that action is over.`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"thinking\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"interrupt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(`table`,{children:[_jsxs(`colgroup`,{children:[_jsx(`col`,{style:{width:`20%`}}),_jsx(`col`,{style:{width:`15%`}}),_jsx(`col`,{style:{width:`15%`}}),_jsx(`col`,{style:{width:`50%`}})]}),_jsx(`thead`,{children:_jsxs(`tr`,{children:[_jsx(`th`,{children:`Field`}),_jsx(`th`,{children:`Required`}),_jsx(`th`,{children:`Default`}),_jsx(`th`,{children:`What it does`})]})}),_jsxs(`tbody`,{children:[_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`action`})}),_jsx(`td`,{children:`yes`}),_jsx(`td`,{children:`—`}),_jsxs(`td`,{children:[`A name from `,_jsx(`code`,{children:`roleplay_actions`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{children:`interrupt`})}),_jsx(`td`,{children:`no`}),_jsx(`td`,{children:_jsx(`code`,{children:`false`})}),_jsxs(`td`,{children:[_jsx(`code`,{children:`false`}),` waits until the avatar finishes what it is saying, then performs the action. `,_jsx(`code`,{children:`true`}),` interrupts the avatar and performs it now.`]})]})]})]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`7`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` payload`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` TextEncoder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`encode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`action:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"thinking\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`interrupt:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` room`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`localParticipant`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`publishData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payload`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` topic:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ls.roleplay-action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reliable:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` livekit `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` rtc`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` trigger_roleplay_action`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`room`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: rtc.Room, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`action`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`interrupt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`bool`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` room.local_participant.publish_data(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json.dumps({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: action, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"interrupt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: interrupt}).encode(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` topic`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ls.roleplay-action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reliable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`events`,children:`Events`}),`\n`,_jsxs(_components.p,{children:[`LemonSlice publishes `,_jsx(_components.code,{children:`roleplay_status`}),` events as JSON data messages on the LiveKit topic `,_jsx(_components.code,{children:`lemonslice`}),`. Use them to follow an action from request to finish.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"roleplay_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"started\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"thinking\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`status`})}),_jsx(_components.th,{children:`When`}),_jsx(_components.th,{children:`Applies to`}),_jsx(_components.th,{children:`Extra fields`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`generating`})}),_jsx(_components.td,{children:`Generation has started.`}),_jsx(_components.td,{children:`On demand`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`prompt`}),`: the text you sent.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ready`})}),_jsx(_components.td,{children:`The action is generated and waiting to start.`}),_jsx(_components.td,{children:`On demand`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`prompt`}),`: the text you sent. `,_jsx(_components.code,{children:`action`}),`: an id for this action, such as `,_jsx(_components.code,{children:`prompt_a1b2c3d4`}),`. Later events for this action use the same id.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`started`})}),_jsx(_components.td,{children:`The action is accepted. It has started, or it is waiting for the avatar to finish talking.`}),_jsx(_components.td,{children:`Both`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`action`}),`: the name you registered, or the on-demand id from `,_jsx(_components.code,{children:`ready`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`failed`})}),_jsx(_components.td,{children:`The action will not play: it could not be generated, could not start, or another action is in progress.`}),_jsx(_components.td,{children:`Both`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`error`}),`: why it will not play. `,_jsx(_components.code,{children:`action`}),`: the registered name, or the on-demand id once one exists.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`done`})}),_jsx(_components.td,{children:`The action has finished. The avatar is back in conversation, and you can send the next roleplay action.`}),_jsx(_components.td,{children:`Both`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`action`}),`: the name you registered, or the on-demand id from `,_jsx(_components.code,{children:`ready`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`avatar-lifecycle-during-a-roleplay-action`,children:`Avatar Lifecycle during a Roleplay Action`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Accepted.`}),` If the avatar is talking, the action waits until it finishes what it’s saying, then starts. For a registered action, set `,_jsx(_components.code,{children:`interrupt: true`}),` to skip the wait: the avatar stops talking and performs the action right away.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Performed.`}),` The avatar performs the action. If your agent responds during the action, the response is held until the action ends. Only the latest response is kept.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Done.`}),` When the action ends, the avatar speaks the held response, if there is one, and you can send the next roleplay action.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`changing-the-avatar’s-look`,children:`Changing the avatar’s look`}),`\n`,_jsx(_components.p,{children:`A roleplay action can also change the avatar’s look, like walking into the garden or putting on a hat. Give us an image of the new look, and the avatar keeps that look after the action ends.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On demand:`}),` set `,_jsx(_components.code,{children:`end_frame`}),` to the new image. The action is generated to end on it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Registered:`}),` set `,_jsx(_components.code,{children:`new_image_url`}),` to the new image, next to `,_jsx(_components.code,{children:`video_url`}),`. Your clip should end on that image.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`If you leave these out, the avatar goes back to the look it had before the action.`}),`\n`,_jsx(Heading,{level:`3`,id:`example-from-the-house-to-the-garden`,children:`Example: from the house to the garden`}),`\n`,_jsxs(_components.p,{children:[`Say your avatar starts in a living room, and you want it to walk outside and keep talking from the garden. You need an image of the avatar standing in the garden, such as `,_jsx(_components.code,{children:`garden.jpg`}),`.`]}),`\n`,_jsx(_components.p,{children:`On demand, describe the move and end on the garden image:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The person stands up, walks out the back door, and stops in the garden facing the camera\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"end_frame\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/images/garden.jpg\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Registered, use a clip of the avatar walking from the living room into the garden, and set the garden image as `,_jsx(_components.code,{children:`new_image_url`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"roleplay_actions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"to_garden\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"video_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/clips/house-to-garden.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"new_image_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/images/garden.jpg\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Then trigger it with `,_jsx(_components.code,{children:`{ \"action\": \"to_garden\" }`}),`. Either way, once the action ends, the avatar keeps talking from the garden for the rest of the session, until another action changes its look.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Roleplay Actions","sidebarTitle":"Roleplay Actions","description":"Have your avatar perform a custom action from a prompt or a video clip.","hidden":true,"href":"/reference/roleplay-actions","hiddenSetByFrontmatter":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"On-demand actions","slug":"on-demand-actions","depth":2,"children":[]},{"title":"Registered actions","slug":"registered-actions","depth":2,"children":[{"title":"Register clips at session start","slug":"register-clips-at-session-start","depth":3,"children":[]},{"title":"Clip requirements","slug":"clip-requirements","depth":3,"children":[]},{"title":"Trigger a registered action","slug":"trigger-a-registered-action","depth":3,"children":[]}]},{"title":"Events","slug":"events","depth":2,"children":[]},{"title":"Avatar Lifecycle during a Roleplay Action","slug":"avatar-lifecycle-during-a-roleplay-action","depth":2,"children":[]},{"title":"Changing the avatar’s look","slug":"changing-the-avatar’s-look","depth":2,"children":[{"title":"Example: from the house to the garden","slug":"example-from-the-house-to-the-garden","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"lemonslice","siteName":"LemonSlice","title":"Roleplay Actions - LemonSlice","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-16T17:49:57.820Z","originalFileLocation":"reference/roleplay-actions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Have your avatar perform a custom action from a prompt or a video clip.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LemonSlice\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"noindex\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Roleplay Actions - LemonSlice\">\u003cmeta data-mint-head property=\"og:description\" content=\"Have your avatar perform a custom action from a prompt or a video clip.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LemonSlice\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://lemonslice.com/docs/reference/roleplay-actions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lemonslice.mintlify.site/docs/_mintlify/api/og/v2?division=Advanced\u0026amp;title=Roleplay+Actions\u0026amp;description=Have+your+avatar+perform+a+custom+action+from+a+prompt+or+a+video+clip.\u0026amp;theme=793e090b734c5a51a4d066b2\u0026amp;signature=b4d0e154a8b8ed0e654fb6637ff17bea5c29b0eb3c43b9eacfc3e3dad3b5eed2\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Roleplay Actions - LemonSlice\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Have your avatar perform a custom action from a prompt or a video clip.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lemonslice.mintlify.site/docs/_mintlify/api/og/v2?division=Advanced\u0026amp;title=Roleplay+Actions\u0026amp;description=Have+your+avatar+perform+a+custom+action+from+a+prompt+or+a+video+clip.\u0026amp;theme=793e090b734c5a51a4d066b2\u0026amp;signature=b4d0e154a8b8ed0e654fb6637ff17bea5c29b0eb3c43b9eacfc3e3dad3b5eed2\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/lemonslice/2zvmYbORqchkTmwr/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LemonSlice\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF7819\">\u003clink data-mint-head rel=\"canonical\" href=\"https://lemonslice.com/docs/reference/roleplay-actions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/reference/roleplay-actions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://lemonslice.com/#organization\",\"name\":\"LemonSlice\",\"url\":\"https://lemonslice.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lemonslice/lgypzRYz7QfG2Mni/logo/light.png?fit=max\u0026auto=format\u0026n=lgypzRYz7QfG2Mni\u0026q=85\u0026s=1df3909ae480f4d50edb89d7eee724bf\"}},{\"@type\":\"WebSite\",\"@id\":\"https://lemonslice.com/docs#website\",\"name\":\"LemonSlice\",\"url\":\"https://lemonslice.com/docs\",\"publisher\":{\"@id\":\"https://lemonslice.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://lemonslice.com/docs/reference/roleplay-actions#webpage\",\"url\":\"https://lemonslice.com/docs/reference/roleplay-actions\",\"name\":\"Roleplay Actions\",\"description\":\"Have your avatar perform a custom action from a prompt or a video clip.\",\"dateModified\":\"2026-11-16T17:49:57.820Z\",\"isPartOf\":{\"@id\":\"https://lemonslice.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://lemonslice.com/docs/reference/roleplay-actions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://lemonslice.com/docs/reference/roleplay-actions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Advanced\",\"item\":\"https://lemonslice.com/docs/reference/cwm-1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Roleplay Actions\",\"item\":\"https://lemonslice.com/docs/reference/roleplay-actions\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://lemonslice.com/docs/reference/roleplay-actions#article\",\"headline\":\"Roleplay Actions\",\"name\":\"Roleplay Actions\",\"description\":\"Have your avatar perform a custom action from a prompt or a video clip.\",\"url\":\"https://lemonslice.com/docs/reference/roleplay-actions\",\"mainEntityOfPage\":{\"@id\":\"https://lemonslice.com/docs/reference/roleplay-actions#webpage\"},\"dateModified\":\"2026-11-16T17:49:57.820Z\",\"publisher\":{\"@id\":\"https://lemonslice.com/#organization\"},\"isPartOf\":{\"@id\":\"https://lemonslice.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LemonSlice\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"LemonSlice\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/reference/roleplay-actions.md","siteName":"LemonSlice","nav":{"global":null,"tabs":[{"tab":"Reference","pages":[{"title":"LemonSlice Documentation","sidebarTitle":"Overview","href":"/introduction"},{"title":"Quickstart","sidebarTitle":"Quickstart (5 min)","href":"/introduction/quickstart"},{"title":"Production checklist for deploying LemonSlice avatars","sidebarTitle":"Production checklist","href":"/reference/production-checklist"},{"group":"Integrations","pages":[{"title":"LiveKit Integration","sidebarTitle":"LiveKit","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lemonslice/images/integrations/livekit.svg","href":"/livekit/index"},{"title":"Pipecat Integration","sidebarTitle":"Pipecat","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lemonslice/images/integrations/pipecat.svg","href":"/pipecat/index"},{"title":"Agora Integration","sidebarTitle":"Agora","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lemonslice/images/integrations/agora.svg","href":"/agora/index"},{"title":"WebSocket Integration","sidebarTitle":"WebSocket","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lemonslice/images/integrations/websocket.svg","href":"/websocket/index"}]},{"group":"Prompting guide","pages":[{"title":"Avatar Image Tips","href":"/prompting-guide/avatar-image-tips"}]},{"group":"Advanced","pages":[{"title":"Emotion Engine","sidebarTitle":"Emotion Engine (CWM-1)","href":"/reference/cwm-1"},{"title":"CWM-1 Lite","sidebarTitle":"CWM-1 Lite Model","href":"/reference/lite-model"},{"title":"Cartoon Model","sidebarTitle":"Cartoon Model","href":"/reference/cartoon-model"},{"title":"LemonSlice Flash","sidebarTitle":"Flash Model","href":"/reference/flash-model"},{"title":"Real-time Avatar Updates","sidebarTitle":"Real-time Avatar Updates","description":"Change your avatar's appearance mid-call. ~600ms latency.","href":"/reference/realtime-updates"},{"title":"Roleplay Actions","sidebarTitle":"Roleplay Actions","hidden":true,"href":"/reference/roleplay-actions"},{"title":"Green Screen (Chroma Key)","sidebarTitle":"Green Screen","description":"Place a LemonSlice avatar into any background with client-side green screen compositing","href":"/reference/green-screen"},{"title":"Send your avatar to a Zoom call","sidebarTitle":"Zoom \u0026 Meeting Platforms","href":"/reference/zoom-meetings"}]},{"group":"Endpoints","pages":[{"title":"Authentication","href":"/reference/authentication"},{"group":"LiveKit | Pipecat | WebSocket","pages":[{"title":"Create session","deprecated":null,"version":null,"openapi":"/openapi.json post /liveai/sessions","href":"/api-reference/create-session"}]},{"group":"Agora","pages":[{"title":"Create Agora session","deprecated":null,"version":null,"openapi":"/openapi.json post /liveai/agora/session/start","href":"/api-reference/create-agora-session"},{"title":"Stop Agora session","deprecated":null,"version":null,"openapi":"/openapi.json delete /liveai/agora/session/stop","href":"/api-reference/stop-agora-session"}]},{"group":"Sessions","pages":[{"title":"Get session","deprecated":null,"version":null,"openapi":"/openapi.json get /liveai/sessions/{session_id}","href":"/api-reference/get-session"},{"title":"List sessions","deprecated":null,"version":null,"openapi":"/openapi.json get /liveai/sessions","href":"/api-reference/list-sessions"},{"title":"Control session","deprecated":null,"version":null,"openapi":"/openapi.json post /liveai/sessions/{session_id}/control","href":"/api-reference/control-session"}]},{"group":"Meeting platforms","pages":[{"title":"Join third party meeting platform","deprecated":null,"version":null,"openapi":"/openapi.json post /liveai/sessions/{session_id}/join-meeting","href":"/api-reference/join-third-party-meeting-platform"},{"title":"Leave third party meeting platform","deprecated":null,"version":null,"openapi":"/openapi.json post /liveai/sessions/{session_id}/leave-meeting","href":"/api-reference/leave-third-party-meeting-platform"}]},{"group":"Avatar optimization","pages":[{"title":"Create avatar variants","openapi":"openapi.json POST /liveai/avatar-variants","href":"/reference/create-avatar-variants"}]}]}]},{"tab":"More","menu":[{"item":"Widget","description":"No code. Embed easily on any site","pages":[{"title":"Widget","href":"/widget/overview"}]},{"item":"Hosted","description":"Low code. Fully hosted, build your own frontend.","pages":[{"title":"Hosted","href":"/hosted/overview"}]}],"pages":[{"title":"More","href":"/widget/overview"}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples"}]}]},"basePath":"","title":"Roleplay Actions - LemonSlice","deploymentId":"dpl_2Ja9WRbxdgSB12oQLm2PJEkKFtyF","buildId":"dpl_2Ja9WRbxdgSB12oQLm2PJEkKFtyF","dynamics":[],"chunks":[]}