import { CortiEnvironment, CortiClient } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", {
message: {
role: "user",
parts: [{
kind: "text",
text: "text"
}],
messageId: "messageId",
kind: "message"
}
});
{
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
},
"task": {
"id": "<string>",
"contextId": "<string>",
"status": {
"state": "submitted",
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
},
"kind": "task",
"history": [
{
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
}
],
"artifacts": [
{
"artifactId": "<string>",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"name": "<string>",
"description": "<string>",
"metadata": {},
"extensions": [
"<string>"
]
}
],
"metadata": {}
}
}This endpoint sends a message to the specified agent to start or continue a task. The agent processes the message and returns a response. If the message contains a task ID that matches an ongoing task, the agent will continue that task; otherwise, it will start a new task.
import { CortiEnvironment, CortiClient } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", {
message: {
role: "user",
parts: [{
kind: "text",
text: "text"
}],
messageId: "messageId",
kind: "message"
}
});
{
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
},
"task": {
"id": "<string>",
"contextId": "<string>",
"status": {
"state": "submitted",
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
},
"kind": "task",
"history": [
{
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
}
],
"artifacts": [
{
"artifactId": "<string>",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"name": "<string>",
"description": "<string>",
"metadata": {},
"extensions": [
"<string>"
]
}
],
"metadata": {}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.
"copiloteu"
The identifier of the agent associated with the context.
"12345678-90ab-cdef-gh12-34567890abc"
Show child attributes
The role of the message sender.
user, agent The content of the message.
Unique identifier for the message.
The kind of the object, always "message".
message Additional metadata for the message.
Extensions for the message.
Task IDs that this message references for additional context.
Unique identifier for the task associated with the message.
Identifier for the context (thread) in which the message is sent.
Show child attributes
A list of output MIME types the client is prepared to accept in the response.
The number of previous messages to include in the context for the agent when processing this message.
Show child attributes
The URL to which push notifications will be sent when the task status changes.
Unique identifier for the push notification configuration.
An optional bearer token to include in the Authorization header when sending push notifications.
If true, the client will wait for the task to complete. The server may reject this if the task is long-running.
Optional metadata that will be associated with the message.
Message processed successfully.
Show child attributes
The role of the message sender.
user, agent The content of the message.
Unique identifier for the message.
The kind of the object, always "message".
message Additional metadata for the message.
Extensions for the message.
Task IDs that this message references for additional context.
Unique identifier for the task associated with the message.
Identifier for the context (thread) in which the message is sent.
Show child attributes
Unique identifier for the task.
Identifier for the context (thread) in which the task is created.
Show child attributes
The current state of the task.
submitted, working, input-required, completed, canceled, failed, rejected, auth-required, unknown Additional message or details about the task status.
Show child attributes
The role of the message sender.
user, agent The content of the message.
Unique identifier for the message.
The kind of the object, always "message".
message Additional metadata for the message.
Extensions for the message.
Task IDs that this message references for additional context.
Unique identifier for the task associated with the message.
Identifier for the context (thread) in which the message is sent.
The timestamp when this status was recorded.
The kind of the object, always "task".
task The history of messages associated with the task.
Show child attributes
The role of the message sender.
user, agent The content of the message.
Unique identifier for the message.
The kind of the object, always "message".
message Additional metadata for the message.
Extensions for the message.
Task IDs that this message references for additional context.
Unique identifier for the task associated with the message.
Identifier for the context (thread) in which the message is sent.
The artifacts associated with the task.
Show child attributes
Unique identifier for the artifact.
The content of the artifact.
Name of the artifact.
Description of the artifact.
Additional metadata for the artifact.
Extensions for the artifact.
Additional metadata for the task.
Was this page helpful?