公开的智能体
This commit is contained in:
parent
ed440564f3
commit
411c515a13
@ -456,6 +456,7 @@ class ModelInfo(BaseModel):
|
||||
class BotSettingsResponse(BaseModel):
|
||||
"""Bot 设置响应"""
|
||||
bot_id: str
|
||||
name: str # bot 名称
|
||||
model_id: Optional[str]
|
||||
model: Optional[ModelInfo] # 关联的模型信息
|
||||
language: str
|
||||
@ -1615,7 +1616,7 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header(
|
||||
async with pool.connection() as conn:
|
||||
async with conn.cursor() as cursor:
|
||||
await cursor.execute("""
|
||||
SELECT id, settings, updated_at, is_published, copied_from
|
||||
SELECT id, name, settings, updated_at, is_published, copied_from
|
||||
FROM agent_bots
|
||||
WHERE id = %s
|
||||
""", (bot_uuid,))
|
||||
@ -1624,7 +1625,7 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header(
|
||||
if not row:
|
||||
raise HTTPException(status_code=404, detail="Bot not found")
|
||||
|
||||
bot_id, settings_json, updated_at, is_published, copied_from = row
|
||||
bot_id, bot_name, settings_json, updated_at, is_published, copied_from = row
|
||||
settings = settings_json if settings_json else {}
|
||||
|
||||
# 获取关联的模型信息
|
||||
@ -1655,6 +1656,7 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header(
|
||||
|
||||
return BotSettingsResponse(
|
||||
bot_id=str(bot_id),
|
||||
name=bot_name,
|
||||
model_id=model_id,
|
||||
model=model_info,
|
||||
language=settings.get('language', 'zh'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user