- 修复 core/agents/api 模块导入问题 - 优化 ChatInput 组件交互体验 - 增强 agent_handler 和 agent_service 功能 - 调整 Chat 页面样式和布局 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
547 B
Python
27 lines
547 B
Python
"""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)
|