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:
2026-03-16 10:27:07 +08:00
parent 52a9d02342
commit 3a4876ab00
9 changed files with 461 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
"""X-Agents API Module."""
from agents.api.routes import router
from .routes import router
__all__ = ["router"]

26
core/agents/api/server.py Normal file
View 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)