Skip to content
Closed
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
18 changes: 17 additions & 1 deletion src/client/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,20 @@ export class Agent {
}

/**
* Execute an agent with the given arguments (new method).
* Execute an agent with the given arguments.
*
* @param params - Agent execution parameters
* @param params.name - Name of the agent to execute
* @param params.inputs - Optional inputs to the agent
* @param params.batch - Whether to process in batch mode (default: true)
* @param params.config - Optional agent execution configuration
* @param params.metadata - Optional request metadata
* @param params.callbackUrl - Optional URL to call when execution is complete
* @param params.toolsets - Optional list of tool categories to enable.
* Available categories: core, image, image-gen, world_gen,
* viz, document, video, web.
* When specified, only tools from these categories will be available.
* If not specified, defaults to 'core' tools only.
* @returns Agent execution response
*/
async execute(
Expand All @@ -252,6 +263,7 @@ export class Agent {
config,
metadata,
callbackUrl,
toolsets,
} = params;

if (!batch) {
Expand Down Expand Up @@ -281,6 +293,10 @@ export class Agent {
data.callback_url = callbackUrl;
}

if (toolsets !== undefined) {
data.toolsets = toolsets;
}

const [response] = await this.requestor.request<AgentExecutionResponse>(
"POST",
"agent/execute",
Expand Down
23 changes: 23 additions & 0 deletions src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ export type FilePurpose = string;

export type DetailLevel = string;

/**
* AgentToolset type - tool categories available for agent execution.
* Available categories: core, image, image-gen, world_gen,
* viz, document, video, web.
*/
export type AgentToolset =
| "core"
| "image"
| "image-gen"
| "world_gen"
| "viz"
| "document"
| "video"
| "web";

// URL pattern for http/https URLs
const URL_PATTERN = /^https?:\/\/.+/;

Expand Down Expand Up @@ -658,4 +673,12 @@ export interface AgentExecuteParamsNew {
config?: AgentExecutionConfigInput;
metadata?: RequestMetadataInput;
callbackUrl?: string;
/**
* List of tool categories to enable for this execution.
* Available categories: core, image, image-gen, 3d_reconstruction,
* viz, document, video, web.
* When specified, only tools from these categories will be available.
* If not specified, defaults to 'core' tools only.
*/
toolsets?: AgentToolset[];
}
Loading