@nuclia/core / Exports / ActivityMonitor
Class: ActivityMonitor
Table of contents
Constructors
Properties
Methods
- createActivityLogDownload
- getDownloadStatus
- getFullContexts
- getMonthsWithActivity
- getRemiScores
- queryRemiScores
Constructors
constructor
• new ActivityMonitor(kb
, nuclia
)
Parameters
Name | Type |
---|---|
kb | WritableKnowledgeBox |
nuclia | INuclia |
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:20
Properties
kb
• kb: WritableKnowledgeBox
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:17
nuclia
• nuclia: INuclia
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:18
Methods
createActivityLogDownload
▸ createActivityLogDownload(eventType
, query
, format
): Observable
<ActivityLogDownload
>
Create a URL to download activity log data
Parameters
Name | Type |
---|---|
eventType | EventType |
query | ActivityLogDownloadQuery |
format | DownloadFormat |
Returns
Observable
<ActivityLogDownload
>
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:75
getDownloadStatus
▸ getDownloadStatus(requestId
): Observable
<ActivityLogDownload
>
Get the status of a download request
Parameters
Name | Type |
---|---|
requestId | string |
Returns
Observable
<ActivityLogDownload
>
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:94
getFullContexts
▸ getFullContexts(eventId
): Observable
<RemiQueryResponseContextDetails
>
Get the RAG request (question and answer), the REMi scores and the full contexts list for a specific item coming from queryRemiScores
method.
Parameters
Name | Type | Description |
---|---|---|
eventId | number | Identifier of an item from queryRemiScores response. |
Returns
Observable
<RemiQueryResponseContextDetails
>
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:64
getMonthsWithActivity
▸ getMonthsWithActivity(eventType
): Observable
<{ downloads
: string
[] }>
Get the list of months with available activity log data for a specific event type
Parameters
Name | Type |
---|---|
eventType | EventType |
Returns
Observable
<{ downloads
: string
[] }>
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:103
getRemiScores
▸ getRemiScores(from
, to?
, aggregation?
): Observable
<RemiScoresResponseItem
[]>
Get the evolution of REMi scores of a KB on the specified time range.
Parameters
Name | Type | Description |
---|---|---|
from | string | Timestamp of the moment from which we want the metrics. |
to? | string | Timestamp of the moment until which we want the metrics. When not provided, the metrics are returned "until now". |
aggregation? | UsageAggregation | Define how the metrics are aggregated. By default, the endpoint returns only one point aggregating all the data for the specified date range. But you can have one point by: - "hour" - "day" - "week" - "month" - "quarter" - "year" - "millennium" (used by default) |
Returns
Observable
<RemiScoresResponseItem
[]>
Defined in
libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:39
queryRemiScores
▸ queryRemiScores(criteria
): Observable
<RemiQueryResponse
>
Get a list of RAG requests and their scores (if any) that matches a REMi scores query or a status.
Parameters
Name | Type | Description |
---|---|---|
criteria | RemiQueryCriteria | Object representing the query to be done. It currently supports querying on context relevance, answer status or answer feedback. |
Returns
Observable
<RemiQueryResponse
>