feat(model): 添加流式配置支持并优化响应处理

This commit is contained in:
2026-05-30 22:08:46 +08:00
parent 558fd49ec1
commit c7e9eb889b
5 changed files with 288 additions and 56 deletions

View File

@@ -42,15 +42,8 @@ CREATE TABLE IF NOT EXISTS asynch_models (
remark TEXT DEFAULT '' -- 备注
response_token_field VARCHAR(128) NOT NULL DEFAULT ''; -- 响应中消耗token的字段映射
operator_name VARCHAR(64) NOT NULL DEFAULT '', -- 运营商名称
token_config JSONB NOT NULL DEFAULT '{
"zh_ratio": 1.0,
"en_ratio": 1.3,
"space_ratio": 0.1,
"punctuation_ratio": 0.1,
"max_window_size": 8192,
"reserve_ratio": 0.2,
"min_reserve": 512,
}'::jsonb -- Token配置
stream_config JSONB NOT NULL DEFAULT '{}'::jsonb, -- 流式配置
token_config JSONB NOT NULL DEFAULT '{}'::jsonb -- Token配置
extend_mapping JSONB NOT NULL DEFAULT '{}'::jsonb,
query_config JSONB NOT NULL DEFAULT '{}'::jsonb;
);