Skip to content

Commit

Permalink
[feature] The model list interface supports returning yaml configuration
Browse files Browse the repository at this point in the history
**Phenomenon and reproduction steps**

**Root cause and solution**

**Impactions**

**Test method**

**Affected branch(es)**

* main

**Checklist**

- [ ] Dependencies update required
- [ ] Common bug (similar problem in other repo)
  • Loading branch information
congxi committed Apr 11, 2024
1 parent bc0b92c commit db93cca
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 db93cca

Please sign in to comment.