From 6cbe0cb7fba07e1eda0b81e475d873ff54e65a85 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 22 Nov 2026 08:48:26 +0200 Subject: [PATCH] Expose baibot's bot_tools setting The next baibot release lets models use the bot's own tools while answering (bot tools: reading the room's recent messages, creating and editing images). Agents turn them off with `text_generation.bot_tools: false`. Older baibot versions ignore the setting. New variables: - `matrix_bot_baibot_config_agents_static_definitions_bot_tools` (true, the upstream default), shared by the presets - `matrix_bot_baibot_config_agents_static_definitions__config_text_generation_bot_tools` for each preset, defaulting to the shared one Co-Authored-By: Claude Opus 5.5 --- docs/configuring-playbook-bot-baibot.md | 2 ++ roles/custom/matrix-bot-baibot/defaults/main.yml | 14 ++++++++++++++ .../templates/provider/anthropic-config.yml.j2 | 1 + .../templates/provider/groq-config.yml.j2 | 1 + .../templates/provider/mistral-config.yml.j2 | 1 + .../templates/provider/openai-config.yml.j2 | 1 + .../templates/provider/venice-config.yml.j2 | 1 + 7 files changed, 21 insertions(+) diff --git a/docs/configuring-playbook-bot-baibot.md b/docs/configuring-playbook-bot-baibot.md index 66a124177..bf449c65b 100644 --- a/docs/configuring-playbook-bot-baibot.md +++ b/docs/configuring-playbook-bot-baibot.md @@ -166,6 +166,8 @@ Agents defined statically and those created dynamically (via chat) are named dif Depending on your propensity for [GitOps](https://en.wikipedia.org/wiki/DevOps#GitOps), you may prefer to define agents statically via Ansible, or you may wish to do it dynamically via chat. +The presets let models use baibot's bot tools, like reading the room's recent messages, or creating and editing images (see [🧰 Bot Tools](https://github.com/etkecc/baibot/blob/main/docs/bot-tools.md)). To turn them off for all presets (for example, for models which don't support function calling), set `matrix_bot_baibot_config_agents_static_definitions_bot_tools: false`. Each preset also has its own `..._config_text_generation_bot_tools` variable. To turn off a single tool (like reading the room's recent messages), use access rules instead (see [🧰 Bot Tools / 🔒 Tool permissions](https://github.com/etkecc/baibot/blob/main/docs/bot-tools.md#-tool-permissions)). + Before proceeding, we recommend reading the upstream documentation on [How to choose a provider](https://github.com/etkecc/baibot/blob/main/docs/providers.md#how-to-choose-a-provider) for a side-by-side of what each one can do. In short: we recommend [Venice](#venice), the most capable provider baibot supports and the only one that keeps no logs and trains on nothing. If you'd rather start with the most widely-used option, [OpenAI](#openai) is a solid, well-supported choice too. #### Venice diff --git a/roles/custom/matrix-bot-baibot/defaults/main.yml b/roles/custom/matrix-bot-baibot/defaults/main.yml index 1164da525..9c3fa355d 100644 --- a/roles/custom/matrix-bot-baibot/defaults/main.yml +++ b/roles/custom/matrix-bot-baibot/defaults/main.yml @@ -244,6 +244,15 @@ matrix_bot_baibot_config_agents_static_definitions_custom: [] matrix_bot_baibot_config_agents_static_definitions_prompt: "{% raw %}You are a brief, but helpful bot called {{ baibot_name }} powered by the {{ baibot_model_id }} model. The date/time of this conversation's start is: {{ baibot_conversation_start_time_utc }}.{% endraw %}" +# Controls whether the preset agents (below) let the model use baibot's own tools +# (like reading the room's recent messages, or creating and editing images). +# Each preset's `..._config_text_generation_bot_tools` variable defaults to this. +# Custom agents (`matrix_bot_baibot_config_agents_static_definitions_custom`) set `text_generation.bot_tools` in their own config. +# Turn it off for models which don't support function calling. +# To turn off a single tool (like reading the room's recent messages), use access rules instead. +# See: https://github.com/etkecc/baibot/blob/main/docs/bot-tools.md +matrix_bot_baibot_config_agents_static_definitions_bot_tools: true + ######################################################################################## # # # Anthropic agent configuration # @@ -286,6 +295,7 @@ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generat matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_max_response_tokens: 16384 matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_max_context_tokens: 204800 +matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_bot_tools: "{{ matrix_bot_baibot_config_agents_static_definitions_bot_tools }}" # Provider tools (run on Anthropic's side). # These are disabled by default following upstream defaults. Enabling them may incur additional costs. # See: https://github.com/etkecc/baibot/blob/main/docs/features.md#%EF%B8%8F-provider-tools @@ -344,6 +354,7 @@ matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_p matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_temperature: 1.0 matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_max_response_tokens: 4096 matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_max_context_tokens: 131072 +matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_bot_tools: "{{ matrix_bot_baibot_config_agents_static_definitions_bot_tools }}" matrix_bot_baibot_config_agents_static_definitions_groq_config_speech_to_text_enabled: true matrix_bot_baibot_config_agents_static_definitions_groq_config_speech_to_text_model_id: whisper-large-v3 @@ -400,6 +411,7 @@ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generatio matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_temperature: 1.0 matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_max_response_tokens: 4096 matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_max_context_tokens: 128000 +matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_bot_tools: "{{ matrix_bot_baibot_config_agents_static_definitions_bot_tools }}" ######################################################################################## # # @@ -457,6 +469,7 @@ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_max_response_tokens: ~ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_max_completion_tokens: 128000 matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_max_context_tokens: 400000 +matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_bot_tools: "{{ matrix_bot_baibot_config_agents_static_definitions_bot_tools }}" # Provider tools (run on OpenAI's side). # These are disabled by default following upstream defaults. Enabling them may incur additional costs. # See: https://github.com/etkecc/baibot/blob/main/docs/features.md#%EF%B8%8F-provider-tools @@ -530,6 +543,7 @@ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_temperature: 1.0 matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_max_response_tokens: 4096 matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_max_context_tokens: 128000 +matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_bot_tools: "{{ matrix_bot_baibot_config_agents_static_definitions_bot_tools }}" # How long Venice keeps the prompt prefix cached: "default", "extended", or "24h". # "24h" makes a long, stable system prompt cheap across a day of conversations. matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_prompt_cache_retention: 24h diff --git a/roles/custom/matrix-bot-baibot/templates/provider/anthropic-config.yml.j2 b/roles/custom/matrix-bot-baibot/templates/provider/anthropic-config.yml.j2 index dd12574e0..d603d833f 100644 --- a/roles/custom/matrix-bot-baibot/templates/provider/anthropic-config.yml.j2 +++ b/roles/custom/matrix-bot-baibot/templates/provider/anthropic-config.yml.j2 @@ -9,6 +9,7 @@ text_generation: prompt: {{ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_prompt | to_json }} max_response_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_max_response_tokens | int | to_json }} max_context_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_max_context_tokens | int | to_json }} + bot_tools: {{ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_bot_tools | bool | to_json }} tools: web_search: {{ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_tools_web_search | bool | to_json }} web_fetch: {{ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_tools_web_fetch | bool | to_json }} diff --git a/roles/custom/matrix-bot-baibot/templates/provider/groq-config.yml.j2 b/roles/custom/matrix-bot-baibot/templates/provider/groq-config.yml.j2 index 7009b5546..3c257df41 100644 --- a/roles/custom/matrix-bot-baibot/templates/provider/groq-config.yml.j2 +++ b/roles/custom/matrix-bot-baibot/templates/provider/groq-config.yml.j2 @@ -10,6 +10,7 @@ text_generation: temperature: {{ matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_temperature | to_json }} max_response_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_max_response_tokens | int | to_json }} max_context_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_max_context_tokens | int | to_json }} + bot_tools: {{ matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_bot_tools | bool | to_json }} {% endif %} {% if matrix_bot_baibot_config_agents_static_definitions_groq_config_speech_to_text_enabled %} diff --git a/roles/custom/matrix-bot-baibot/templates/provider/mistral-config.yml.j2 b/roles/custom/matrix-bot-baibot/templates/provider/mistral-config.yml.j2 index 9e007cb3d..b38348826 100644 --- a/roles/custom/matrix-bot-baibot/templates/provider/mistral-config.yml.j2 +++ b/roles/custom/matrix-bot-baibot/templates/provider/mistral-config.yml.j2 @@ -10,4 +10,5 @@ text_generation: temperature: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_temperature | to_json }} max_response_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_max_response_tokens | int | to_json }} max_context_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_max_context_tokens | int | to_json }} + bot_tools: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_bot_tools | bool | to_json }} {% endif %} diff --git a/roles/custom/matrix-bot-baibot/templates/provider/openai-config.yml.j2 b/roles/custom/matrix-bot-baibot/templates/provider/openai-config.yml.j2 index f6a5d7631..b5fc65d4b 100644 --- a/roles/custom/matrix-bot-baibot/templates/provider/openai-config.yml.j2 +++ b/roles/custom/matrix-bot-baibot/templates/provider/openai-config.yml.j2 @@ -15,6 +15,7 @@ text_generation: max_completion_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_max_completion_tokens | int | to_json }} {% endif %} max_context_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_max_context_tokens | int | to_json }} + bot_tools: {{ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_bot_tools | bool | to_json }} tools: web_search: {{ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_tools_web_search | bool | to_json }} code_interpreter: {{ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_tools_code_interpreter | bool | to_json }} diff --git a/roles/custom/matrix-bot-baibot/templates/provider/venice-config.yml.j2 b/roles/custom/matrix-bot-baibot/templates/provider/venice-config.yml.j2 index 5cfd8352f..b7534825c 100644 --- a/roles/custom/matrix-bot-baibot/templates/provider/venice-config.yml.j2 +++ b/roles/custom/matrix-bot-baibot/templates/provider/venice-config.yml.j2 @@ -10,6 +10,7 @@ text_generation: temperature: {{ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_temperature | to_json }} max_response_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_max_response_tokens | int | to_json }} max_context_tokens: {{ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_max_context_tokens | int | to_json }} + bot_tools: {{ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_bot_tools | bool | to_json }} prompt_cache_retention: {{ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_prompt_cache_retention | to_json }} {% if matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_top_p is not none %} top_p: {{ matrix_bot_baibot_config_agents_static_definitions_venice_config_text_generation_top_p | to_json }}