refactor: 更新主应用和依赖
- 在主应用中注册认证路由 - 更新requirements.txt添加认证相关依赖(jose, passlib, bcrypt)
This commit is contained in:
@@ -11,7 +11,7 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
load_dotenv()
|
||||
|
||||
from database import init_db
|
||||
from routers import websocket, chapters, books, conversations
|
||||
from routers import websocket, chapters, books, conversations, auth
|
||||
|
||||
# 初始化数据库
|
||||
init_db()
|
||||
@@ -28,6 +28,7 @@ app.add_middleware(
|
||||
)
|
||||
|
||||
# 注册路由
|
||||
app.include_router(auth.router) # 认证路由(放在最前面)
|
||||
app.websocket("/ws/conversation/{conversation_id}")(websocket.websocket_endpoint)
|
||||
app.include_router(conversations.router)
|
||||
app.include_router(chapters.router)
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
fastapi==0.115.0
|
||||
uvicorn[standard]==0.32.0
|
||||
websockets==14.1
|
||||
python-multipart==0.0.12
|
||||
python-multipart==0.0.19
|
||||
|
||||
# LangChain and AI
|
||||
langchain==0.3.0
|
||||
langchain==0.3.7
|
||||
langchain-openai==0.2.0
|
||||
langchain-community==0.3.0
|
||||
openai==1.54.0
|
||||
|
||||
# Database
|
||||
sqlalchemy==2.0.36
|
||||
@@ -23,7 +21,12 @@ pydantic==2.9.2
|
||||
pydantic-settings==2.5.2
|
||||
python-dotenv==1.0.1
|
||||
|
||||
# Authentication
|
||||
python-jose[cryptography]==3.3.0
|
||||
passlib[bcrypt]==1.7.4
|
||||
|
||||
# Audio Processing (optional, for future ASR/TTS integration)
|
||||
# pydub==0.25.1
|
||||
# speech-recognition==3.10.4
|
||||
|
||||
openai
|
||||
Reference in New Issue
Block a user