Skip to main content

ActivityMonitor

@nuclia/coreDocs


@nuclia/core / ActivityMonitor

Class: ActivityMonitor

Constructors

new ActivityMonitor()

new ActivityMonitor(kb, nuclia): ActivityMonitor

Parameters

kb: WritableKnowledgeBox

nuclia: INuclia

Returns

ActivityMonitor

Defined in

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

Properties

kb

kb: WritableKnowledgeBox

Defined in

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


nuclia

nuclia: INuclia

Defined in

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

Methods

createActivityLogDownload()

createActivityLogDownload(eventType, query, format): Observable<ActivityLogDownload>

Create a URL to download activity log data

Parameters

eventType: EventType

query: ActivityLogDownloadQuery

format: DownloadFormat

Returns

Observable<ActivityLogDownload>

Defined in

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


getDownloadStatus()

getDownloadStatus(requestId): Observable<ActivityLogDownload>

Get the status of a download request

Parameters

requestId: string

Returns

Observable<ActivityLogDownload>

Defined in

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


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

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:65


getMonthsWithActivity()

getMonthsWithActivity(eventType): Observable<object>

Get the list of months with available activity log data for a specific event type

Parameters

eventType: EventType

Returns

Observable<object>

downloads

downloads: string[]

Defined in

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


getRemiScores()

getRemiScores(from, to?, aggregation?): Observable<RemiScoresResponseItem[]>

Get the evolution of REMi scores of a KB on the specified time range.

Parameters

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:40


getSearchMetrics()

getSearchMetrics(from, to?, aggregation?): Observable<SearchMetricsItem[]>

Retrieve statistics for search and ask requests

Parameters

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.

Returns

Observable<SearchMetricsItem[]>

Defined in

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


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

criteria: RemiQueryCriteria

Object 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:56