Skip to main content

@nuclia/core / Exports / ActivityMonitor

Class: ActivityMonitor

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ActivityMonitor(kb, nuclia)

Parameters

NameType
kbWritableKnowledgeBox
nucliaINuclia

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

NameType
eventTypeEventType
queryActivityLogDownloadQuery
formatDownloadFormat

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

NameType
requestIdstring

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

NameTypeDescription
eventIdnumberIdentifier 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

NameType
eventTypeEventType

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

NameTypeDescription
fromstringTimestamp of the moment from which we want the metrics.
to?stringTimestamp of the moment until which we want the metrics. When not provided, the metrics are returned "until now".
aggregation?UsageAggregationDefine 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

NameTypeDescription
criteriaRemiQueryCriteriaObject representing the query to be done. It currently supports querying on context relevance, answer status or answer feedback.

Returns

Observable<RemiQueryResponse>

Defined in

libs/sdk-core/src/lib/db/kb/activity/activity-monitor.ts:55