handlers.md

May 10, 2025 ยท View on GitHub

๐Ÿค Handlers

Introduction

You can use different models in different rooms (e.g. OpenAI GPT-4o alongside Llama running on Groq, etc.)

You can also use different models within the same room (e.g. ๐Ÿ’ฌ text-generation handled by one agent, ๐Ÿฆป speech-to-text handled by another, ๐Ÿ—ฃ๏ธ text-to-speech by a 3rd, etc.)

The bot supports the following use-purposes:

In a given room, each different purpose can be served by a different provider and model. This combination of provider and model configuration is called an ๐Ÿค– agent. Each purpose can be served by a different handler agent.

See a ๐Ÿ–ผ๏ธ Screenshot of an example room configuration.

Configuring

Handlers can be configured dynamically:

  • either per-room (e.g. !bai config room set-handler text-generation room-local/openai-gpt-4o)
  • or globally (e.g. !bai config global set-handler text-generation global/openai-gpt-4o)

The per-room configuration takes priority over the global configuration.

There's also a catch-all purpose that can be used as a fallback handler for messages that don't match any other handler.

๐Ÿ’ก It's a good idea to globally-configure a powerful agent as a catch-all handler, so that the bot can always handle messages of any kind. You can then override individual handlers per room or globally.