Skip to main content

$rag.project.getInfo

The method returns information about the knowledge base project in Jay Knowledge Hub.

caution

The method is available only in the ECMAScript 6 runtime and is asynchronous.

Syntax

The method accepts the following arguments:

ArgumentTypeDescriptionRequired
secretNameStringName of the knowledge base secret.Yes
timeoutNumber

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.

Specify the arguments in order:

await $rag.project.getInfo("MyKnowledgeHub", 5000);

Return value

The method returns an object with information about the Jay Knowledge Hub 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 Jay Knowledge Hub 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);