fix: 修复Python模块导入错误并优化Chat功能
- 修复 core/agents/api 模块导入问题 - 优化 ChatInput 组件交互体验 - 增强 agent_handler 和 agent_service 功能 - 调整 Chat 页面样式和布局 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
26
core/agents/api/server.py
Normal file
26
core/agents/api/server.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""X-Agents API Server."""
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, 'D:/Code/Project/X-Agents/core')
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from .routes import router
|
||||
|
||||
app = FastAPI(title="X-Agents API")
|
||||
|
||||
# Add CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Include the router
|
||||
app.include_router(router)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run(app, host="0.0.0.0", port=8001)
|
||||
Reference in New Issue
Block a user