Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/api/AgentRuns/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import { AgentRun, CreateAgentRunRequest } from "../../models/AgentRun";
import { AgentRun, CreateAgentRunRequest, UpdateAgentRunRequest } from "../../models/AgentRun";
import { Activities } from "./Activities";

/**
Expand Down Expand Up @@ -34,5 +34,16 @@ export class AgentRuns extends BaseResource {
async retrieve(workspaceSlug: string, runId: string): Promise<AgentRun> {
return this.get<AgentRun>(`/workspaces/${workspaceSlug}/runs/${runId}/`);
}

/**
* Update an agent run
* @param workspaceSlug - The workspace slug
* @param runId - The agent run ID
* @param data - The fields to update
* @returns The updated agent run
*/
async update(workspaceSlug: string, runId: string, data: UpdateAgentRunRequest): Promise<AgentRun> {
return this.patch<AgentRun>(`/workspaces/${workspaceSlug}/runs/${runId}/`, data);
}
}

16 changes: 16 additions & 0 deletions src/models/AgentRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ export interface CreateAgentRunRequest {
type?: AgentRunType;
}

/**
* Update agent run request interface
*/
export interface UpdateAgentRunRequest {
external_link?: string | null;
}

/**
* Action button attached to an activity (e.g. a CTA shown below the response body).
*/
export interface AgentRunActivityAction {
name: string;
redirect_url: string | null;
}

/**
* Agent run activity content for action type
*/
Expand All @@ -77,6 +92,7 @@ export interface AgentRunActivityActionContent {
export interface AgentRunActivityTextContent {
type: Exclude<AgentRunActivityType, "action">;
body: string;
actions?: AgentRunActivityAction[];
}

/**
Expand Down
Loading