Skip to main content

agents

Creates, updates, deletes, gets or lists an agents resource.

Overview

Nameagents
TypeResource
Idconfluent.sql.agents

Fields

The following fields are returned by SELECT queries:

The requested Agent.

NameDatatypeDescription
namestringThe user-provided name of the agent, unique within this environment. (pattern: [a-z0-9]([-a-z0-9][a-z0-9])?(.[a-z0-9]([-a-z0-9][a-z0-9])?)*, example: chat-listener-agent)
environment_idstringThe unique identifier for the environment.
organization_idstring (uuid)The unique identifier for the organization.
api_versionstringAPIVersion defines the schema version of this representation of a resource. (sql/v1) (example: sql/v1)
kindstringKind defines the object this REST resource represents. (Agent)
metadataobjectObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
specobjectThe specifications of the Agent.
statusobjectThe status of the Agent.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_sqlv1_agentselectorganization_id, environment_id, kafka_cluster_id, agent_nameRetrieve a specific Agent by name.
list_sqlv1_agentsselectorganization_id, environment_idpage_size, page_tokenRetrieve a sorted and paginated list of all agents.
create_sqlv1_agentinsertorganization_id, environment_id, kafka_cluster_id, api_version, kind, metadata, name, organization_id, environment_id, specMake a request to create an Agent.
update_sqlv1_agentreplaceorganization_id, environment_id, kafka_cluster_id, agent_name, api_version, kind, metadata, name, organization_id, environment_id, specMake a request to update an Agent's mutable fields.
Mutable fields include: description, model, prompt, and properties.
delete_sqlv1_agentdeleteorganization_id, environment_id, kafka_cluster_id, agent_nameDelete a specific Agent by name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
agent_namestringThe unique identifier for the Agent
environment_idstringThe unique identifier for the environment.
kafka_cluster_idstringThe unique identifier for the database.
organization_idstring (uuid)The unique identifier for the organization
page_sizeinteger (int32)A pagination size for collection requests.
page_tokenstringAn opaque pagination token for collection requests.

SELECT examples

Retrieve a specific Agent by name.

SELECT
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
spec,
status
FROM confluent.sql.agents
WHERE organization_id = '{{ organization_id }}' -- required
AND environment_id = '{{ environment_id }}' -- required
AND kafka_cluster_id = '{{ kafka_cluster_id }}' -- required
AND agent_name = '{{ agent_name }}' -- required
;

INSERT examples

Make a request to create an Agent.

INSERT INTO confluent.sql.agents (
name,
spec,
organization_id,
environment_id,
kafka_cluster_id
)
SELECT
'{{ name }}' /* required */,
'{{ spec }}' /* required */,
'{{ organization_id }}',
'{{ environment_id }}',
'{{ kafka_cluster_id }}'
RETURNING
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
spec,
status
;

REPLACE examples

Make a request to update an Agent's mutable fields.
Mutable fields include: description, model, prompt, and properties.

REPLACE confluent.sql.agents
SET
name = '{{ name }}',
spec = '{{ spec }}'
WHERE
organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND kafka_cluster_id = '{{ kafka_cluster_id }}' --required
AND agent_name = '{{ agent_name }}' --required
AND name = '{{ name }}' --required
AND spec = '{{ spec }}' --required
RETURNING
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
spec,
status;

DELETE examples

Delete a specific Agent by name.

DELETE FROM confluent.sql.agents
WHERE organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND kafka_cluster_id = '{{ kafka_cluster_id }}' --required
AND agent_name = '{{ agent_name }}' --required
;