feat(agent): enhance LLM config loading with priority system

Refactor model factory to support three configuration sources in priority order:
1. Direct llm_config dictionary parameter
2. Fetch from llm_model_configs system via connector_factory (requires user_id and jwt_token)
3. Environment variables as fallback for backward compatibility

This improves flexibility by allowing runtime configuration while maintaining compatibility with existing environment-based setups.
This commit is contained in:
YueGuobin committed 2026-03-04 00:47:35 +08:00
1 parent 15dc1e7ea0
commit db9db56e7a
3 files changed
+162 -313

No files matched your search

@@ -31,6 +31,7 @@ from .connector_factory import (
get_gns3_connector,
get_gns3_connector_with_llm_config,
get_gns3_server_host,
get_llm_config,
)
from .custom_gns3fy import (
CONSOLE_TYPES,
@@ -98,6 +99,7 @@ __all__ = [
"get_gns3_connector",
"get_gns3_connector_with_llm_config",
"get_gns3_server_host",
"get_llm_config",
"add_file_to_index",
"get_file_list",
]