2024-09-12 13:44:06 +03:00
|
|
|
|
pub fn intro(command_prefix: &str) -> String {
|
|
|
|
|
|
let message = r#"
|
|
|
|
|
|
## 📖 Usage
|
|
|
|
|
|
|
|
|
|
|
|
To get an **overview of the current configuration affecting this room**, send a `%command_prefix% config status` command.
|
|
|
|
|
|
|
|
|
|
|
|
To **adjust settings**, see `%command_prefix% config`.
|
|
|
|
|
|
|
|
|
|
|
|
### 💬 Text Generation
|
|
|
|
|
|
|
|
|
|
|
|
If there's a text-generation handler agent configured (see `%command_prefix% config status`), the bot **may** respond to messages sent in the room.
|
|
|
|
|
|
|
|
|
|
|
|
Whether the bot responds depends on the **💬 Text Generation / 🗟 Prefix Requirement** setting (see `%command_prefix% config status`).
|
|
|
|
|
|
Sometimes, a prefix (e.g. `%command_prefix%`) is required in front of messages sent to the room for the bot to respond.
|
2024-09-19 13:39:52 +03:00
|
|
|
|
For multi-user rooms, this setting defaults to "required".
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
|
|
|
|
|
Room messages start a threaded conversation where you can continue back-and-forth communication with the bot.
|
|
|
|
|
|
|
|
|
|
|
|
### 🗣️ Text-to-Speech
|
|
|
|
|
|
|
|
|
|
|
|
If there's a text-to-speech handler agent configured (see `%command_prefix% config status`), the bot **may** convert text messages sent to the room to audio (voice).
|
|
|
|
|
|
|
|
|
|
|
|
By default, the bot will offer text-to-speech for its own messages which are a response to voice messages coming from you. Simply click the 🗣️ reaction on the bot's message and the bot will convert the text message to audio. This is configurable via the **🗣️ Text-to-Speech / 🪄 Bot Messages Flow Type** setting.
|
|
|
|
|
|
|
|
|
|
|
|
The bot may be configured to also turn your own text messages to audio (voice) via the **🗣️ Text-to-Speech / 🪄 User Messages Flow Type** setting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 🦻 Speech-to-Text
|
|
|
|
|
|
|
|
|
|
|
|
If there's a speech-to-text handler agent configured (see `%command_prefix% config status`), the bot **may** transcribe voice messages sent to the room to text.
|
|
|
|
|
|
|
|
|
|
|
|
By default, the bot will also perform 💬 Text Generation on the text. This is configurable via the **🦻 Speech-to-Text / 🪄 Flow Type** setting.
|
|
|
|
|
|
|
|
|
|
|
|
If all your messages are in the same language, you can improve accuracy & latency by configuring the language via the **🦻 Speech-to-Text / 🔤 Language** setting.
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-11 22:19:15 +03:00
|
|
|
|
### Image Generation
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
2025-05-11 22:19:15 +03:00
|
|
|
|
#### 🖌️ Creating images
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
2025-05-10 09:18:01 +03:00
|
|
|
|
Simply send a command like `%command_prefix% image create A beautiful sunset over the ocean` and the bot will start a threaded conversation and post an image based on your prompt.
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
2025-05-11 22:19:15 +03:00
|
|
|
|
You can then respond in the same message thread with:
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
|
|
|
|
|
- more messages, to add more criteria to your prompt.
|
|
|
|
|
|
- a message saying `again`, to generate one more image with the current prompt.
|
|
|
|
|
|
|
2025-05-11 22:19:15 +03:00
|
|
|
|
#### 🎨 Editing images
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
2025-05-11 22:19:15 +03:00
|
|
|
|
Simply send a command like `%command_prefix% image edit Turn the following image into an anime-style drawing` and the bot will start a threaded conversation asking for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You can then respond in the same message thread with:
|
|
|
|
|
|
|
|
|
|
|
|
- more messages, to add more criteria to your prompt.
|
|
|
|
|
|
- one or more images, to provide the images that the bot will operate on.
|
|
|
|
|
|
- a message saying `go`, to start the image generation process.
|
|
|
|
|
|
- a message saying `again`, to prompt the bot to generate one more image edit with the current prompt.
|
|
|
|
|
|
|
|
|
|
|
|
#### 🫵 Creating stickers
|
|
|
|
|
|
|
|
|
|
|
|
A variation of **creating images** is creating "sticker images".
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
2025-05-10 09:18:01 +03:00
|
|
|
|
To create a sticker, send a command like `%command_prefix% sticker A huge bowl of steaming ramen with a mountain of beansprouts on top`.
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
2025-05-10 09:18:01 +03:00
|
|
|
|
The difference from **creating images** is that the bot will:
|
2024-09-12 13:44:06 +03:00
|
|
|
|
|
Fix sticker generation for newer GPT image models
Sticker generation was failing when using newer GPT image models
(gpt-image-1, gpt-image-1-mini, gpt-image-1.5). The issue occurred
because stickers requested 256x256 size, but these models only support
1024x1024, 1536x1024, 1024x1536, and auto.
To reproduce, send `!bai sticker Something` to an agent configured
with a GPT image model. The error was:
invalid_request_error: Invalid value: '256x256'. Supported values
are: '1024x1024', '1024x1536', '1536x1024', and 'auto'. (param: size)
(code: invalid_value)
The fix replaces the hardcoded 256x256 size override with a
`smallest_size_possible` flag, letting each provider determine the
appropriate sticker size based on the model being used.
The `openai_compat` provider still defaults to requesting 256x256 in all cases
(regardless of model name).
2026-02-04 02:36:50 +02:00
|
|
|
|
- create a smaller-resolution image (as small as the model allows) - smaller/quicker, but still good enough for a sticker
|
2024-09-12 13:44:06 +03:00
|
|
|
|
- potentially switch to a different (cheaper or otherwise more suitable) model, if available
|
|
|
|
|
|
- post the image directly to the room (as a reply to your message), without starting a threaded conversation
|
|
|
|
|
|
"#;
|
|
|
|
|
|
|
|
|
|
|
|
message.replace("%command_prefix%", command_prefix)
|
|
|
|
|
|
}
|