agents
Creates, updates, deletes, gets or lists an agents resource.
Overview
| Name | agents |
| Type | Resource |
| Id | confluent.sql.agents |
Fields
The following fields are returned by SELECT queries:
- get_sqlv1_agent
- list_sqlv1_agents
The requested Agent.
| Name | Datatype | Description |
|---|---|---|
name | string | The 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_id | string | The unique identifier for the environment. |
organization_id | string (uuid) | The unique identifier for the organization. |
api_version | string | APIVersion defines the schema version of this representation of a resource. (sql/v1) (example: sql/v1) |
kind | string | Kind defines the object this REST resource represents. (Agent) |
metadata | object | ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. |
spec | object | The specifications of the Agent. |
status | object | The status of the Agent. |
A list of Agents.
| Name | Datatype | Description |
|---|---|---|
name | string | The 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_id | string | The unique identifier for the environment. |
organization_id | string (uuid) | The unique identifier for the organization. |
api_version | string | APIVersion defines the schema version of this representation of a resource. (sql/v1) (example: sql/v1) |
kind | string | Kind defines the object this REST resource represents. (Agent) |
metadata | object | ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. |
spec | object | The specifications of the Agent. |
status | object | The status of the Agent. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_sqlv1_agent | select | organization_id, environment_id, kafka_cluster_id, agent_name | Retrieve a specific Agent by name. | |
list_sqlv1_agents | select | organization_id, environment_id | page_size, page_token | Retrieve a sorted and paginated list of all agents. |
create_sqlv1_agent | insert | organization_id, environment_id, kafka_cluster_id, api_version, kind, metadata, name, organization_id, environment_id, spec | Make a request to create an Agent. | |
update_sqlv1_agent | replace | organization_id, environment_id, kafka_cluster_id, agent_name, api_version, kind, metadata, name, organization_id, environment_id, spec | Make a request to update an Agent's mutable fields. Mutable fields include: description, model, prompt, and properties. | |
delete_sqlv1_agent | delete | organization_id, environment_id, kafka_cluster_id, agent_name | Delete 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.
| Name | Datatype | Description |
|---|---|---|
agent_name | string | The unique identifier for the Agent |
environment_id | string | The unique identifier for the environment. |
kafka_cluster_id | string | The unique identifier for the database. |
organization_id | string (uuid) | The unique identifier for the organization |
page_size | integer (int32) | A pagination size for collection requests. |
page_token | string | An opaque pagination token for collection requests. |
SELECT examples
- get_sqlv1_agent
- list_sqlv1_agents
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
;
Retrieve a sorted and paginated list of all agents.
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 page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create_sqlv1_agent
- Manifest
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
;
# Description fields are for documentation purposes
- name: agents
props:
- name: organization_id
value: "{{ organization_id }}"
description: Required parameter for the agents resource.
- name: environment_id
value: "{{ environment_id }}"
description: Required parameter for the agents resource.
- name: kafka_cluster_id
value: "{{ kafka_cluster_id }}"
description: Required parameter for the agents resource.
- name: name
value: "{{ name }}"
description: |
The user-provided name of the agent, unique within this environment.
- name: spec
description: |
The specifications of the Agent.
value:
description: "{{ description }}"
model: "{{ model }}"
prompt: "{{ prompt }}"
tools:
- "{{ tools }}"
properties: "{{ properties }}"
REPLACE examples
- update_sqlv1_agent
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_sqlv1_agent
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
;