$rag.project.getInfo
The method returns information about the knowledge base project in Tovie Data Agent.
caution
The method is available only in the ECMAScript 6 runtime and is asynchronous.
Syntax
The method accepts the following arguments:
Argument | Type | Description | Required |
---|---|---|---|
secretName | String | Name of the knowledge base secret. | Yes |
timeout | Number | Timeout in milliseconds for the method execution. If the timeout is exceeded, an error will occur. By default, the timeout is not set. | No |
You can pass arguments to the method in different ways.
- Positional arguments
- Via object
Specify the arguments in order:
await $rag.project.getInfo("MyKnowledgeHub", 5000);
Pass an object whose fields match the names of the arguments:
await $rag.project.getInfo({
secretName: "MyKnowledgeHub",
timeout: 5000
});
Return value
The method returns an object with information about the Tovie Data Agent project:
{
"id": 12345,
"name": "My Knowledge Hub",
"status": "ACTIVE",
"createdAt": "2024-12-02T11:36:09.245630Z",
"resources": {
"llmModels": [
"GPT-4o",
"GPT-4o-mini"
]
},
"updatedAt": "2024-12-02T13:27:01.343327Z"
}
The object has the same format as the response to the GET /api/knowledge-hub/info
request in the Tovie Data Agent API.
How to use
In this state, the bot will send the current status of the knowledge base:
state: Status
intent!: /status
scriptEs6:
var projectInfo = await $rag.project.getInfo("MyKnowledgeHub");
$reactions.answer("Status: " + projectInfo.status);