수정본
This commit is contained in:
@@ -118,6 +118,9 @@ async def health_check():
|
||||
return {
|
||||
"status": "healthy",
|
||||
"ai_provider": settings.AI_PROVIDER,
|
||||
"hybrid_ai_enabled": settings.HYBRID_AI_ENABLED if settings.AI_PROVIDER == "claude" else False,
|
||||
"claude_model": settings.CLAUDE_MODEL,
|
||||
"claude_haiku_model": settings.CLAUDE_HAIKU_MODEL,
|
||||
"claude_configured": bool(settings.ANTHROPIC_API_KEY),
|
||||
"gemini_configured": bool(settings.GEMINI_API_KEY),
|
||||
}
|
||||
@@ -252,6 +255,39 @@ async def analyze(request: AnalysisRequest):
|
||||
result = await ai_client.generate_trade_journal(trade_info, market_data)
|
||||
return {"analysis_type": analysis_type, "result": result}
|
||||
|
||||
elif analysis_type == "BATCH_STOCK_ANALYSIS":
|
||||
stocks = data.get("stocks")
|
||||
if not stocks or not isinstance(stocks, list):
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="stocks (list) is required"
|
||||
)
|
||||
result = await ai_client.analyze_batch_stocks(stocks)
|
||||
return {"analysis_type": analysis_type, "result": result}
|
||||
|
||||
elif analysis_type == "NEWS_SENTIMENT":
|
||||
stock_code = data.get("stock_code")
|
||||
stock_name = data.get("stock_name")
|
||||
news_titles = data.get("news_titles")
|
||||
if not stock_code or not stock_name or not news_titles:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="stock_code, stock_name, and news_titles are required"
|
||||
)
|
||||
result = await ai_client.check_news_sentiment(stock_code, stock_name, news_titles)
|
||||
return {"analysis_type": analysis_type, "result": result}
|
||||
|
||||
elif analysis_type == "DAILY_REVIEW":
|
||||
trades_summary = data.get("trades_summary")
|
||||
market_summary = data.get("market_summary")
|
||||
if not trades_summary or not market_summary:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="trades_summary and market_summary are required"
|
||||
)
|
||||
result = await ai_client.review_daily_trades(trades_summary, market_summary)
|
||||
return {"analysis_type": analysis_type, "result": result}
|
||||
|
||||
else:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
|
||||
Reference in New Issue
Block a user