Compare commits

...

45 Commits

Author SHA1 Message Date
Slavi Pantaleev
ead70d71ff Prepare 1.21.1 release
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 10:07:16 +03:00
Slavi Pantaleev
49bb52a091 Update anthropic-rs fork to drop vulnerable rustls-webpki 0.101
The anthropic git dependency now uses reqwest 0.12 / rustls 0.23, pulling
rustls-webpki 0.103.13 instead of the 0.101.7 that was dragged in via the
old reqwest 0.11. This clears three RUSTSEC/Dependabot advisories:

- GHSA-82j2-j2ch-gfr8 (high): DoS via panic on malformed CRL BIT STRING
- GHSA-xgp8-3hg3-c2mh (low): name constraints accepted for wildcard names
- GHSA-965h-392x-2mh5 (low): name constraints for URI names incorrectly accepted

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 10:06:27 +03:00
Slavi Pantaleev
1fc2f0f65a Prepare 1.21.0 release
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 09:44:25 +03:00
Slavi Pantaleev
f7cb38b620 Fix clippy warnings in tests
- Avoid unwrap_or() on a statically-Some value by using the raw token count
- Use an array literal instead of vec! for the non-allocated test cases

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 09:41:00 +03:00
Slavi Pantaleev
04e7667d11 Default to gpt-image-2 for OpenAI image generation
Make gpt-image-2 the default image-generation model and add it to the
recognized model-id mapping, updating the sample provider configs to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 09:39:45 +03:00
Slavi Pantaleev
78cbfda481 Update Rust crate async-openai to 0.41.0
Adapt to upstream API changes:
- Handle the new ImageModel::GptImage2 variant in image-model match arms
- ImageSize dropped Copy (gained an Other(String) variant), so clone it

Supersedes #170.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 09:37:46 +03:00
renovate[bot]
36fd6a4dda Update Rust crate quick_cache to v0.6.23 2026-06-05 09:33:16 +03:00
renovate[bot]
1308196419 Update docker.io/ollama/ollama Docker tag to v0.30.5 2026-06-05 09:33:07 +03:00
renovate[bot]
b3546ebaf1 Update ghcr.io/element-hq/synapse Docker tag to v1.154.0 2026-06-04 18:50:24 +03:00
renovate[bot]
2499e6baca Update Rust crate chrono to v0.4.45 2026-06-04 18:50:01 +03:00
renovate[bot]
871b9d2f3b Update dependency prek to v0.4.4 2026-06-04 14:48:21 +03:00
renovate[bot]
4a36cf9446 Update docker.io/ollama/ollama Docker tag to v0.30.4 2026-06-04 07:13:27 +03:00
renovate[bot]
a2180452c9 Update docker.io/ollama/ollama Docker tag to v0.30.2 2026-06-03 07:39:57 +03:00
Slavi Pantaleev
0cb0fc18ce Prepare 1.20.0 release
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 23:05:29 +03:00
renovate[bot]
78bddac716 Update Rust crate tiktoken-rs to 0.12.* (#162)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-02 23:03:20 +03:00
Slavi Pantaleev
f7209221f6 Update matrix-sdk to v0.18.0 (and mxlink to v1.15.0)
matrix-sdk 0.18.0 introduces no breaking changes that affect baibot, but
it does require a matching mxlink release: mxlink 1.14.0 pins matrix-sdk
0.17.0, so without bumping mxlink the two matrix-sdk versions conflict.
mxlink 1.15.0 (released alongside this) tracks matrix-sdk 0.18.0, so we
bump the floor to >=1.15.0.

Verified locally: cargo build and the full test suite pass.

Supersedes Renovate PR #161.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 22:47:13 +03:00
renovate[bot]
5f2054e07f Update Rust crate async-openai to v0.40.3 2026-06-02 12:06:50 +03:00
renovate[bot]
8301c5a29f Update docker.io/ollama/ollama Docker tag to v0.30.0 2026-06-02 12:06:30 +03:00
Slavi Pantaleev
b325b6b1a5 Upgrade Rust (1.95.0 -> 1.96.0)
Bumps the base image in Dockerfile/Dockerfile.ci (via Renovate #158) and
keeps rust-toolchain.toml in sync, since rustup honors the toolchain file
inside the container build and would otherwise keep using 1.95.0.

Verified locally under 1.96.0: cargo check, clippy -D warnings, fmt check,
and cargo test --all-features all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 09:02:05 +03:00
renovate[bot]
0600721663 Update ghcr.io/element-hq/element-web Docker tag to v1.12.20 2026-05-27 20:50:26 +03:00
renovate[bot]
dc17cf7e96 Update ghcr.io/element-hq/element-web Docker tag to v1.12.19 2026-05-27 13:50:35 +03:00
Slavi Pantaleev
d6a8f6ba0b Prepare 1.19.3 release
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 10:09:11 +03:00
renovate[bot]
c4c3d71195 Update dependency prek to v0.4.3 2026-05-27 09:56:15 +03:00
renovate[bot]
84ae29d034 Update dependency prek to v0.4.2 2026-05-26 15:14:23 +03:00
renovate[bot]
447f43df7b Update Rust crate async-openai to v0.40.2 2026-05-22 23:11:28 +03:00
renovate[bot]
dabac790ad Update Rust crate async-openai to v0.40.1 2026-05-22 10:19:16 +03:00
renovate[bot]
fa01f012a1 Update Rust crate serde_json to v1.0.150 2026-05-22 10:19:05 +03:00
Slavi Pantaleev
20cb33bc66 Prepare 1.19.2 release
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 12:23:20 +03:00
Slavi Pantaleev
2791bdb08b Merge pull request #150 from etkecc/chore/update-dependencies
Update dependencies
2026-05-21 09:39:11 +03:00
Slavi Pantaleev
5dd505202a Update dependencies
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 09:33:28 +03:00
Slavi Pantaleev
d61078002c Merge pull request #149 from etkecc/renovate/async-openai-0.x
Update Rust crate async-openai to 0.40.0
2026-05-21 09:26:46 +03:00
renovate[bot]
cf5b346558 Update Rust crate async-openai to 0.40.0 2026-05-21 05:55:20 +00:00
renovate[bot]
ebbb6658e1 Update dependency prek to v0.4.1 2026-05-20 09:13:57 +03:00
renovate[bot]
369dc0c1ba Update ghcr.io/element-hq/synapse Docker tag to v1.153.0 2026-05-19 21:46:36 +03:00
renovate[bot]
3185f44a93 Update Rust crate quick_cache to v0.6.22 2026-05-18 07:32:20 +03:00
renovate[bot]
aa8ccde0ed Update docker.io/postgres Docker tag to v18.4 2026-05-15 12:48:23 +03:00
renovate[bot]
d5df0d7416 Update docker.io/ollama/ollama Docker tag to v0.24.0 2026-05-15 12:48:07 +03:00
renovate[bot]
140ca9ed68 Update dependency prek to v0.4.0 2026-05-14 16:40:26 +03:00
renovate[bot]
89d77d52b6 Update Rust crate async-openai to v0.38.2 2026-05-14 07:32:06 +03:00
renovate[bot]
5092700275 Update docker.io/ollama/ollama Docker tag to v0.23.4 2026-05-14 07:31:22 +03:00
renovate[bot]
10c365124e Update docker.io/ollama/ollama Docker tag to v0.23.3 2026-05-13 07:28:16 +03:00
renovate[bot]
08bdf4f7a2 Update ghcr.io/element-hq/element-web Docker tag to v1.12.18 2026-05-12 20:38:24 +03:00
Slavi Pantaleev
af557a7e45 Fix multi-arch manifest publish: use buildx imagetools
docker/build-push-action now wraps single-platform images in an OCI
image index (to carry provenance attestations), so the per-arch
`*-amd64`/`*-arm64` tags are manifest lists. `docker manifest create`
refuses manifest-list sources ("X is a manifest list"). Switch to
`docker buildx imagetools create`, which flattens index sources
correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:22:50 +03:00
renovate[bot]
fa7eb11b1d Update Rust crate async-openai to v0.38.1 2026-05-12 02:39:22 +03:00
Slavi Pantaleev
ff1e128f0e Fix versioned image publish under workflow_run trigger
e978d3c switched the publish trigger from `push` to `workflow_run` and
correctly migrated the `type=raw,value=latest` rule to read the upstream
head_branch from `github.event.workflow_run.*` — but left the
`type=semver,pattern={{raw}}` rule unchanged. That rule still reads
`github.ref`, which under workflow_run dispatch is always
`refs/heads/main` (the default branch where the workflow file lives),
not the triggering tag ref. As a result, no semver tag was extracted,
metadata-action produced no tags, and `buildx` failed with
"tag is needed when pushing to registry". The `latest` tag kept
publishing because its rule was migrated; versioned tags (v1.19.0,
v1.19.1) silently stopped publishing.

Pass the upstream head_branch to the semver rule explicitly via `value`,
gated by `enable` so it only fires for v* tags. Mirrors the migration
the raw rule already received.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 17:28:54 +03:00
18 changed files with 341 additions and 664 deletions

View File

@@ -34,7 +34,7 @@ jobs:
ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}
tags: | tags: |
type=raw,value=latest,enable=${{ github.event.workflow_run.head_branch == 'main' }} type=raw,value=latest,enable=${{ github.event.workflow_run.head_branch == 'main' }}
type=semver,pattern={{raw}} type=semver,pattern={{raw}},value=${{ github.event.workflow_run.head_branch }},enable=${{ startsWith(github.event.workflow_run.head_branch || '', 'v') }}
docker-build: docker-build:
if: | if: |
@@ -77,7 +77,7 @@ jobs:
with: with:
tags: | tags: |
type=raw,value=latest,enable=${{ github.event.workflow_run.head_branch == 'main' }} type=raw,value=latest,enable=${{ github.event.workflow_run.head_branch == 'main' }}
type=semver,pattern={{raw}} type=semver,pattern={{raw}},value=${{ github.event.workflow_run.head_branch }},enable=${{ startsWith(github.event.workflow_run.head_branch || '', 'v') }}
flavor: | flavor: |
latest=auto latest=auto
suffix=-${{ matrix.arch }},onlatest=true suffix=-${{ matrix.arch }},onlatest=true
@@ -121,5 +121,4 @@ jobs:
- name: Create and push manifest - name: Create and push manifest
run: | run: |
docker manifest create ${{ matrix.image }} ${{ matrix.image }}-amd64 ${{ matrix.image }}-arm64 docker buildx imagetools create -t ${{ matrix.image }} ${{ matrix.image }}-amd64 ${{ matrix.image }}-arm64
docker manifest push ${{ matrix.image }}

View File

@@ -1,3 +1,42 @@
# (2026-06-05) Version 1.21.1
- (**Security**) Update the [anthropic](https://github.com/etkecc/anthropic-rs) dependency to use [reqwest](https://crates.io/crates/reqwest) 0.12 / [rustls](https://crates.io/crates/rustls) 0.23, replacing the vulnerable `rustls-webpki` 0.101 line with 0.103.13. This resolves [`GHSA-82j2-j2ch-gfr8`](https://github.com/advisories/GHSA-82j2-j2ch-gfr8) (high — denial of service via panic on a malformed CRL), [`GHSA-xgp8-3hg3-c2mh`](https://github.com/advisories/GHSA-xgp8-3hg3-c2mh) and [`GHSA-965h-392x-2mh5`](https://github.com/advisories/GHSA-965h-392x-2mh5) (name-constraint validation issues).
# (2026-06-05) Version 1.21.0
- (**Improvement**) Default to OpenAI's `gpt-image-2` model for image generation (in newly-created OpenAI agents and the sample provider configs).
- (**Internal Improvement**) Update [async-openai](https://crates.io/crates/async-openai) from 0.40 to 0.41, which [resynchronizes with the upstream OpenAI API spec](https://github.com/64bit/async-openai/issues/557) after it had drifted out of sync — a mismatch that was already causing some breakage (hopefully now resolved). Adapts to the newly-added `gpt-image-2` image model and an `ImageSize` type change.
- (**Internal Improvement**) Dependency updates.
# (2026-06-02) Version 1.20.0
- (**Internal Improvement**) Update [matrix-sdk](https://crates.io/crates/matrix-sdk) from 0.17 to 0.18 and [mxlink](https://crates.io/crates/mxlink) to 1.15.0.
- (**Internal Improvement**) Update [tiktoken-rs](https://crates.io/crates/tiktoken-rs) to 0.12, backporting OpenAI [tiktoken](https://github.com/openai/tiktoken) 0.13.0 for better alignment with upstream tokenization behavior.
- (**Internal Improvement**) Bump the pinned Rust toolchain from 1.95.0 to 1.96.0 (in `rust-toolchain.toml` and the Docker build images).
- (**Internal Improvement**) Dependency updates.
# (2026-05-27) Version 1.19.3
- (**Internal Improvement**) Update [async-openai](https://crates.io/crates/async-openai) to 0.40.2, pulling in several upstream fixes (streaming HTTP error surfacing, default `ResponseTextParam.format` deserialization, etc.).
- (**Internal Improvement**) Dependency updates.
# (2026-05-21) Version 1.19.2
- (**Internal Improvement**) Update [async-openai](https://crates.io/crates/async-openai) to 0.40.0.
- (**Internal Improvement**) Dependency updates.
# (2026-05-09) Version 1.19.1 # (2026-05-09) Version 1.19.1
- (**Internal Improvement**) Update [async-openai](https://crates.io/crates/async-openai) to 0.38.0. - (**Internal Improvement**) Update [async-openai](https://crates.io/crates/async-openai) to 0.38.0.

904
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -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.19.1" version = "1.21.1"
edition = "2024" edition = "2024"
[lib] [lib]
@@ -17,14 +17,14 @@ path = "src/lib.rs"
[dependencies] [dependencies]
anthropic = { git = "https://github.com/etkecc/anthropic-rs.git", branch = "fix-content-block-image" } anthropic = { git = "https://github.com/etkecc/anthropic-rs.git", branch = "fix-content-block-image" }
anyhow = "1.0.*" anyhow = "1.0.*"
async-openai = { version = "0.38.0", features = ["audio", "chat-completion", "image", "responses"] } async-openai = { version = "0.41.0", features = ["audio", "chat-completion", "image", "responses"] }
base64 = "0.22.*" 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.
matrix-sdk = { version = "0.17.0", default-features = false } matrix-sdk = { version = "0.18.0", default-features = false }
mime_guess = "2.0.*" mime_guess = "2.0.*"
mxidwc = "1.0.*" mxidwc = "1.0.*"
mxlink = ">=1.14.0" mxlink = ">=1.15.0"
etke_openai_api_rust = "0.1.*" etke_openai_api_rust = "0.1.*"
quick_cache = "0.6.*" quick_cache = "0.6.*"
regex = "1.12.*" regex = "1.12.*"
@@ -32,7 +32,7 @@ serde = { version = "1.0.*", features = ["derive"], default-features = false }
serde_json = "1.0.*" serde_json = "1.0.*"
serde_yaml_ng = "0.10.*" serde_yaml_ng = "0.10.*"
tempfile = "3.27.*" tempfile = "3.27.*"
tiktoken-rs = { version = "0.11.*", default-features = false } tiktoken-rs = { version = "0.12.*", default-features = false }
tokio = { version = "1.52.*", features = ["rt", "rt-multi-thread", "macros"] } tokio = { version = "1.52.*", 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"] }

View File

@@ -4,7 +4,7 @@
# # # #
####################################### #######################################
FROM docker.io/rust:1.95.0-slim-trixie AS build FROM docker.io/rust:1.96.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

View File

@@ -4,7 +4,7 @@
# # # #
####################################### #######################################
FROM docker.io/rust:1.95.0-slim-trixie AS build FROM docker.io/rust:1.96.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

View File

@@ -21,7 +21,7 @@ text_to_speech:
speed: 1.0 speed: 1.0
response_format: opus response_format: opus
image_generation: image_generation:
model_id: gpt-image-1.5 model_id: gpt-image-2
style: null style: null
size: null size: null
quality: null quality: null

View File

@@ -111,7 +111,7 @@ agents:
# speed: 1.0 # speed: 1.0
# response_format: opus # response_format: opus
# image_generation: # image_generation:
# model_id: gpt-image-1.5 # model_id: gpt-image-2
# style: null # style: null
# size: null # size: null
# quality: null # quality: null

View File

@@ -1,6 +1,6 @@
services: services:
element-web: element-web:
image: ghcr.io/element-hq/element-web:v1.12.17 image: ghcr.io/element-hq/element-web:v1.12.20
user: "${UID}:${GID}" user: "${UID}:${GID}"
restart: unless-stopped restart: unless-stopped
environment: environment:

View File

@@ -1,6 +1,6 @@
services: services:
ollama: ollama:
image: docker.io/ollama/ollama:0.23.2 image: docker.io/ollama/ollama:0.30.5
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${SERVICE_OLLAMA_BIND_PORT_HTTP}:11434" - "${SERVICE_OLLAMA_BIND_PORT_HTTP}:11434"

View File

@@ -1,6 +1,6 @@
services: services:
postgres: postgres:
image: docker.io/postgres:18.3-alpine image: docker.io/postgres:18.4-alpine
user: ${UID}:${GID} user: ${UID}:${GID}
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -14,7 +14,7 @@ services:
- /etc/passwd:/etc/passwd:ro - /etc/passwd:/etc/passwd:ro
synapse: synapse:
image: ghcr.io/element-hq/synapse:v1.152.1 image: ghcr.io/element-hq/synapse:v1.154.0
user: "${UID}:${GID}" user: "${UID}:${GID}"
restart: unless-stopped restart: unless-stopped
entrypoint: python entrypoint: python

View File

@@ -1,5 +1,5 @@
[tools] [tools]
prek = "0.3.13" prek = "0.4.4"
[settings] [settings]
# Disable automatic trust prompts - we trust this config # Disable automatic trust prompts - we trust this config

View File

@@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "1.95.0" channel = "1.96.0"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]
profile = "default" profile = "default"

View File

@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::OPENAI_IMAGE_MODEL_GPT_IMAGE_1_DOT_5; use super::OPENAI_IMAGE_MODEL_GPT_IMAGE_2;
use crate::agent::{default_prompt, provider::ConfigTrait}; use crate::agent::{default_prompt, provider::ConfigTrait};
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -175,7 +175,7 @@ pub struct ImageGenerationConfig {
impl Default for ImageGenerationConfig { impl Default for ImageGenerationConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
model_id: OPENAI_IMAGE_MODEL_GPT_IMAGE_1_DOT_5.to_owned(), model_id: OPENAI_IMAGE_MODEL_GPT_IMAGE_2.to_owned(),
style: default_image_style(), style: default_image_style(),
size: default_image_size(), size: default_image_size(),
quality: default_image_quality(), quality: default_image_quality(),
@@ -193,6 +193,7 @@ impl ImageGenerationConfig {
"gpt-image-1" => Ok(async_openai::types::images::ImageModel::GptImage1), "gpt-image-1" => Ok(async_openai::types::images::ImageModel::GptImage1),
"gpt-image-1.5" => Ok(async_openai::types::images::ImageModel::GptImage1dot5), "gpt-image-1.5" => Ok(async_openai::types::images::ImageModel::GptImage1dot5),
"gpt-image-1-mini" => Ok(async_openai::types::images::ImageModel::GptImage1Mini), "gpt-image-1-mini" => Ok(async_openai::types::images::ImageModel::GptImage1Mini),
"gpt-image-2" => Ok(async_openai::types::images::ImageModel::GptImage2),
other => Ok(async_openai::types::images::ImageModel::Other( other => Ok(async_openai::types::images::ImageModel::Other(
other.to_owned(), other.to_owned(),
)), )),

View File

@@ -271,6 +271,7 @@ impl ControllerTrait for Controller {
ImageModel::GptImage1 => ImageModel::GptImage1Mini, ImageModel::GptImage1 => ImageModel::GptImage1Mini,
ImageModel::GptImage1dot5 => ImageModel::GptImage1Mini, ImageModel::GptImage1dot5 => ImageModel::GptImage1Mini,
ImageModel::GptImage1Mini => ImageModel::GptImage1Mini, ImageModel::GptImage1Mini => ImageModel::GptImage1Mini,
ImageModel::GptImage2 => ImageModel::GptImage1Mini,
ImageModel::Other(_) => ImageModel::DallE2, ImageModel::Other(_) => ImageModel::DallE2,
} }
} else { } else {
@@ -310,7 +311,7 @@ impl ControllerTrait for Controller {
let size = if params.smallest_size_possible { let size = if params.smallest_size_possible {
Some(get_sticker_size(&model)) Some(get_sticker_size(&model))
} else { } else {
image_generation_config.size image_generation_config.size.clone()
}; };
let response_format = match model.clone() { let response_format = match model.clone() {
@@ -321,6 +322,7 @@ impl ControllerTrait for Controller {
ImageModel::GptImage1 => None, ImageModel::GptImage1 => None,
ImageModel::GptImage1Mini => None, ImageModel::GptImage1Mini => None,
ImageModel::GptImage1dot5 => None, ImageModel::GptImage1dot5 => None,
ImageModel::GptImage2 => None,
ImageModel::Other(_) => Some(ImageResponseFormat::B64Json), ImageModel::Other(_) => Some(ImageResponseFormat::B64Json),
}; };
@@ -430,6 +432,7 @@ impl ControllerTrait for Controller {
ImageModel::GptImage1 => None, ImageModel::GptImage1 => None,
ImageModel::GptImage1Mini => None, ImageModel::GptImage1Mini => None,
ImageModel::GptImage1dot5 => None, ImageModel::GptImage1dot5 => None,
ImageModel::GptImage2 => None,
ImageModel::Other(_) => Some(ImageResponseFormat::B64Json), ImageModel::Other(_) => Some(ImageResponseFormat::B64Json),
}; };
@@ -647,6 +650,7 @@ fn get_sticker_size(model: &ImageModel) -> async_openai::types::images::ImageSiz
ImageModel::GptImage1 => ImageSize::S1024x1024, ImageModel::GptImage1 => ImageSize::S1024x1024,
ImageModel::GptImage1Mini => ImageSize::S1024x1024, ImageModel::GptImage1Mini => ImageSize::S1024x1024,
ImageModel::GptImage1dot5 => ImageSize::S1024x1024, ImageModel::GptImage1dot5 => ImageSize::S1024x1024,
ImageModel::GptImage2 => ImageSize::S1024x1024,
ImageModel::Other(_) => ImageSize::S1024x1024, ImageModel::Other(_) => ImageSize::S1024x1024,
} }
} }

View File

@@ -16,7 +16,7 @@ use super::super::AgentInstantiationResult;
use super::ConfigTrait; use super::ConfigTrait;
use super::controller::ControllerType; use super::controller::ControllerType;
pub const OPENAI_IMAGE_MODEL_GPT_IMAGE_1_DOT_5: &str = "gpt-image-1.5"; pub const OPENAI_IMAGE_MODEL_GPT_IMAGE_2: &str = "gpt-image-2";
pub fn create_controller_from_yaml_value_config( pub fn create_controller_from_yaml_value_config(
agent_id: &str, agent_id: &str,

View File

@@ -9,7 +9,7 @@ fn agent_config_parsing_works() {
let sample_config = crate::agent::default_config_for_provider(&provider); let sample_config = crate::agent::default_config_for_provider(&provider);
let sample_config_pretty_yaml = serde_yaml_ng::to_string(&sample_config).unwrap(); let sample_config_pretty_yaml = serde_yaml_ng::to_string(&sample_config).unwrap();
let test_cases = vec![ let test_cases = [
// Invalid input // Invalid input
TestCase { TestCase {
input: r#"Hello"#.to_owned(), input: r#"Hello"#.to_owned(),

View File

@@ -105,7 +105,8 @@ pub mod test {
let bpe = super::get_bpe_for_model(model); let bpe = super::get_bpe_for_model(model);
let max_response_tokens: Option<u32> = Some(5); let max_response_tokens_value: u32 = 5;
let max_response_tokens: Option<u32> = Some(max_response_tokens_value);
let prompt = super::Message { let prompt = super::Message {
author: super::Author::Prompt, author: super::Author::Prompt,
@@ -193,7 +194,7 @@ pub mod test {
&Some(prompt), &Some(prompt),
conversation_messages, conversation_messages,
max_response_tokens, max_response_tokens,
prompt_length + max_response_tokens.unwrap_or(0) + forth_length + third_length, prompt_length + max_response_tokens_value + forth_length + third_length,
); );
assert_eq!(2, new_conversation_messages.len()); assert_eq!(2, new_conversation_messages.len());
@@ -215,7 +216,8 @@ pub mod test {
let bpe = super::get_bpe_for_model(model); let bpe = super::get_bpe_for_model(model);
let max_response_tokens: Option<u32> = Some(5); let max_response_tokens_value: u32 = 5;
let max_response_tokens: Option<u32> = Some(max_response_tokens_value);
let prompt = super::Message { let prompt = super::Message {
author: super::Author::User, author: super::Author::User,
@@ -303,7 +305,7 @@ pub mod test {
&Some(prompt), &Some(prompt),
conversation_messages, conversation_messages,
max_response_tokens, max_response_tokens,
prompt_length + max_response_tokens.unwrap_or(0) + forth_length + third_length, prompt_length + max_response_tokens_value + forth_length + third_length,
); );
assert_eq!(2, new_conversation_messages.len()); assert_eq!(2, new_conversation_messages.len());