mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat: max context tokens
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
SELECT
|
||||
bots.id AS bot_id,
|
||||
bots.max_context_load_time,
|
||||
bots.max_context_tokens,
|
||||
bots.language,
|
||||
bots.allow_guest,
|
||||
chat_models.model_id AS chat_model_id,
|
||||
@@ -19,6 +20,7 @@ WHERE bots.id = $1;
|
||||
WITH updated AS (
|
||||
UPDATE bots
|
||||
SET max_context_load_time = sqlc.arg(max_context_load_time),
|
||||
max_context_tokens = sqlc.arg(max_context_tokens),
|
||||
language = sqlc.arg(language),
|
||||
allow_guest = sqlc.arg(allow_guest),
|
||||
chat_model_id = COALESCE(sqlc.narg(chat_model_id)::uuid, bots.chat_model_id),
|
||||
@@ -27,11 +29,12 @@ 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.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.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.language,
|
||||
updated.allow_guest,
|
||||
chat_models.model_id AS chat_model_id,
|
||||
@@ -47,6 +50,7 @@ LEFT JOIN search_providers ON search_providers.id = updated.search_provider_id;
|
||||
-- name: DeleteSettingsByBotID :exec
|
||||
UPDATE bots
|
||||
SET max_context_load_time = 1440,
|
||||
max_context_tokens = 0,
|
||||
language = 'auto',
|
||||
allow_guest = false,
|
||||
chat_model_id = NULL,
|
||||
|
||||
Reference in New Issue
Block a user