$rag
The $rag
service lets you access the RAG knowledge base from the bot script.
For examples of working with the knowledge base, see the Use in script article.
caution
The service methods are available only in the ECMAScript 6 runtime and are asynchronous.
Methods
General methods
Method | Description |
---|---|
project.getInfo | Get information about the knowledge base project. |
getChatHistory | Get the history of dialog with the bot in the current session. The method returns the history in a format for the knowledge base. |
Single requests to knowledge base
Method | Description |
---|---|
query.generateAnswer | Generate a response to the user query. |
query.generateAnswerAsync | Create a request for response generation. |
query.getAnswer | Get response generation status. |
query.cancelProcessing | Cancel a request for response generation. |
retrieveChunks | Retrieve chunks relevant to the user’s query from a knowledge base. |
Requests within chat with knowledge base
Method | Description |
---|---|
chat.create | Create a chat with a knowledge base. |
chat.get | Get information about a chat. |
chat.processQuery | Generate a response to the user query within a chat. |
chat.processQueryAsync | Create a request for response generation within a chat. |
chat.getQueryAnswer | Get response generation status. |
chat.cancelRecordProcessing | Cancel a request for response generation. |
chat.retrieveChunksFromChat | Retrieve chunks relevant to the user’s query from a knowledge base. |