Skip to main content

Tovie Data Agent public API (1.0.0)

Download OpenAPI specification:Download

ProjectsPublic

Knowledge base project operations.

Get knowledge base project info

Get 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

Independent requests for chunk retrieval or response generation. The message history can be optionally passed within the request.

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",
  • "relevantSources": [
    ]
}

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",
  • "relevantSources": [
    ]
}

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",
  • "relevantSources": [
    ]
}

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",
  • "relevantSources": [
    ]
}

ChatsPublic

Requests for chunk retrieval and response generation within a user chat.

Create chat

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": {
    }
}

Get chat info

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",
  • "relevantSources": [
    ]
}

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",
  • "relevantSources": [
    ]
}

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",
  • "relevantSources": [
    ]
}

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",
  • "relevantSources": [
    ]
}

SourcesPublic

Sources operations.

Get list of sources

Get the list of knowledge base sources.

Authorizations:
bearerAuth
query Parameters
createDateFrom
string <date>

Select sources added on or after the specified date.

createDateTo
string <date>

Select sources added on or before the specified date.

sourceStatus
string

Select sources with the specified indexing status. Acceptable statuses:

  • READY_TO_INGEST: ready for indexing.
  • PROCESSING: in progress.
  • INGESTED: indexed.
  • FAILED_TO_INGEST: indexing error.

Responses

Response samples

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

Add from text

Add the provided text as a source to the knowledge base. Indexing begins automatically after the source is added.

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

Name of the source. It must be unique within the project. If not specified, it is automatically generated.

text
required
string

Text of the source. The maximum size is specified in the file requirements.

segment
string

Tag (knowledge base segment). If specified, the source will be available when searching by this tag.

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "segment": "string",
  • "status": "string",
  • "lastError": "string",
  • "version": "string",
  • "sizeBytes": 0,
  • "sizeChars": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Update with text

Replace the source with the text provided. Indexing begins automatically after the source is updated.

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

Name of the source. If no source with this name exists, an error is returned.

text
required
string

Text of the source. The maximum size is specified in the file requirements.

segment
string

Tag (knowledge base segment). If specified, the source will be available when searching by this tag.

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "segment": "string",
  • "status": "string",
  • "lastError": "string",
  • "version": "string",
  • "sizeBytes": 0,
  • "sizeChars": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Add from file

Add the provided file as a source to the knowledge base. Indexing begins automatically after the source is added.

Authorizations:
bearerAuth
Request Body schema: multipart/form-data
required
file
required
string <binary>

File to upload. See the file requirements.

name
string

Name of the source. It must be unique within the project. If not specified, it is automatically generated.

segment
string

Tag (knowledge base segment). If specified, the source will be available when searching by this tag.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "segment": "string",
  • "status": "string",
  • "lastError": "string",
  • "version": "string",
  • "sizeBytes": 0,
  • "sizeChars": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Update with file

Replace the source with the file provided. Indexing begins automatically after the source is updated.

Authorizations:
bearerAuth
Request Body schema: multipart/form-data
required
file
required
string <binary>

File to upload. See the file requirements.

name
string

Name of the source. If no source with this name exists, an error is returned.

segment
string

Tag (knowledge base segment). If specified, the source will be available when searching by this tag.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "segment": "string",
  • "status": "string",
  • "lastError": "string",
  • "version": "string",
  • "sizeBytes": 0,
  • "sizeChars": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Get source info

Get information about the knowledge base source.

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

Identifier of the source in the knowledge base project.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "segment": "string",
  • "status": "string",
  • "lastError": "string",
  • "version": "string",
  • "sizeBytes": 0,
  • "sizeChars": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Delete source

Delete the source from the knowledge base.

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

Identifier of the source in the knowledge base project.

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "description": "string"
}

Export source

Export the source file from the knowledge base.

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

Identifier of the source in the knowledge base project.

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "description": "string"
}

IntegrationsPublic

Integrations operations.

Create integration

Add an integration to the knowledge base. Indexing begins automatically after data is downloaded, both when creating the integration or during automatic synchronisation, if enabled.

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

Name of the integration.

autoSync
boolean

Enable automatic data synchronisation

downloadAttachmentFiles
boolean

Enable download attached files in acceptable formats, see the file requirements. This setting does not affect downloading images: they are downloaded anyway.

syncIntervalMinutes
integer

Update interval in minutes. The minimum value is 30.

required
object (IntegrationSettings)

Integration settings.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "autoSync": true,
  • "downloadAttachmentFiles": true,
  • "syncIntervalMinutes": 0,
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "autoSync": true,
  • "syncIntervalMinutes": 0,
  • "settings": {
    },
  • "status": "ACTIVE",
  • "lastError": "string"
}

Get list of integrations

Get the list of knowledge base integrations.

Authorizations:
bearerAuth

Responses

Response samples

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

Get integration info

Get information about the integration.

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

Identifier of the integration.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "autoSync": true,
  • "syncIntervalMinutes": 0,
  • "settings": {
    },
  • "status": "ACTIVE",
  • "lastError": "string"
}

Delete integration

Remove the integration from the knowledge base.

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

Identifier of the integration.

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "description": "string"
}