Typewriter animation

How animate your messages properly with Typewrite

We explained in the previous section that you can use either the send method (for one-off messages) or the write method (for sending streams).

But sometimes, you want to send some one-off messages that look like streams.

Since v0.0.51 the Node and Python SDKs provide a typewrite() method that allows you to simulate a stream with a smooth animation, even if you know the content in advance.

The full code of this video is available here.

How it works?

await agent.typewrite({
    conversationId: "conversationId",
    text: "Here's your message",
    intervalMs: 60, // optional
    initialDelayMs: 1500, // optional

Behind the scenes, AgentLabs will instantiate a new stream and start sending the stream with a nice typewriter effect.

Last updated