update
This commit is contained in:
parent
59860c6191
commit
524ee48487
@ -7,7 +7,7 @@ from cryptoai.routes.user import get_current_user
|
|||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
import requests
|
import requests
|
||||||
|
from datetime import date, timedelta
|
||||||
|
|
||||||
class AnalysisHistoryRequest(BaseModel):
|
class AnalysisHistoryRequest(BaseModel):
|
||||||
symbol: str
|
symbol: str
|
||||||
@ -64,7 +64,7 @@ async def analysis(request: AnalysisRequest,
|
|||||||
get_db_manager().user_question_manager.save_user_question(current_user["id"], symbol, "请分析以下加密货币:" + symbol + ",并给出分析报告。")
|
get_db_manager().user_question_manager.save_user_question(current_user["id"], symbol, "请分析以下加密货币:" + symbol + ",并给出分析报告。")
|
||||||
|
|
||||||
|
|
||||||
else:
|
elif request.type == 'astock':
|
||||||
stock_code = request.stock_code
|
stock_code = request.stock_code
|
||||||
token = 'app-nWuCOa0YfQVtAosTY3Jr5vFV'
|
token = 'app-nWuCOa0YfQVtAosTY3Jr5vFV'
|
||||||
|
|
||||||
@ -76,7 +76,26 @@ async def analysis(request: AnalysisRequest,
|
|||||||
"user": current_user["mail"]
|
"user": current_user["mail"]
|
||||||
}
|
}
|
||||||
|
|
||||||
get_db_manager().user_question_manager.save_user_question(current_user["id"], stock_code, "请分析以下股票:" + stock_code + ",并给出分析报告。")
|
get_db_manager().user_question_manager.save_user_question(current_user["id"], stock_code, "请分析以下A股股票:" + stock_code + ",并给出分析报告。")
|
||||||
|
|
||||||
|
elif request.type == 'usstock':
|
||||||
|
stock_code = request.stock_code
|
||||||
|
token = 'app-gFjHuqwMEFzu7oNAMWAlZXBG'
|
||||||
|
|
||||||
|
payload = {
|
||||||
|
"inputs" : {
|
||||||
|
"stock": stock_code,
|
||||||
|
"start_date": (date.today() - timedelta(days=180)).strftime("%Y-%m-%d"),
|
||||||
|
"end_date": date.today().strftime("%Y-%m-%d")
|
||||||
|
},
|
||||||
|
"response_mode": "streaming",
|
||||||
|
"user": current_user["mail"]
|
||||||
|
}
|
||||||
|
get_db_manager().user_question_manager.save_user_question(current_user["id"], stock_code, "请分析以下美股股票:" + stock_code + ",并给出分析报告。")
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise HTTPException(status_code=400, detail="不支持的类型")
|
||||||
|
|
||||||
|
|
||||||
url = 'https://mate.aimateplus.com/v1/workflows/run'
|
url = 'https://mate.aimateplus.com/v1/workflows/run'
|
||||||
headers = {
|
headers = {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ services:
|
|||||||
cryptoai-api:
|
cryptoai-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: cryptoai-api
|
container_name: cryptoai-api
|
||||||
image: cryptoai-api:0.1.28
|
image: cryptoai-api:0.1.29
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user