-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.ts
More file actions
38 lines (33 loc) · 1.11 KB
/
index.ts
File metadata and controls
38 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import { AgentRun, CreateAgentRunRequest } from "../../models/AgentRun";
import { Activities } from "./Activities";
/**
* Agent Runs API resource
* Handles all agent run operations
*/
export class AgentRuns extends BaseResource {
public activities: Activities;
constructor(config: Configuration) {
super(config);
this.activities = new Activities(config);
}
/**
* Create a new agent run
* @param workspaceSlug - The workspace slug
* @param data - The agent run data to create
* @returns The created agent run
*/
async create(workspaceSlug: string, data: CreateAgentRunRequest): Promise<AgentRun> {
return this.post<AgentRun>(`/workspaces/${workspaceSlug}/runs/`, data);
}
/**
* Retrieve an agent run by ID
* @param workspaceSlug - The workspace slug
* @param runId - The agent run ID
* @returns The agent run
*/
async retrieve(workspaceSlug: string, runId: string): Promise<AgentRun> {
return this.get<AgentRun>(`/workspaces/${workspaceSlug}/runs/${runId}/`);
}
}