Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Add deployment status endpoint
Tomas Valenta34063f3265c3
diff --git a/api-service/app.py b/api-service/app.pyindex dbbc223fe..baaf43458 100644--- a/api-service/app.py+++ b/api-service/app.py@@ -70,6 +70,7 @@ async def list_deployments():@app.put("/deployments")async def create_agent_deployment(body: CreateDeploymentBody, project_id: str):+ print("pr", project_id)db_deployment = await db.get_deployment(project_id)if db_deployment:@@ -94,6 +95,16 @@ async def delete_agent_deployment(id: str):await deployment_manager.remove_deployment(id)[email protected]("/deployments/{id}")+async def get_agent_deployment(id: str):+ deployment = await deployment_manager.get_deployment(id)+ return {+ "id": deployment.id,+ "logs": len(deployment.event_handler.logs),+ "interaction_request": len(deployment.event_handler.interaction_requests),+ }++@app.post("/deployments/{id}/interactions")async def interact_with_agent_deployment(id: str, body: AgentInteraction):deployment = await deployment_manager.get_deployment(id)diff --git a/components/Editor/Sidebar/Deploy.tsx b/components/Editor/Sidebar/Deploy.tsxindex f496ea923..c0e834aa1 100644--- a/components/Editor/Sidebar/Deploy.tsx+++ b/components/Editor/Sidebar/Deploy.tsx@@ -30,6 +30,8 @@ function Deploy({ project }: Props) {const deployment = useDeployment(project)+ const baseDeploymentURL = deployment ? `${process.env.NEXT_PUBLIC_API_URL}/deployments/${deployment.id}` : undefined+async function deployAgent() {try {setIsDeploying(true)@@ -106,7 +108,7 @@ function Deploy({ project }: Props) {className="">- {deployment && deployment['config'] &&+ {deployment && deployment['config'] && baseDeploymentURL &&<divclassName="flex@@ -117,12 +119,12 @@ function Deploy({ project }: Props) {text={`Deployment ID: ${deployment.id}`}/><Link- href={`${process.env.NEXT_PUBLIC_API_URL}/deployment/${deployment.id}`}+ href={baseDeploymentURL}target="_blank"rel="noopener noreferrers"className="">- {`${process.env.NEXT_PUBLIC_API_URL}/deployment/${deployment.id}`}+ {baseDeploymentURL}</Link></div>}