update
This commit is contained in:
parent
9228e02cbe
commit
1a2c1b3d05
@ -62,25 +62,8 @@ async def get_agents(
|
||||
"""
|
||||
获取所有代理
|
||||
"""
|
||||
# # 检查用户权限
|
||||
# if current_user.get("level", 0) < 2: # 假设需要SVIP权限才能查看全部Agent
|
||||
# # 使用硬编码的默认Agent
|
||||
# return [
|
||||
# {
|
||||
# "id": "1",
|
||||
# "name": "Crypto Assistant",
|
||||
# "hello_prompt": "您好,我是加密货币交易助手,为您提供专业的数字货币交易分析和建议",
|
||||
# "description": "帮你分析做加密货币技术分析",
|
||||
# },
|
||||
# {
|
||||
# "id": "2",
|
||||
# "name": "US Stock Assistant",
|
||||
# "hello_prompt": "您好,我是美股交易助手,您可以直接输入股票名称,比如AAPL,然后我会为您提供专业的股票交易分析和建议",
|
||||
# "description": "帮你分析做美股股票技术分析",
|
||||
# },
|
||||
# ]
|
||||
# else:
|
||||
# 从数据库获取Agent列表
|
||||
|
||||
# 从数据库获取Agent列表
|
||||
agents = get_db_manager().list_agents(limit=limit, skip=skip)
|
||||
return agents
|
||||
|
||||
@ -100,8 +83,7 @@ async def chat(request: ChatRequest, current_user: Dict[str, Any] = Depends(get_
|
||||
|
||||
token = agent.get("dify_token")
|
||||
inputs = agent.get("inputs") or {}
|
||||
if agent.get("id") == 2:
|
||||
inputs["current_date"] = datetime.now().strftime("%Y-%m-%d")
|
||||
inputs["current_date"] = datetime.now().strftime("%Y-%m-%d")
|
||||
|
||||
except ValueError:
|
||||
raise HTTPException(status_code=400, detail="Invalid agent ID format")
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
cryptoai-api:
|
||||
build: .
|
||||
container_name: cryptoai-api
|
||||
image: cryptoai-api:0.0.13
|
||||
image: cryptoai-api:0.0.14
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user