feat(aibox): batch D multi-model profiles + docs

- models 配置节:多 OpenAI Chat Completions 兼容端点按档案名切换,默认空 dict 零破坏回退旧 api 节
- --model 双语义:档案名(命中 models 节完整采用)/ 裸模型名(同端点换模型)
- resolve_api_key 档案级 env 三级语义:未配置回退 api.api_key_env / 显式名称 / 空串免密(Ollama/vLLM)
- 档案级 reasoning_enabled 附加 client 属性,DeepSeekChat._reasoning_enabled 优先读取
- llm_client 增加 openai_compatible/openai provider 别名
- README 更新:aibox/README 六处(特性/配置/多模型档案专节/CLI 参数/更新日志 v3.2/测试计数 264)+ 根 README aibox 小节
- 单测 17 项新增(test_models_profile.py),全套 264 项全过
This commit is contained in:
qing committed 2026-08-17 16:58:33 +08:00
1 parent a5af4bb404
commit d03dbc7f91
7 files changed
+426 -26

No files matched your search

+8 -2
View File
@@ -934,6 +934,12 @@ class DeepSeekChat:
except Exception:
pass
def _reasoning_enabled(self) -> bool:
"""思考模式开关:客户端带档案级 reasoning_enabled 属性时优先(多模型档案),否则用全局配置"""
return getattr(self.client, "reasoning_enabled", None) \
if getattr(self.client, "reasoning_enabled", None) is not None \
else constants.REASONING_ENABLED
def _is_cancelled(self) -> bool:
"""检查是否已被取消。"""
return self._cancel_event.is_set()
@@ -1451,7 +1457,7 @@ class DeepSeekChat:
# 工具调用后的递归继续(is_continuation=True)时不重复发送"思考中"提示,
# 因为前端已处于活跃AI状态,重复提示会导致冗余/重复输出
output_callback("line", f"\n{i18n.get('thinking', current_time)}\n")
if constants.REASONING_ENABLED:
if self._reasoning_enabled():
output_callback("reasoning_start", "🤔 思考中...")
else:
# 普通模式先显示助手前缀
@@ -1476,7 +1482,7 @@ class DeepSeekChat:
temperature=self.temperature,
max_tokens=constants.DEFAULT_MAX_TOKENS,
tools=tools,
reasoning_enabled=constants.REASONING_ENABLED,
reasoning_enabled=self._reasoning_enabled(),
):
# 流式循环中检查取消信号
if self._is_cancelled():