Handle Agent RPC by ID
Handle JSON-RPC requests for an agent by its unique ID.
Body ParametersJSONExpand Collapse
params: object { name, params, task_metadata } or object { task_id, task_name } or object { task_id, task_name } or 2 more
The parameters for the agent RPC request
CreateTaskRequest object { name, params, task_metadata }
name: optional string
Optional human-readable name for the task. When set it must be globally unique. task/create is get-or-create by name: reusing an existing name returns the existing task (with its prior history) instead of creating a new one, so omit name (or make it unique, e.g. by appending a UUID) whenever each call should produce a fresh task.
SendMessageRequest object { content, stream, task_id, 2 more }
The message that was sent to the agent
TextContent object { author, content, attachments, 3 more }
SendEventRequest object { content, task_id, task_name }
The content to send to the event
TextContent object { author, content, attachments, 3 more }
ReturnsExpand Collapse
AgentRpcResponse object { result, id, error, jsonrpc }
The result of the agent RPC request
array of TaskMessage { content, task_id, id, 3 more }
The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
TextContent object { author, content, attachments, 3 more }
StreamTaskMessageStart object { content, index, parent_task_message, type }
Event for starting a streaming message
TextContent object { author, content, attachments, 3 more }
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
TextContent object { author, content, attachments, 3 more }
StreamTaskMessageDelta object { delta, index, parent_task_message, type }
Event for streaming chunks of content
Delta for text updates
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
TextContent object { author, content, attachments, 3 more }
StreamTaskMessageFull object { content, index, parent_task_message, type }
Event for streaming the full content
TextContent object { author, content, attachments, 3 more }
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
TextContent object { author, content, attachments, 3 more }
StreamTaskMessageDone object { index, parent_task_message, type }
Event for indicating the task is done
Represents a message in the agent system.
This entity is used to store messages in MongoDB, with each message associated with a specific task.
The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
TextContent object { author, content, attachments, 3 more }
Task object { id, cleaned_at, created_at, 6 more }
Event object { id, agent_id, sequence_id, 3 more }
The content of the event
TextContent object { author, content, attachments, 3 more }
Handle Agent RPC by ID
curl http://localhost:5003/agents/$AGENT_ID/rpc \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AGENTEX_SDK_API_KEY" \
-d '{
"method": "event/send",
"params": {}
}'{
"result": [
{
"content": {
"author": "user",
"content": "content",
"attachments": [
{
"file_id": "file_id",
"name": "name",
"size": 0,
"type": "type"
}
],
"format": "markdown",
"style": "static",
"type": "text"
},
"task_id": "task_id",
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"streaming_status": "IN_PROGRESS",
"updated_at": "2019-12-27T18:11:19.117Z"
}
],
"id": 0,
"error": {},
"jsonrpc": "2.0"
}Returns Examples
{
"result": [
{
"content": {
"author": "user",
"content": "content",
"attachments": [
{
"file_id": "file_id",
"name": "name",
"size": 0,
"type": "type"
}
],
"format": "markdown",
"style": "static",
"type": "text"
},
"task_id": "task_id",
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"streaming_status": "IN_PROGRESS",
"updated_at": "2019-12-27T18:11:19.117Z"
}
],
"id": 0,
"error": {},
"jsonrpc": "2.0"
}