fix: NVIDIA single-frame JSON parsing + Gemini timeout/circuit breaker tuning

NVIDIA fix:
- Replace parse_vlm_json (requires full schema: global_summary/entities_json/
  frame_details/compute_provider) with lightweight _parse_single_frame_json
  that only extracts per-frame fields (person/action/clothing/etc)
- Root cause: NVIDIA adapter does per-frame analysis returning single-frame
  JSON, but parse_vlm_json rejected it for missing full-schema fields
- Verified: task 297 → 6/6 frames parsed successfully, first SUCCESS

Gemini + circuit breaker tuning:
- Gemini timeout: 30s → 90s (multi-image vision analysis needs more time)
- NVIDIA timeout: 20s → 30s (per-frame API call)
- Circuit breaker threshold: 3 → 5 (less aggressive tripping)
- Circuit breaker cooldown: 600s → 300s (faster recovery)
This commit is contained in:
ericwyuan
2026-08-20 11:02:26 +08:00
parent 2e43afb6b2
commit 853cb21542
2 changed files with 34 additions and 11 deletions

View File

@@ -54,11 +54,11 @@ models:
enabled: true
model_name: "gemini-flash-latest" # v1beta 下 gemini-1.5-flash 会 404
api_key: "${GEMINI_API_KEY}"
timeout: 30
timeout: 90
circuit_breaker:
enabled: true
threshold: 3
cooldown: 600
threshold: 5
cooldown: 300
- provider: "nvidia"
role: "vision"
@@ -66,11 +66,11 @@ models:
model_name: "meta/llama-3.2-11b-vision-instruct"
base_url: "https://integrate.api.nvidia.com/v1"
api_key: "${NVIDIA_API_KEY}"
timeout: 20
timeout: 30
circuit_breaker:
enabled: true
threshold: 3
cooldown: 600
threshold: 5
cooldown: 300
# 本地模型:纯文本 qwen2.5:7b仅参与智能问答作为 Gemini/NVIDIA 都失败时的兜底
- provider: "ollama"