diff --git a/src/api/AgentRuns/index.ts b/src/api/AgentRuns/index.ts index 9c47dd0..eac0aab 100644 --- a/src/api/AgentRuns/index.ts +++ b/src/api/AgentRuns/index.ts @@ -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"; /** @@ -34,5 +34,16 @@ export class AgentRuns extends BaseResource { async retrieve(workspaceSlug: string, runId: string): Promise { return this.get(`/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 { + return this.patch(`/workspaces/${workspaceSlug}/runs/${runId}/`, data); + } } diff --git a/src/models/AgentRun.ts b/src/models/AgentRun.ts index bf848b1..93c62d4 100644 --- a/src/models/AgentRun.ts +++ b/src/models/AgentRun.ts @@ -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 */ @@ -77,6 +92,7 @@ export interface AgentRunActivityActionContent { export interface AgentRunActivityTextContent { type: Exclude; body: string; + actions?: AgentRunActivityAction[]; } /**