Skip to main content

Tovie Data Agent public API (1.0.0)

Download OpenAPI specification:Download

ProjectsPublic

Data Agent project operations API.

Get project info

Obtain information on the current knowledge base project.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "status": "CREATED",
  • "resources": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

QueriesPublic

Send requests to search for chunks and generate responses (without considering chat history).

Retrieve chunks

Retrieve chunks relevant to the user’s query from the knowledge base.

Authorizations:
bearerAuth
Request Body schema: application/json
required
query
required
string

Text of the user’s query.

Array of objects (HistoryRecord)

Dialogue history. Entries are displayed in reverse chronological order (from latest to earliest).

object (RetrievingSettings)

Chunk search settings.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "history": [
    ],
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "chunks": [
    ]
}

Generate response

Synchronous request to generate a response to the user’s query.

Please note that request processing may take a significant amount of time. Ensure that the connection timeout set in your HTTP client is more than 1 minute.

Authorizations:
bearerAuth
Request Body schema: application/json
required
query
required
string

Text of the user’s query.

Array of objects (HistoryRecord)

Dialogue history. Entries are displayed in reverse chronological order (from latest to earliest).

object (RagSettings)

Query processing settings.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "history": [
    ],
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Generate response (asynchronous request)

Asynchronous request to generate a response to the user’s query.

The result can be obtained via GET /api/knowledge-hub/query/{queryId} endpoint, where queryId is the request identifier received in the current response.

Authorizations:
bearerAuth
Request Body schema: application/json
required
query
required
string

Text of the user’s query.

Array of objects (HistoryRecord)

Dialogue history. Entries are displayed in reverse chronological order (from latest to earliest).

object (RagSettings)

Query processing settings.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "history": [
    ],
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Processing status of the response generation request

Get the current processing status of the response generation request. Long polling is used if the waitTimeSeconds parameter is specified.

Authorizations:
bearerAuth
path Parameters
queryId
required
integer <int64> (LongId)

Identifier of the response generation request.

query Parameters
waitTimeSeconds
integer <int32> [ 0 .. 30 ]
Default: 3

HTTP request timeout. Used in long polling.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Cancel response generation request

Authorizations:
bearerAuth
path Parameters
queryId
required
integer <int64> (LongId)

Identifier of the response generation request.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

ChatsPublic

Send requests to search for chunks and generate responses (within a user chat).

Chat creation

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
string

Name of the user’s chat.

object (RagSettings)

Query processing settings.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "settings": {
    }
}

User chat information

Authorizations:
bearerAuth
path Parameters
chatId
required
integer <int64> (LongId)

Identifier of the chat in the knowledge base project.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "settings": {
    }
}

Retrieve chunks

Retrieve chunks from the knowledge base that are relevant to the user’s query within the chat.

Authorizations:
bearerAuth
path Parameters
chatId
required
integer <int64> (LongId)

Identifier of the chat in the knowledge base project.

Request Body schema: application/json
required
query
required
string

Text of the user’s query.

object (RetrievingSettings)

Chunk search settings.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "chunks": [
    ]
}

Generate response

Synchronous request to generate a response to the user’s query. The chat message history is taken into account.

Please note that request processing may take a significant amount of time. Ensure that the connection timeout set in your HTTP client is more than 1 minute.

Authorizations:
bearerAuth
path Parameters
chatId
required
integer <int64> (LongId)

Identifier of the chat in the knowledge base project.

Request Body schema: application/json
required
query
required
string

Text of the user’s query.

object (RagSettings)

Query processing settings.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "chatId": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Generate response (asynchronous request)

Asynchronous request to generate a response to the user’s query. The chat message history is taken into account.

The result can be obtained via GET /api/knowledge-hub/chat/{chatId}/query/{queryId} endpoint, where queryId is the request identifier received in the current response.

Authorizations:
bearerAuth
path Parameters
chatId
required
integer <int64> (LongId)

Identifier of the chat in the knowledge base project.

Request Body schema: application/json
required
query
required
string

Text of the user’s query.

object (RagSettings)

Query processing settings.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "chatId": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Processing status of the response generation request

Get the current processing status of the response generation request within a user chat. Long polling is used if the waitTimeSeconds parameter is specified.

Authorizations:
bearerAuth
path Parameters
chatId
required
integer <int64> (LongId)

Identifier of the chat in the knowledge base project.

queryId
required
integer <int64> (LongId)

Identifier of the response generation request.

query Parameters
waitTimeSeconds
integer <int32> [ 0 .. 30 ]
Default: 3

HTTP request timeout. Used in long polling.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "chatId": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Cancel response generation request within a user chat

Authorizations:
bearerAuth
path Parameters
chatId
required
integer <int64> (LongId)

Identifier of the chat in the knowledge base project.

queryId
required
integer <int64> (LongId)

Identifier of the response generation request.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "chatId": 0,
  • "request": "string",
  • "response": "string",
  • "status": "READY_TO_PROCESS",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "comment": "string"
}