Skip to main content

Overview

The Agents client provides methods for creating, managing, and testing conversational AI agents. Access it via client.conversational_ai.agents.

Methods

create

Create an agent from a config object.
ConversationalConfig
required
Conversation configuration for an agent.
AgentPlatformSettingsRequestModel
Platform settings for the agent that aren’t related to the conversation orchestration and content.
AgentWorkflowRequestModel
Workflow for the agent. This defines the flow of the conversation and how the agent interacts with tools.
str
A name to make the agent easier to find.
Sequence[str]
Tags to help classify and filter the agent.
dict
Coaching settings for the agent.
RequestOptions
Request-specific configuration.
Returns: CreateAgentResponseModel with the created agent details. Example:

get

Retrieve config for an agent.
str
required
The ID of an agent. This is returned on agent creation.
str
The ID of the agent version to use.
str
The ID of the branch to use.
RequestOptions
Request-specific configuration.
Returns: GetAgentResponseModel with the agent configuration. Example:

delete

Delete an agent.
str
required
The ID of an agent. This is returned on agent creation.
RequestOptions
Request-specific configuration.
Example:

update

Patches an agent settings.
str
required
The ID of an agent. This is returned on agent creation.
str
The ID of the branch to use.
ConversationalConfig
Conversation configuration for an agent.
AgentPlatformSettingsRequestModel
Platform settings for the agent.
AgentWorkflowRequestModel
Workflow for the agent.
str
A name to make the agent easier to find.
Sequence[str]
Tags to help classify and filter the agent.
dict
Coaching settings for the agent.
str
Description for this version when publishing changes (only applicable for versioned agents).
RequestOptions
Request-specific configuration.
Returns: GetAgentResponseModel with the updated agent configuration. Example:

list

Returns a list of your agents and their metadata.
int
How many agents to return at maximum. Cannot exceed 100, defaults to 30.
Search by agent name.
bool
Filter agents by archived status.
bool
If set to true, omit agents shared by others and include only the ones you own.
SortDirection
The direction to sort the results (“asc” or “desc”).
AgentSortBy
The field to sort the results by (e.g., “name”, “created_at”).
str
Used for fetching next page. Cursor is returned in the response.
RequestOptions
Request-specific configuration.
Returns: GetAgentsPageResponseModel with paginated agent list. Example:

duplicate

Create a new agent by duplicating an existing one.
str
required
The ID of an agent. This is returned on agent creation.
str
A name to make the agent easier to find.
RequestOptions
Request-specific configuration.
Returns: CreateAgentResponseModel with the duplicated agent details. Example:

simulate_conversation

Run a conversation between the agent and a simulated user.
str
required
The ID of an agent. This is returned on agent creation.
ConversationSimulationSpecification
required
A specification detailing how the conversation should be simulated.
Sequence[PromptEvaluationCriteria]
A list of evaluation criteria to test.
int
Maximum number of new turns to generate in the conversation simulation.
RequestOptions
Request-specific configuration.
Returns: AgentSimulatedChatTestResponseModel with simulation results. Example:

simulate_conversation_stream

Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated. Once the conversation is complete, a single final message with the conversation analysis will be sent.
str
required
The ID of an agent.
ConversationSimulationSpecification
required
A specification detailing how the conversation should be simulated.
Sequence[PromptEvaluationCriteria]
A list of evaluation criteria to test.
int
Maximum number of new turns to generate in the conversation simulation.
RequestOptions
Request-specific configuration.

run_tests

Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
str
required
The ID of an agent. This is returned on agent creation.
Sequence[SingleTestRunRequestModel]
required
List of tests to run on the agent.
AdhocAgentConfigOverrideForTestRequestModel
Configuration overrides to use for testing. If not provided, the agent’s default configuration will be used.
str
ID of the branch to run the tests on. If not provided, the tests will be run on the agent default configuration.
RequestOptions
Request-specific configuration.
Returns: GetTestSuiteInvocationResponseModel with test results. Example:

Async Usage

All methods are available on AsyncElevenLabs client with async/await syntax: