Skip to content

Commit

Permalink
Merge pull request #3 from deepflowio/dev
Browse files Browse the repository at this point in the history
[feature] The model list interface supports returning yaml configuration
  • Loading branch information
beizhanyong authored Apr 11, 2024
2 parents 1c5aab0 + db93cca commit 5b89dc6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions df-llm-agent/llm_agent_app/llm_agent_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from database import db_models
from utils import logger

from config import config

log = logger.getLogger(__name__)


Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5b89dc6

Please sign in to comment.