Skip to main content

changeAgent

client.agents.changeAgent(data: ChangeAgentRequest): Promise<Agent>

Changes the currently active agent.

Switches the runtime to use a different agent, stopping the current one if necessary. Use this when transitioning between different agent types during a workflow.

Parameters

ParameterTypeRequiredDescription
dataChangeAgentRequestYesThe agent change configuration

Returns

Promise<Agent> — A promise that resolves to the newly active Agent instance

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.agents.changeAgent(/* ChangeAgentRequest */);
console.log(result);