Zeli AvatarDeveloper docs
v0.1.0

Python SDK / Talk streams

Talk streams

A TalkStream feeds an utterance to the avatar incrementally — ideal when text arrives a bit at a time (tokens from your own model). The avatar starts speaking before the sentence is complete.

from zeli import TalkStream

A TalkStream is returned by session.create_talk_stream(), which requires the server's control gateway.

Sending text

await talk.send(text, *, start_of_speech=None, end_of_speech=False)
textstrRequired

The next chunk of the utterance to append.

start_of_speechbool | NoneOptional

Marks the start of the utterance. The first send is flagged automatically, so you rarely set this.

end_of_speechboolOptionaldefault: False

Marks the final chunk. Exiting the async with block also ends the utterance.

create_talk_stream() supports async with, which closes the stream on exit:

async with session.create_talk_stream() as talk:
    await talk.send("Hello ")
    await talk.send("world.", end_of_speech=True)

The first chunk is automatically flagged as the start of speech; mark the last one with end_of_speech=True (or just exit the async with, which closes the stream).

Members

MemberDescription
send(text, *, start_of_speech=None, end_of_speech=False)Append text. First call auto-flags start of speech.
close()Signal the end of the utterance if not already ended.
correlation_idId tying this stream's chunks to the resulting transcript message.
closedWhether the stream has ended.

Interleave await asyncio.sleep(...) between chunks to simulate token-by-token arrival, or feed real tokens from your model as they generate. Call session.interrupt() to barge-in and stop playback.

Zeli Avatar · real-time avatars over WebRTC · self-hostable · AU data residency · source