...
Response | url | Request | Description | Authorization |
---|---|---|---|---|
AgentSession | POST /agent/session | CreateAgentSessionRequest | Used to start a new session with the Synapse agent. | A user must be authenticated to make this call. |
ListAgentSessionsResponse | POST /agent/sessions/list | ListAgentSessionsRequest | List all of the user’s sessions starting with the latest. | Will only list sessions that belong to the caller. |
SessionHistoryResponse | POST /agent/session/history/{sessionId} | SessionHistoryRequest | Get a single page of a session’s conversation history. | Only the owner of the session may make this call. |
JobState | POST /agent/chat/async/start | AgentChatRequest Start | Start an asynchronous job to send a chat message to the Synapse agent. | A user must be authenticated to make this call. The provided sessionId must belong to the caller. The agent’s access level will be determined by the level selected by the users for the session. |
AgentChatResponse | GET /agent/chat/async/get/{job_id} | Get the results of an asynchronous job that contains the Synapse agent’s response to a user’s request. | Authentication required. Only the user that started the job can get its results. | |
TraceEventsResponse | GET /agent/chat/trace/{job_id} | TraceEventsRequset | Get a single page of trace events associated with an AgentChatRequest job. Note: The AgentChatRequest.enableTrace must be set to “true” to enable tracing for a job. | Authentication required. Only the user that started the job can get its results. |
Object Models
CreateAgentSessionRequest:
...
Code Block | ||
---|---|---|
| ||
{
"description": "Send a chat message to the Synapse chat agent",
"implements": [
{
"$ref": "org.sagebionetworks.repo.model.asynch.AsynchronousRequestBody"
}
],
"properties": {
"sessionId": {
"description": "The sessionId that identifies the conversation with the agent.",
"type": "string"
},
"chatText": {
"description": "The user's text message to send to the agent.",
"type": "string"
},
"enableTrace": {
"description": "Optional. When trace is enabled, the agent will include information about its decision process and the functions/tools it will use to process this request. Default value is false.",
"type": "boolean"
}
}
} |
AgentChatResponse:
Code Block | ||
---|---|---|
| ||
{
"description": "The response to an agent chat request.",
"implements": [
{
"$ref": "org.sagebionetworks.repo.model.asynch.AsynchronousResponseBody"
}
],
"properties": {
"sessionId": {
"description": "The sessionId that identifies the conversation with the agent.",
"type": "string"
},
"responseText": {
"description": "The agent's text response to the user's request",
"type": "string"
}
}
} |
SessionHistoryRequest
Code Block | ||
---|---|---|
| ||
{
"description": "Request a single page of a session's history. The history is ordered by the interaction time stamp descending.",
"properties": {
"nextPageToken": {
"type": "string",
"description": "Forward the returned 'nextPageToken' to get the next page of results."
}
}
}
|
SessionHistoryResponse:
Code Block | ||
---|---|---|
| ||
{
"description": "A single page of an agent session history",
"properties": {
"sessionId": {
"description": "The session ID of this conversation's history",
"type": "string"
},
"page": {
"description": "A single page of a session's history. The history is ordered by the interaction time stamp descending.",
"type": "array",
"items": {
"$ref": "org.sagebionetworks.repo.model.agent.Interaction"
}
},
"nextPageToken": {
"type": "string",
"description": "Forward this token to get the next page of results."
}
}
} |
Interaction:
Code Block | ||
---|---|---|
| ||
{ "description": "Represents a single interaction between the user and an agent.", "properties": { "usersRequestText": { "type": "string", "description": "The text of the user's request" } } |
AgentChatResponse:
Code Block | ||
---|---|---|
| ||
{ , "usersRequestTimestamp": { "type": "string", "format": "date-time", "description": "The time responsestamp when tothe anuser agentmade chatthe request." }, "implementsagentResponseText": [{ {"type": "string", "$refdescription": "org.sagebionetworks.repo.model.asynch.AsynchronousResponseBody" } ], "properties": { "sessionId": {The text of the agent's response" }, "agentResponseTimestamp": { "type": "string", "format": "date-time", "description": "The sessionIdtime thatstamp identifieswhen the conversationagent withproduced the agentresponse.", "type": "string" } }, "responseText": } |
TraceEventsRequest:
Code Block | ||
---|---|---|
| ||
{ "description": "The agent's text response to the user's requestA request to get a single page of trace events for a specified asynchronous job.", "typeproperties": "string"{ } } } |
SessionHistoryRequest
Code Block | ||
---|---|---|
| ||
"jobId": { "descriptiontype": "string"Request a single page of a session's history. The history is ordered by the interaction time stamp descending.", "properties": { "nextPageToken, "description": "The job ID issued when the agent chat request job was started." }, "olderThanTimestamp": { "type": "stringinteger", "description": "ForwardWhen a time stamp value is provided, only trace events that occurred after the returnedprovided 'nextPageToken'time tostamp getwill thebe nextincluded pagein ofthe results." } } } |
SessionHistoryResponse:TraceEventsResponse
Code Block | ||
---|---|---|
| ||
{ "description": "A single page of an an agent trace events for an asynchronous agent sessionchat historyjob.", "properties": { "sessionIdjobId": { "type": "string", "description": "The sessionjob ID of this conversation's history", "type": "string issued when the agent chat request job was started." }, "page": { "description": "A single page of a session's history. The history istrace events ordered by the interaction time stamp descending.", "type": "array", "items": { "$ref": "org.sagebionetworks.repo.model.agent.InteractionTraceEvent" } }, "nextPageToken": { "type": "string", "description": "Forward this token to get the next page of results." } } } |
InteractionTraceEvent:
Code Block | ||
---|---|---|
| ||
{ "description": "Represents a single interactiontrace betweenevent thegenerated user andduring an agent.", "properties": { "usersRequestText": { "type": "string", "description": "The text of the user's request" }, "usersRequestTimestamp chat asynchronous job request.", "properties": { "typetimestamp": "string",{ "formattype": "date-timeinteger", "description": "The time stamp identifies when the user made the request" }, "agentResponseText": { "type": "string", "description": "The text of the agent's response agent generated this trace event. It is also used to uniquely identify this event within the context of this asynchronous job." }, "agentResponseTimestampmessage": { "type": "string", "formatdescription": "date-time", "description": "The time stamp whenThe trace text message generated by the agent while processing produceda thechat responserequest." } } } |