update
This commit is contained in:
parent
418d5e3001
commit
560597a892
@ -17,6 +17,7 @@ from cryptoai.utils.config_loader import ConfigLoader
|
|||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
from cryptoai.routes.user import get_current_user
|
from cryptoai.routes.user import get_current_user
|
||||||
import requests
|
import requests
|
||||||
|
from datetime import datetime
|
||||||
from cryptoai.utils.db_manager import get_db_manager
|
from cryptoai.utils.db_manager import get_db_manager
|
||||||
|
|
||||||
# 创建路由
|
# 创建路由
|
||||||
@ -42,7 +43,7 @@ async def get_agents(current_user: Dict[str, Any] = Depends(get_current_user)):
|
|||||||
{
|
{
|
||||||
"id": "2",
|
"id": "2",
|
||||||
"name": "美股交易助手",
|
"name": "美股交易助手",
|
||||||
"hello_prompt": "您好,我是美股交易助手,为您提供专业的股票交易分析和建议",
|
"hello_prompt": "您好,我是美股交易助手,您可以直接输入股票名称,比如AAPL,然后我会为您提供专业的股票交易分析和建议",
|
||||||
"description": "帮你分析做美股股票技术分析",
|
"description": "帮你分析做美股股票技术分析",
|
||||||
},
|
},
|
||||||
# {
|
# {
|
||||||
@ -66,13 +67,19 @@ async def chat(request: ChatRequest,current_user: Dict[str, Any] = Depends(get_c
|
|||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=400, detail="Invalid agent ID")
|
raise HTTPException(status_code=400, detail="Invalid agent ID")
|
||||||
|
|
||||||
|
inputs = {}
|
||||||
|
if request.agent_id == "2":
|
||||||
|
inputs = {
|
||||||
|
"current_date": datetime.now().strftime("%Y-%m-%d")
|
||||||
|
}
|
||||||
|
|
||||||
url = "https://mate.aimateplus.com/v1/chat-messages"
|
url = "https://mate.aimateplus.com/v1/chat-messages"
|
||||||
headers = {
|
headers = {
|
||||||
"Authorization": f"Bearer {token}",
|
"Authorization": f"Bearer {token}",
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}
|
}
|
||||||
data = {
|
data = {
|
||||||
"inputs" : {},
|
"inputs" : inputs,
|
||||||
"query" : request.user_prompt,
|
"query" : request.user_prompt,
|
||||||
"response_mode" : "streaming",
|
"response_mode" : "streaming",
|
||||||
"user" : current_user["mail"]
|
"user" : current_user["mail"]
|
||||||
|
|||||||
@ -29,7 +29,7 @@ services:
|
|||||||
cryptoai-api:
|
cryptoai-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: cryptoai-api
|
container_name: cryptoai-api
|
||||||
image: cryptoai-api:0.0.9
|
image: cryptoai-api:0.0.10
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user