mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-09 17:50:23 +08:00
refactor(agent): consolidate provider preset resolution
This commit is contained in:
@@ -1200,6 +1200,8 @@ def _llm_provider_defaults(
|
||||
provider_definitions: list[dict[str, Any]],
|
||||
) -> dict[str, str]:
|
||||
normalized_provider = str(provider or "").strip().lower()
|
||||
if normalized_provider == "kimi-coding":
|
||||
normalized_provider = "moonshot"
|
||||
defaults = dict(LLM_PROVIDER_DEFAULTS.get(normalized_provider) or {})
|
||||
provider_meta = next(
|
||||
(
|
||||
@@ -1231,6 +1233,8 @@ def _llm_provider_meta(
|
||||
provider_definitions: list[dict[str, Any]],
|
||||
) -> dict[str, Any]:
|
||||
normalized_provider = str(provider or "").strip().lower()
|
||||
if normalized_provider == "kimi-coding":
|
||||
normalized_provider = "moonshot"
|
||||
provider_meta = next(
|
||||
(
|
||||
item
|
||||
@@ -1784,6 +1788,8 @@ def _collect_agent_config(
|
||||
provider_definitions = _load_llm_provider_definitions(runtime_python=runtime_python)
|
||||
provider_choices = _llm_provider_choice_map(provider_definitions)
|
||||
current_provider = _env_default("LLM_PROVIDER", "deepseek").lower()
|
||||
if current_provider == "kimi-coding":
|
||||
current_provider = "moonshot"
|
||||
if current_provider not in provider_choices:
|
||||
current_provider = "deepseek"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user