refactor: 客服agent的切片结构调整重构

This commit is contained in:
2026-09-11 17:31:16 +08:00
parent b1b764eac9
commit e561c97a4e
20 changed files with 3309 additions and 230 deletions
+1
View File
@@ -24,6 +24,7 @@ def client() -> aioredis.Redis:
retry=Retry(FullJitterBackoff(base=1, cap=10), retries=3),
max_connections=settings.redis.max_connections,
decode_responses=True,
protocol=2, # redis-py 8 默认 RESP3(HELLO 3),Redis < 6.0 不支持
)
return _client
+11 -10
View File
@@ -86,16 +86,17 @@ class MilvusCfg(BaseSettings):
class LLMCfg(BaseSettings):
"""大模型配置:本地 Ollama / OpenAI 兼容 API 双模式见 tool/llm.py。"""
mode: str
# —— 本地 Ollama ——
ollama_base: str
ollama_chat_model: str
ollama_embed_model: str
# —— OpenAI 兼容 API(base_url 以 /v1 结尾)——
api_base: str
api_key: str
api_chat_model: str
api_embed_model: str
mode: str = "auto" # auto=本地优先、API 兜底(按下方参数是否填写自动判定);ollama / api=强制单一后端
# —— 本地 Ollama(base + chat_model 填写即启用)——
ollama_base: str = ""
ollama_chat_model: str = ""
ollama_embed_model: str = ""
# —— OpenAI 兼容 API(api_key + base + chat_model 填写即启用;base_url 以 /v1 结尾)——
api_base: str = ""
api_key: str = ""
api_chat_model: str = ""
api_embed_model: str = ""
embed_dimensions: int # 向量维度:既作为 embeddings 请求的 dimensions 参数,也是 Milvus 建表/入库校验的维度;须与模型输出一致(MRL 模型如 qwen3-embedding 可任选 32~4096)
# —— 通用超参 ——
temperature: float
max_tokens: int