Recipes← all recipesView on GitHub

Give a voice AI agent a video avatar

AI AgentsAI video avatar

Assign idle, listening, and talking video files so a voice AI agent shows the matching avatar state during video calls.

video

The claim

The bundled schema documents three parameters under ai.params. video_idle_file is the “URL of a video file to play when AI is idle”. video_listening_file is the one “to play when AI is listening to the user speak”. video_talking_file is the one “to play when AI is talking”. Each carries the schema’s note that it requires a call that supports video. You supply three URLs, one per state, and the schema’s descriptions say which state each is for.

How it works

AVATAR = {
    "video_idle_file": f"{BASE}/idle.mp4",
    "video_listening_file": f"{BASE}/listening.mp4",
    "video_talking_file": f"{BASE}/talking.mp4",
}

class FaceAgent(AgentBase):
    def __init__(self):
        super().__init__(name="face", route="/face")
        self.prompt_add_section("Role", "You are the front desk at Ridgeline Cycles, on a video call. ...")
        self.set_params(AVATAR)

What the platform receives, inside the ai verb:

"params": {"video_idle_file": "https://media.example.com/avatar/idle.mp4",
           "video_listening_file": "https://media.example.com/avatar/listening.mp4",
           "video_talking_file": "https://media.example.com/avatar/talking.mp4"}

set_params merges into the agent’s params, so the three sit beside whatever else you set. The swml/ surface is the same verb written by hand. Make short clips, loop them cleanly, and host them where the platform can fetch them.

Limitations

You prove the document and the schema. Which clip plays when, and how the switch looks, are the platform’s side of a live video call.

The clips are files you host. The schema says nothing about format or length; short, loopable, and served with a correct content type is the safe reading.

The schema does not reject an unknown key under params, so a typo in one of the three names validates and does not configure the documented parameter. Copy the names from the schema.

What to change first

The verifier sets AVATAR_BASE_URL to its own example before it imports the app, so a value in .env cannot override it there. Point AVATAR_BASE_URL in .env at your own three clips and run the agent, not the verifier, to see your face on a call. Change the verifier’s EXPECTED instead and it fails, because the example is what it pins.

Where this sits

Seen in a build

One of 8 recipes composed by AI drive-thru ordering: a voice agent whose flow your code controls.

Seen in a build

One of 10 recipes composed by Embed a state-aware voice agent in your web page.

Seen in a build

One of 7 recipes composed by Video blackjack dealer: a voice AI agent that controls the browser.