feat: FAM-Edge chat proxy + PyMySQL migration for FAM-UI + config update

- FAM-Edge: add /api/edge/chat proxy endpoint forwarding to local Ollama
  (Ollama port 11434 not exposed externally, FAM-Edge acts as reverse proxy)
- FAM-Core config: edge_url and ollama_url switched from Tailscale IP to
  Oracle public IP (Tailscale firewall blocking between NAS and Oracle)
- FAM-UI: migrate mysql.connector to PyMySQL (same as FAM-Core)
- FAM-UI: cursor(dictionary=True) replaced with cursorclass=DictCursor
- End-to-end chat verified: FAM-Core -> FAM-Edge proxy -> Ollama -> response
  Answer: 今天没有观察到张三 (no events in DB yet, expected)
This commit is contained in:
ericwyuan
2026-08-19 23:59:28 +08:00
parent c8cd2f2665
commit 94a8805045
4 changed files with 35 additions and 11 deletions

View File

@@ -1,5 +1,7 @@
# FAM-Core 配置文件 (NAS 端) - 实际部署配置
# Tailscale: NAS=100.70.234.39, Oracle=100.74.137.126
# 注: Tailscale 防火墙待修复,当前 edge_url 使用 Oracle 公网 IP
# Ollama 未对外暴露chat_handler 通过 FAM-Edge 代理
server:
host: "0.0.0.0"
@@ -22,7 +24,7 @@ scheduler:
dispatcher:
poll_interval: 30
edge_url: "http://100.74.137.126:5000/api/edge/video/analyze"
edge_url: "http://129.146.203.203:5000/api/edge/video/analyze"
webhook_url: "http://100.70.234.39:8000/api/core/callback/event"
max_retries: 3
@@ -32,6 +34,6 @@ video_server:
video_dir: "/volume1/surveillance"
chat_handler:
ollama_url: "http://100.74.137.126:11434/api/generate"
ollama_url: "http://129.146.203.203:5000/api/edge/chat"
model_name: "llava-phi3"
timeout: 120