bug fixed in auto navigate for ellipse

This commit is contained in:
abnerhexu
2026-01-24 11:05:52 +08:00
parent 26b1a62566
commit 9b05507c5e
4 changed files with 395 additions and 38 deletions

33
main.py
View File

@@ -481,15 +481,30 @@ class UAVAgentGUI:
api_key = str(config.get("api_key", "") or "").strip()
# Determine provider type
if provider_type == "ollama":
llm_provider = "ollama"
llm_base_url = None
else:
if "api.openai.com" in base_url:
llm_provider = "openai"
else:
llm_provider = "openai-compatible"
llm_base_url = base_url or None
match provider_type:
case "ollama":
llm_provider = "ollama"
llm_base_url = None
case "openai-compatible":
if "api.openai.com" in base_url:
llm_provider = "openai"
else:
llm_provider = "openai-compatible"
llm_base_url = base_url or None
case "anthropic-compatible":
llm_provider = "anthropic-compatible"
llm_base_url = base_url or None
case _:
raise ValueError(f"Unknown provider type: {provider_type}")
# if provider_type == "ollama":
# llm_provider = "ollama"
# llm_base_url = None
# else:
# if "api.openai.com" in base_url:
# llm_provider = "openai"
# else:
# llm_provider = "openai-compatible"
# llm_base_url = base_url or None
# Check API key requirement
if config.get("requires_api_key") and not api_key: