fix: Ollama model validation, TUI CSS, WebUI overhaul

1. Ollama: validate model is configured before API call, show helpful error
2. TUI: remove unsupported scroll-behavior CSS property
3. WebUI server: add full tool calling loop (FC + JSON action)
4. WebUI HTML: complete redesign
   - Modern dark theme with better typography
   - Markdown rendering via marked.js
   - Tool call/result visualization with colored cards
   - Dynamic sidebar (engines + tools from server)
   - Better input area with gradient send button
   - Responsive layout
This commit is contained in:
xiaoli-cli-bot committed 2026-04-29 19:51:42 +08:00
1 parent baa2cbc49a
commit 7a72a5c69e
4 files changed
+415 -965

No files matched your search

+7
View File
@@ -122,6 +122,13 @@ Ollama AI引擎插件帮助信息
if not self.is_service_running:
return "错误:Ollama服务未运行,请启动Ollama服务后再使用此引擎."
# 检查模型是否已配置
if not self.model or not self.model.strip():
return ("错误:Ollama模型未配置。请执行以下操作:\n"
" 1. /engine.ollama models → 查看本地可用模型\n"
" 2. /engine.ollama set <模型名> → 设置要使用的模型\n"
" 或编辑 config.json 中 api.engines.ollama.model 字段")
# 如果有工具结果,将其作为上下文返回给AI处理
if tool_results:
tool_result_text = f"工具执行结果: {tool_results.get('result', '无结果')}"