랭그래프 활용한 주식 정보 도출 프로젝트

- 투자 의견 조회
ㄴ 전반적인 주식 판단 기준(ex. 채무, 리스크 등등)을 기준으로 판단하여 도출
- 투자 추천
ex)
{
  "tickers": [
    "NVDA", "GOOGL", "AAPL"
  ],
  "risk_type": "aggressive"
}
This commit is contained in:
2026-06-19 18:03:05 +09:00
parent 3be7886bfe
commit 315105cebb
19 changed files with 614 additions and 68 deletions
+14 -20
View File
@@ -4,40 +4,34 @@ from contextlib import asynccontextmanager
from backend.routers.stock_router import router as stock_router
# from backend.repository.db_init import Base, SessionLocal, engine
#
from backend.repository.db_init import Base, SessionLocal, engine
# from backend.routers.evalu_router import router as evalu_router
# from backend.routers.assistant_router import router as assistant_router
# from backend.routers.call_router import router as call_router
# from backend.repository.seed import seed_customers
# @asynccontextmanager
# async def lifespan(app: FastAPI):
# print("서버 시작")
#
# # Base 에 등록된 모든 모델에 테이블 자동 생성
# Base.metadata.create_all(bind=engine)
# print("[DB] 테이블 생성 완료 (또는 이미 존재)")
#
# db = SessionLocal()
# try:
# # 기본 user 데이터 삽입
# seed_customers(db)
# finally:
# db.close()
#
# yield
# print("서버 종료")
@asynccontextmanager
async def lifespan(app: FastAPI):
print("서버 시작")
# Base 에 등록된 모든 모델에 테이블 자동 생성
Base.metadata.create_all(bind=engine)
print("[DB] 테이블 생성 완료 (또는 이미 존재)")
yield
print("서버 종료")
# app = FastAPI()
# app = FastAPI(title="상담 LLM", version="1.0", lifespan=lifespan)
app = FastAPI(title="$ Stock AI", version="1.0", description="""
app = FastAPI(title="$ Stock AI", version="1.0", lifespan=lifespan, description="""
#### $주식 AI 분석 FastAPI + LangGraph + yfinance + ChromaDB
### 주요 기능
| 번호 | 기능 | 엔드포인트 |
| --- | --- | --- |
|1 | 기업 종합 분석 | 'POST /api/stock/analysis'
|2 | 투자 의견 조회 | 'GET /api/stock/opinion/{analysis_id}'
""",
)