StartAgent
client.agents.startExecution(AgentStartExecutionParams { agentId, annotations, codeContext, 5 more } body, RequestOptionsoptions?): AgentStartExecutionResponse { agentExecutionId }
POST/gitpod.v1.AgentService/StartAgent
Starts (or triggers) an agent run using a provided agent.
Use this method to:
- Launch an agent based on a known agent
Examples
-
Start an agent with a project ID:
agentId: "b8a64cfa-43e2-4b9d-9fb3-07edc63f5971" codeContext: projectId: "2d22e4eb-31da-467f-882c-27e21550992f"
StartAgent
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const response = await client.agents.startExecution({
agentId: 'b8a64cfa-43e2-4b9d-9fb3-07edc63f5971',
codeContext: { projectId: '2d22e4eb-31da-467f-882c-27e21550992f' },
});
console.log(response.agentExecutionId);{
"agentExecutionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}Returns Examples
{
"agentExecutionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}