Compare commits

...

4 Commits

Author SHA1 Message Date
Slavi Pantaleev
482861fce1
Merge pull request #3523 from spantaleev/renovate/matrixdotorg-mjolnir-1.x
Update matrixdotorg/mjolnir Docker tag to v1.7.0
2024-09-12 22:13:27 +03:00
renovate[bot]
9ac29e7055
Update matrixdotorg/mjolnir Docker tag to v1.7.0 2024-09-12 18:34:27 +00:00
Slavi Pantaleev
00910248d2 Add baibot preset for Mistral 2024-09-12 21:33:39 +03:00
Slavi Pantaleev
74cc935ea6 Minor rewording 2024-09-12 20:53:19 +03:00
6 changed files with 102 additions and 3 deletions

View File

@ -4,9 +4,9 @@
The playbook now supports installing [baibot](./docs/configuring-playbook-bot-baibot.md) (pronounced bye-bot) - a [Matrix](https://matrix.org/) bot developed by [etke.cc](https://etke.cc/) that exposes the power of [AI](https://en.wikipedia.org/wiki/Artificial_intelligence) / [Large Language Models](https://en.wikipedia.org/wiki/Large_language_model) to you. 🤖
It supports [OpenAI](https://openai.com/)'s [ChatGPT](https://openai.com/blog/chatgpt/) models, as many well as other [☁️ providers](https://github.com/etkecc/baibot/blob/main/docs/providers.md).
It supports [OpenAI](https://openai.com/)'s [ChatGPT](https://openai.com/blog/chatgpt/) models, as well as many other [☁️ providers](https://github.com/etkecc/baibot/blob/main/docs/providers.md).
It's designed as a more private and [✨ featureful](https://github.com/etkecc/baibot/?tab=readme-ov-file#-features) alternative to [matrix-chatgpt-bot](./docs/configuring-playbook-bot-chatgpt.md).
It's designed as a more private and [✨ featureful](https://github.com/etkecc/baibot/?tab=readme-ov-file#-features) alternative to the now-unmaintained [matrix-chatgpt-bot](./docs/configuring-playbook-bot-chatgpt.md).
To get started, see the [Setting up baibot](./docs/configuring-playbook-bot-baibot.md) documentation page.

View File

@ -191,6 +191,30 @@ If you'd like to use more than one model, take a look at the [Configuring additi
💡 You may also wish to use this new agent for [🤝 Configuring initial default handlers](#-configuring-initial-default-handlers).
#### Mistral
You can statically-define a single [🤖 agent](https://github.com/etkecc/baibot/blob/main/docs/agents.md) instance powered by the [🇫🇷 Mistral provider](https://github.com/etkecc/baibot/blob/main/docs/providers.md#mistral) with the help of the playbook's preset variables.
Here's an example **addition** to your `vars.yml` file:
```yml
matrix_bot_baibot_config_agents_static_definitions_mistral_enabled: true
matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key: "YOUR_API_KEY_HERE"
# Uncomment and adjust if you're not happy with these defaults:
# matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id: mistral-large-latest
# See `defaults/main.yml` in the baibot role for more configuration options.
```
Because this is a [statically](https://github.com/etkecc/baibot/blob/main/docs/configuration/README.md#static-configuration)-defined agent, it will be given a `static/` ID prefix and will be named `static/mistral`.
If you'd like to use more than one model, take a look at the [Configuring additional agents (without a preset)](#configuring-additional-agents-without-a-preset) section below.
💡 You may also wish to use this new agent for [🤝 Configuring initial default handlers](#-configuring-initial-default-handlers).
#### OpenAI
You can statically-define a single [🤖 agent](https://github.com/etkecc/baibot/blob/main/docs/agents.md) instance powered by the [OpenAI provider](https://github.com/etkecc/baibot/blob/main/docs/providers.md#openai) with the help of the playbook's preset variables.

View File

@ -141,6 +141,12 @@ matrix_bot_baibot_config_agents_static_definitions_auto: |-
'config': matrix_bot_baibot_config_agents_static_definitions_groq_config,
}] if matrix_bot_baibot_config_agents_static_definitions_groq_enabled else [])
+
([{
'id': matrix_bot_baibot_config_agents_static_definitions_mistral_id,
'provider': matrix_bot_baibot_config_agents_static_definitions_mistral_provider,
'config': matrix_bot_baibot_config_agents_static_definitions_mistral_config,
}] if matrix_bot_baibot_config_agents_static_definitions_mistral_enabled else [])
+
([{
'id': matrix_bot_baibot_config_agents_static_definitions_openai_id,
'provider': matrix_bot_baibot_config_agents_static_definitions_openai_provider,
@ -259,6 +265,59 @@ matrix_bot_baibot_config_agents_static_definitions_groq_config_speech_to_text_mo
########################################################################################
########################################################################################
# #
# Mistral agent configuration #
# #
########################################################################################
matrix_bot_baibot_config_agents_static_definitions_mistral_enabled: false
matrix_bot_baibot_config_agents_static_definitions_mistral_id: mistral
matrix_bot_baibot_config_agents_static_definitions_mistral_provider: mistral
matrix_bot_baibot_config_agents_static_definitions_mistral_config: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_yaml | from_yaml | combine(matrix_bot_baibot_config_agents_static_definitions_mistral_config_extension, recursive=True)}}"
matrix_bot_baibot_config_agents_static_definitions_mistral_config_yaml: "{{ lookup('template', 'templates/provider/mistral-config.yml.j2') }}"
matrix_bot_baibot_config_agents_static_definitions_mistral_config_extension: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_extension_yaml | from_yaml if matrix_bot_baibot_config_agents_static_definitions_mistral_config_extension_yaml | from_yaml is mapping else {} }}"
matrix_bot_baibot_config_agents_static_definitions_mistral_config_extension_yaml: |
# Your custom YAML configuration for this provider's configuration goes here.
# This configuration extends the default starting configuration (`matrix_bot_baibot_config_agents_static_definitions_mistral_config`).
#
# You can override individual variables from the default configuration, or introduce new ones.
#
# If you need something more special, you can take full control by
# completely redefining `matrix_bot_baibot_config_agents_static_definitions_mistral_config_yaml`.
#
# Example configuration extension follows:
#
# text_generation:
# temperature: 3.5
matrix_bot_baibot_config_agents_static_definitions_mistral_config_base_url: https://api.mistral.ai/v1
matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key: ""
matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_enabled: true
# For valid model choices, see: https://platform.mistral.com/docs/models
matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id: mistral-large-latest
# The prompt text to use (can be null or empty to not use a prompt).
# See: https://huggingface.co/docs/transformers/en/tasks/prompting
matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_prompt: null
# The temperature parameter controls the randomness of the generated text.
# See: https://blogs.novita.ai/what-are-large-language-model-settings-temperature-top-p-and-max-tokens/#what-is-llm-temperature
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
########################################################################################
# #
# /Mistral agent configuration #
# #
########################################################################################
########################################################################################
# #
# OpenAI agent configuration #

View File

@ -16,6 +16,9 @@
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_groq_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_groq_enabled }}"}
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_model_id', when: "{{ matrix_bot_baibot_config_agents_static_definitions_groq_enabled and matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_enabled }}"}
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_enabled }}"}
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id', when: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_enabled and matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_enabled }}"}
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_openai_enabled }}"}
- name: Fail if admin patterns list is empty

View File

@ -0,0 +1,13 @@
#jinja2: lstrip_blocks: "True"
base_url: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_base_url | to_json }}
api_key: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key | to_json }}
{% if matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_enabled %}
text_generation:
model_id: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id | to_json }}
prompt: {{ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_prompt | to_json }}
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 }}
{% endif %}

View File

@ -5,7 +5,7 @@
matrix_bot_mjolnir_enabled: true
# renovate: datasource=docker depName=matrixdotorg/mjolnir
matrix_bot_mjolnir_version: "v1.6.5"
matrix_bot_mjolnir_version: "v1.7.0"
matrix_bot_mjolnir_container_image_self_build: false
matrix_bot_mjolnir_container_image_self_build_repo: "https://github.com/matrix-org/mjolnir.git"