在您的基础设施上部署AG-Kit服务器
from ag_kit_py.server import AgentServiceApp
def create_agent():
return {"agent": my_agent}
# One-line server startup
AgentServiceApp().run(create_agent, port=8000)
from fastapi import FastAPI
from ag_kit_py.server import AgentServiceApp
# Your existing FastAPI app
app = FastAPI(title="My Application")
# Add AG-Kit routes
agkit_app = AgentServiceApp().build(create_agent, base_path="/api/agent")
app.mount("/api/agent", agkit_app)
# Install Gunicorn
pip install gunicorn
# Run with multiple workers
gunicorn -w 4 -k uvicorn.workers.UvicornWorker app:app
此页面对您有帮助吗?