...
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. |
...
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"
},
"usersRequestTimestamp": {
"type": "string",
"format": "date-time",
"description": "The time stamp when the user made the request"
},
"agentResponseText": {
"type": "string",
"description": "The text of the agent's response"
},
"agentResponseTimestamp": {
"type": "string",
"format": "date-time",
"description": "The time stamp when the agent produced the response."
}
}
} |