feat: bot inbox (#77)

* feat: bot inbox

* feat: unified header

* fix: missing tool_call usage

* feat: add group name in header
This commit is contained in:
Acbox Liu
2026-02-22 01:27:24 +08:00
committed by GitHub
parent 2c6b5e5565
commit c591af14b0
42 changed files with 3367 additions and 260 deletions
+5 -1
View File
@@ -3,6 +3,7 @@ SELECT
bots.id AS bot_id,
bots.max_context_load_time,
bots.max_context_tokens,
bots.max_inbox_items,
bots.language,
bots.allow_guest,
chat_models.model_id AS chat_model_id,
@@ -21,6 +22,7 @@ WITH updated AS (
UPDATE bots
SET max_context_load_time = sqlc.arg(max_context_load_time),
max_context_tokens = sqlc.arg(max_context_tokens),
max_inbox_items = sqlc.arg(max_inbox_items),
language = sqlc.arg(language),
allow_guest = sqlc.arg(allow_guest),
chat_model_id = COALESCE(sqlc.narg(chat_model_id)::uuid, bots.chat_model_id),
@@ -29,12 +31,13 @@ WITH updated AS (
search_provider_id = COALESCE(sqlc.narg(search_provider_id)::uuid, bots.search_provider_id),
updated_at = now()
WHERE bots.id = sqlc.arg(id)
RETURNING bots.id, bots.max_context_load_time, bots.max_context_tokens, bots.language, bots.allow_guest, bots.chat_model_id, bots.memory_model_id, bots.embedding_model_id, bots.search_provider_id
RETURNING bots.id, bots.max_context_load_time, bots.max_context_tokens, bots.max_inbox_items, bots.language, bots.allow_guest, bots.chat_model_id, bots.memory_model_id, bots.embedding_model_id, bots.search_provider_id
)
SELECT
updated.id AS bot_id,
updated.max_context_load_time,
updated.max_context_tokens,
updated.max_inbox_items,
updated.language,
updated.allow_guest,
chat_models.model_id AS chat_model_id,
@@ -51,6 +54,7 @@ LEFT JOIN search_providers ON search_providers.id = updated.search_provider_id;
UPDATE bots
SET max_context_load_time = 1440,
max_context_tokens = 0,
max_inbox_items = 50,
language = 'auto',
allow_guest = false,
chat_model_id = NULL,