Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
265ad7e1cb | ||
|
|
a159f67e45 | ||
|
|
624b9de35b | ||
|
|
941bf7ca42 | ||
|
|
ef0f1671da | ||
|
|
b43f61f5ff |
@@ -1,3 +1,11 @@
|
|||||||
|
# (2025-09-08) Version 1.8.0
|
||||||
|
|
||||||
|
- (**Internal Improvement**) Upgrade [mxlink](https://crates.io/crates/mxlink) (1.9.0 -> 1.10.0) and [matrix-sdk](https://crates.io/crates/matrix-sdk) (0.13.0 -> 0.14.0)
|
||||||
|
|
||||||
|
- (**Internal Improvement**) Upgrade [Rust](https://www.rust-lang.org/) (1.88.0 -> 1.89.0)
|
||||||
|
|
||||||
|
- (**Internal Improvement**) Upgrade Debian base for container images (12/bookworm -> 13/trixie)
|
||||||
|
|
||||||
# (2025-07-11) Version 1.7.6
|
# (2025-07-11) Version 1.7.6
|
||||||
|
|
||||||
- (**Internal Improvement**) Dependency updates. This version is based on [mxlink](https://crates.io/crates/mxlink)@1.9.0 (which is based on the newly released [matrix-sdk](https://crates.io/crates/matrix-sdk)@[0.13.0](https://github.com/matrix-org/matrix-rust-sdk/releases/tag/matrix-sdk-0.13.0), which contains fixes for some security vulnerabilities)
|
- (**Internal Improvement**) Dependency updates. This version is based on [mxlink](https://crates.io/crates/mxlink)@1.9.0 (which is based on the newly released [matrix-sdk](https://crates.io/crates/matrix-sdk)@[0.13.0](https://github.com/matrix-org/matrix-rust-sdk/releases/tag/matrix-sdk-0.13.0), which contains fixes for some security vulnerabilities)
|
||||||
|
|||||||
1274
Cargo.lock
generated
1274
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
10
Cargo.toml
@@ -7,7 +7,7 @@ license = "AGPL-3.0-or-later"
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = ["matrix", "chat", "bot", "AI", "LLM"]
|
keywords = ["matrix", "chat", "bot", "AI", "LLM"]
|
||||||
include = ["/etc/assets/baibot-torso-768.png", "/src", "/README.md", "/CHANGELOG.md", "/LICENSE"]
|
include = ["/etc/assets/baibot-torso-768.png", "/src", "/README.md", "/CHANGELOG.md", "/LICENSE"]
|
||||||
version = "1.7.6"
|
version = "1.8.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
@@ -22,18 +22,18 @@ base64 = "0.22.*"
|
|||||||
chrono = { version = "0.4.*", default-features = false, features = ["std", "now"] }
|
chrono = { version = "0.4.*", default-features = false, features = ["std", "now"] }
|
||||||
# We'd rather not depend on this, but we cannot use the ruma-events EventContent macro without it.
|
# We'd rather not depend on this, but we cannot use the ruma-events EventContent macro without it.
|
||||||
# We add the `native-tls` feature, because of https://github.com/etkecc/rust-mxlink/issues/1
|
# We add the `native-tls` feature, because of https://github.com/etkecc/rust-mxlink/issues/1
|
||||||
matrix-sdk = { version = "0.13.0", default-features = false, features = ["native-tls"] }
|
matrix-sdk = { version = "0.14.0", default-features = false, features = ["native-tls"] }
|
||||||
mxidwc = "1.0.*"
|
mxidwc = "1.0.*"
|
||||||
mxlink = ">=1.9.0"
|
mxlink = ">=1.10.0"
|
||||||
etke_openai_api_rust = "0.1.*"
|
etke_openai_api_rust = "0.1.*"
|
||||||
quick_cache = "0.6.*"
|
quick_cache = "0.6.*"
|
||||||
regex = "1.11.*"
|
regex = "1.11.*"
|
||||||
serde = { version = "1.0.*", features = ["derive"], default-features = false }
|
serde = { version = "1.0.*", features = ["derive"], default-features = false }
|
||||||
serde_json = "1.0.*"
|
serde_json = "1.0.*"
|
||||||
serde_yaml = "0.9.*"
|
serde_yaml = "0.9.*"
|
||||||
tempfile = "3.20.*"
|
tempfile = "3.21.*"
|
||||||
tiktoken-rs = { version = "0.7.*", default-features = false }
|
tiktoken-rs = { version = "0.7.*", default-features = false }
|
||||||
tokio = { version = "1.45.*", features = ["rt", "rt-multi-thread", "macros"] }
|
tokio = { version = "1.47.*", features = ["rt", "rt-multi-thread", "macros"] }
|
||||||
tracing = "0.1.*"
|
tracing = "0.1.*"
|
||||||
tracing-subscriber = { version = "0.3.*", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.*", features = ["env-filter"] }
|
||||||
url = "2.5.*"
|
url = "2.5.*"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# #
|
# #
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
FROM docker.io/rust:1.88.0-slim-bookworm AS build
|
FROM docker.io/rust:1.89.0-slim-trixie AS build
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev
|
RUN apt-get update && apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ RUN --mount=type=cache,target=/target,sharing=locked \
|
|||||||
# #
|
# #
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
FROM docker.io/debian:bookworm-slim
|
FROM docker.io/debian:trixie-slim
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y ca-certificates sqlite3 && \
|
RUN apt-get update && apt-get install -y ca-certificates sqlite3 && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# #
|
# #
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
FROM docker.io/rust:1.88.0-slim-bookworm AS build
|
FROM docker.io/rust:1.89.0-slim-trixie AS build
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev
|
RUN apt-get update && apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ RUN cargo build --release
|
|||||||
# #
|
# #
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
FROM docker.io/debian:bookworm-slim
|
FROM docker.io/debian:trixie-slim
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y ca-certificates sqlite3 && \
|
RUN apt-get update && apt-get install -y ca-certificates sqlite3 && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
base_url: https://api.openai.com/v1
|
base_url: https://api.openai.com/v1
|
||||||
api_key: YOUR_API_KEY_HERE
|
api_key: YOUR_API_KEY_HERE
|
||||||
text_generation:
|
text_generation:
|
||||||
model_id: gpt-4.1
|
model_id: gpt-5
|
||||||
prompt: "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 }}."
|
prompt: "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 }}."
|
||||||
temperature: 1.0
|
temperature: 1.0
|
||||||
max_response_tokens: 16384
|
max_response_tokens: 16384
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ agents:
|
|||||||
# base_url: https://api.openai.com/v1
|
# base_url: https://api.openai.com/v1
|
||||||
# api_key: ""
|
# api_key: ""
|
||||||
# text_generation:
|
# text_generation:
|
||||||
# model_id: gpt-4.1
|
# model_id: gpt-5
|
||||||
# prompt: "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 }}."
|
# prompt: "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 }}."
|
||||||
# temperature: 1.0
|
# temperature: 1.0
|
||||||
# max_response_tokens: 16384
|
# max_response_tokens: ~
|
||||||
# # Reasoning models need to use `max_completion_tokens` instead of `max_response_tokens`.
|
# # Reasoning models need to use `max_completion_tokens` instead of `max_response_tokens`.
|
||||||
# max_completion_tokens: ~
|
# max_completion_tokens: 128000
|
||||||
# max_context_tokens: 128000
|
# max_context_tokens: 400000
|
||||||
# speech_to_text:
|
# speech_to_text:
|
||||||
# model_id: whisper-1
|
# model_id: whisper-1
|
||||||
# text_to_speech:
|
# text_to_speech:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: docker.io/postgres:16.8-alpine
|
image: docker.io/postgres:17.6-alpine
|
||||||
user: ${UID}:${GID}
|
user: ${UID}:${GID}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@@ -13,7 +13,7 @@ services:
|
|||||||
- /etc/passwd:/etc/passwd:ro
|
- /etc/passwd:/etc/passwd:ro
|
||||||
|
|
||||||
synapse:
|
synapse:
|
||||||
image: ghcr.io/element-hq/synapse:v1.129.0
|
image: ghcr.io/element-hq/synapse:v1.137.0
|
||||||
user: "${UID}:${GID}"
|
user: "${UID}:${GID}"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
entrypoint: python
|
entrypoint: python
|
||||||
@@ -26,7 +26,7 @@ services:
|
|||||||
- ./synapse/media-store:/media-store
|
- ./synapse/media-store:/media-store
|
||||||
|
|
||||||
element-web:
|
element-web:
|
||||||
image: ghcr.io/element-hq/element-web:v1.11.100
|
image: ghcr.io/element-hq/element-web:v1.11.110
|
||||||
user: "${UID}:${GID}"
|
user: "${UID}:${GID}"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
ollama:
|
ollama:
|
||||||
image: docker.io/ollama/ollama:0.6.8
|
image: docker.io/ollama/ollama:0.11.10
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "${SERVICE_OLLAMA_BIND_PORT_HTTP}:11434"
|
- "${SERVICE_OLLAMA_BIND_PORT_HTTP}:11434"
|
||||||
|
|||||||
@@ -72,15 +72,15 @@ impl Default for TextGenerationConfig {
|
|||||||
model_id: default_text_model_id(),
|
model_id: default_text_model_id(),
|
||||||
prompt: Some(default_prompt().to_owned()),
|
prompt: Some(default_prompt().to_owned()),
|
||||||
temperature: super::super::default_temperature(),
|
temperature: super::super::default_temperature(),
|
||||||
max_response_tokens: Some(16_384),
|
max_response_tokens: None,
|
||||||
max_completion_tokens: None,
|
max_completion_tokens: Some(128_000),
|
||||||
max_context_tokens: 128_000,
|
max_context_tokens: 400_000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_text_model_id() -> String {
|
fn default_text_model_id() -> String {
|
||||||
"gpt-4.1".to_owned()
|
"gpt-5".to_owned()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use mxlink::matrix_sdk::media::{MediaFormat, MediaRequestParameters};
|
|||||||
use mxlink::matrix_sdk::ruma::{
|
use mxlink::matrix_sdk::ruma::{
|
||||||
MilliSecondsSinceUnixEpoch, OwnedUserId, events::room::MediaSource,
|
MilliSecondsSinceUnixEpoch, OwnedUserId, events::room::MediaSource,
|
||||||
};
|
};
|
||||||
|
use mxlink::matrix_sdk::ruma::api::client::profile::{AvatarUrl, DisplayName};
|
||||||
|
|
||||||
use mxlink::{
|
use mxlink::{
|
||||||
InitConfig, LoginConfig, LoginCredentials, LoginEncryption, MatrixLink, PersistenceConfig,
|
InitConfig, LoginConfig, LoginCredentials, LoginEncryption, MatrixLink, PersistenceConfig,
|
||||||
@@ -285,24 +286,27 @@ impl Bot {
|
|||||||
async fn do_prepare_profile(&self) -> anyhow::Result<()> {
|
async fn do_prepare_profile(&self) -> anyhow::Result<()> {
|
||||||
tracing::debug!("Preparing profile..");
|
tracing::debug!("Preparing profile..");
|
||||||
|
|
||||||
|
let desired_display_name = self.inner.config.user.name.clone();
|
||||||
|
|
||||||
let account = self.inner.matrix_link.client().account();
|
let account = self.inner.matrix_link.client().account();
|
||||||
let media = self.inner.matrix_link.client().media();
|
let media = self.inner.matrix_link.client().media();
|
||||||
|
|
||||||
let desired_display_name = self.inner.config.user.name.clone();
|
|
||||||
|
|
||||||
let profile = account
|
let profile = account
|
||||||
.fetch_user_profile()
|
.fetch_user_profile()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| anyhow::anyhow!("Failed fetching profile: {:?}", e))?;
|
.map_err(|e| anyhow::anyhow!("Failed fetching profile: {:?}", e))?;
|
||||||
|
|
||||||
let should_update_display_name = match &profile.displayname {
|
let current_display_name = profile.get_static::<DisplayName>()?;
|
||||||
|
let current_avatar_url = profile.get_static::<AvatarUrl>()?;
|
||||||
|
|
||||||
|
let should_update_display_name = match ¤t_display_name {
|
||||||
Some(displayname) => displayname != &desired_display_name,
|
Some(displayname) => displayname != &desired_display_name,
|
||||||
None => true,
|
None => true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if should_update_display_name {
|
if should_update_display_name {
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
?profile.displayname,
|
?current_display_name,
|
||||||
?desired_display_name,
|
?desired_display_name,
|
||||||
"Updating display name.."
|
"Updating display name.."
|
||||||
);
|
);
|
||||||
@@ -312,7 +316,7 @@ impl Bot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let should_update_avatar = match &profile.avatar_url {
|
let should_update_avatar = match ¤t_avatar_url {
|
||||||
Some(avatar_url) => {
|
Some(avatar_url) => {
|
||||||
let request = MediaRequestParameters {
|
let request = MediaRequestParameters {
|
||||||
source: MediaSource::Plain(avatar_url.to_owned()),
|
source: MediaSource::Plain(avatar_url.to_owned()),
|
||||||
|
|||||||
Reference in New Issue
Block a user