diff --git a/df-llm-agent/llm_agent_app/llm_agent_config.py b/df-llm-agent/llm_agent_app/llm_agent_config.py index 07f4819..9e5f8af 100644 --- a/df-llm-agent/llm_agent_app/llm_agent_config.py +++ b/df-llm-agent/llm_agent_app/llm_agent_config.py @@ -4,6 +4,8 @@ from database import db_models from utils import logger +from config import config + log = logger.getLogger(__name__) @@ -66,6 +68,24 @@ async def llm_agent_config_list(cls, user_info, platform=""): if platform: data_info["platform"] = platform + if hasattr(config, "platforms"): + res_config = config.platforms + res = {} + for _info in res_config: + __info = {} + _platform = _info.get('platform', '') + + if platform and platform != _platform: + continue + _enable = _info.get('enable', False) + __info['enable'] = "1" if _enable else "0" + __info['model'] = _info.get('model', '') + __info['engine_name'] = _info.get('engine_name', []) + + res[f"{_platform}"] = __info + + return res + try: if data_info: sql_res = await db_models.LlmConfig.filter(**data_info).all()