lzf_0626
d4e7e2672c
docs(25): 更正 P1 #2 的定性——模型自建客户端是基座能力缺口,不是违规
复核时发现原修复建议("改走 ModelGenerationService,或用 self.generate_with_model")
**前提不成立**:
- OpenAICompatibleGateway.generate(endpoint_code, prompt, timeout_ms) -> str
(model_gateway.py:57)与 ModelDispatchService.generate(endpoints, prompt) -> ModelExecution
(:248)都是"给一段 prompt、拿一段文本";ModelExecution 的字段只有
(endpoint_code, text, attempts, degraded)(:226-231)。
- 而风控需要的是 **messages 数组 + tools(function calling)+ 解析 tool_calls**,
基座完全没有这种形态的入口。
所以这不是"绕过",是基座缺能力时的补位,而且补得规矩:端点选择直接用基座的
DatabaseModelEndpointResolver;降级策略与 ModelDispatchService.generate 一致
(顺序尝试 + max_attempts 默认 2);错误映射也复用基座同一套
UpstreamTimeoutError / DependencyUnavailableError。
仍成立的两点:① bootstrap.py:262-265 的 lambda 让 model_client 注入点形同虚设,
无论走哪条路都该改;② HTTP 调用逻辑与 gateway 重复了一份,gateway 将来的限流/成本统计
风控享受不到。
**正确的修法比原建议大**:给基座**新增** chat(messages, tools) 形态的入口
(ModelGateway → OpenAICompatibleGateway → ModelDispatchService → ModelGenerationService
→ BaseAgent),再让风控改用。因为只是新增方法、不改现有行为,对已有 Agent 零影响;
但涉及基座核心链路,是否做需要项目方定,**本轮未实施**。
2026-09-11 13:43:46 +08:00
..
2026-09-10 15:55:54 +08:00
2026-09-09 21:55:37 +08:00
2026-09-11 11:42:53 +08:00
2026-09-09 21:55:37 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 15:55:54 +08:00
2026-09-09 21:55:37 +08:00
2026-09-09 21:55:37 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 15:55:54 +08:00
2026-09-09 21:55:37 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 18:18:00 +08:00
2026-09-09 23:40:35 +08:00
2026-09-09 23:40:35 +08:00
2026-09-09 23:40:35 +08:00
2026-09-09 23:40:35 +08:00
2026-09-09 23:40:35 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 18:18:00 +08:00
2026-09-10 15:55:54 +08:00
2026-09-10 18:18:00 +08:00
2026-09-11 09:49:21 +08:00
2026-09-10 18:35:52 +08:00
2026-09-10 21:36:23 +08:00
2026-09-11 09:33:48 +08:00
2026-09-11 13:43:46 +08:00
2026-09-10 15:55:54 +08:00
2026-09-09 21:55:37 +08:00