/** * This includes all the functions you can use to communicate with our analytics API * * @module Analytics Methods */ import { AnalyticsQuery, ClusterAnalytics, ComponentAnalytics, CTRAnalytics, CTRDataRequestBody, EventTypes, GetEventsRequestBody, GetTopDatasetsRequestBody, RAGAnalytics, RateQueryRequest, RecommendationAnalytics, SearchAnalytics } from "../../fetch-client"; import { TrieveSDK } from "../../sdk"; /** * Function that allows you to view the CTR analytics for a dataset. * * Example: * ```js *const data = await trieve.getCTRAnalytics({ filter: { date_range: { gt: "2021-01-01 00:00:00.000", gte: "2021-01-01 00:00:00.000", lt: "2021-01-01 00:00:00.000", lte: "2021-01-01 00:00:00.000" }, search_method: "fulltext", search_type: "search" }, type: "search_ctr_metrics" }); * ``` */ export declare function getCTRAnalytics( /** @hidden */ this: TrieveSDK, data: CTRAnalytics, signal?: AbortSignal): Promise; /** * Function that allows you too send CTR data to the system. * * Example: * ```js *const data = await trieve.sendCTRAnalytics({ clicked_chunk_id: "3c90c3cc-0d44-4b50-8888-8dd25736052a", ctr_type: "search", position: 123, request_id: "3c90c3cc-0d44-4b50-8888-8dd25736052a" }); * ``` */ export declare function sendCTRAnalytics( /** @hidden */ this: TrieveSDK, data: CTRDataRequestBody, signal?: AbortSignal): Promise; /** * Function that allows you to send analytics events to the system. * * Example: * ```js * const data = await trieve.sendAnalyticsEvent({ * event_type: "view", * metadata: { * "test": "test" * }, * user_id: "user1" * }); * ``` */ export declare function sendAnalyticsEvent( /** @hidden */ this: TrieveSDK, data: EventTypes, signal?: AbortSignal): Promise; /** * Function that allows you to view the RAG analytics for a dataset. * * Example: * ```js *const data = await trieve.getRagAnalytics({ filter: { date_range: { gt: "2021-01-01 00:00:00.000", gte: "2021-01-01 00:00:00.000", lt: "2021-01-01 00:00:00.000", lte: "2021-01-01 00:00:00.000", }, rag_type: "chosen_chunks", }, page: 1, sort_by: "created_at", sort_order: "desc", type: "rag_queries", }); * ``` */ export declare function getRagAnalytics( /** @hidden */ this: TrieveSDK, data: RAGAnalytics, signal?: AbortSignal): Promise; /** * Function that allows you to view the recommendation analytics for a dataset. * * Example: * ```js *const data = await trieve.getRecommendationAnalytics({ filter: { date_range: { gt: "2021-01-01 00:00:00.000", gte: "2021-01-01 00:00:00.000", lt: "2021-01-01 00:00:00.000", lte: "2021-01-01 00:00:00.000", }, recommendation_type: "Chunk", }, page: 1, threshold: 123, type: "low_confidence_recommendations", }); * ``` */ export declare function getRecommendationAnalytics( /** @hidden */ this: TrieveSDK, data: RecommendationAnalytics, signal?: AbortSignal): Promise; /** * Function that allows you to view the search analytics for a dataset. * * Example: * ```js *const data = await trieve.getSearchAnalytics({ filter: { date_range: { gt: "2021-01-01 00:00:00.000", gte: "2021-01-01 00:00:00.000", lt: "2021-01-01 00:00:00.000", lte: "2021-01-01 00:00:00.000", }, search_method: "fulltext", search_type: "search", }, granularity: "minute", type: "latency_graph", }); * ``` */ export declare function getSearchAnalytics( /** @hidden */ this: TrieveSDK, data: SearchAnalytics, signal?: AbortSignal): Promise; /** * Function that allows you to view the cluster analytics for a dataset. * * Example: * ```js *const data = await trieve.getClusterAnalytics({ filter: { date_range: { gt: "2021-01-01 00:00:00.000", gte: "2021-01-01 00:00:00.000", lt: "2021-01-01 00:00:00.000", lte: "2021-01-01 00:00:00.000", }, }, type: "cluster_topics", }); * ``` */ export declare function getClusterAnalytics( /** @hidden */ this: TrieveSDK, data: ClusterAnalytics, signal?: AbortSignal): Promise; /** * Function that allows you to view the component analytics for a dataset. * * Example: * ```js *const data = await trieve.getComponentAnalytics({ filter: { date_range: { gt: "2021-01-01 00:00:00.000", gte: "2021-01-01 00:00:00.000", lt: "2021-01-01 00:00:00.000", lte: "2021-01-01 00:00:00.000", }, }, granularity: "minute", type: "total_unique_visitors", }); * ``` */ export declare function getComponentAnalytics( /** @hidden */ this: TrieveSDK, data: ComponentAnalytics, signal?: AbortSignal): Promise; /** * Function that allows you to rate a RAG query. * * Example: * ```js *const data = await trieve.rateRagQuery({ query_id: 123, rating: 1, }); * ``` */ export declare function rateRagQuery( /** @hidden */ this: TrieveSDK, data: RateQueryRequest, signal?: AbortSignal): Promise; /** * Function that allows you to rate a search query. * * Example: * ```js *const data = await trieve.rateSearchQuery({ query_id: 123, rating: 1, }); * ``` */ export declare function rateSearchQuery( /** @hidden */ this: TrieveSDK, data: RateQueryRequest, signal?: AbortSignal): Promise; /** * Function that allows you to fetch the top datasets for an organization * * Example: * ```js *const data = await trieve.getTopDatasets({ organizationId: 123, type: "search" }); * ``` */ export declare function getTopDatasets( /** @hidden */ this: TrieveSDK, data: GetTopDatasetsRequestBody & { organizationId: string; }, signal?: AbortSignal): Promise; /** * Function that allows you to view the CTR analytics for a dataset. * * Example: * ```js *const data = await trieve.getAllAnalyticsEvents({ filter: { "date_range": { "gt": "2021-08-10T00:00:00Z", "lt": "2021-08-11T00:00:00Z" }, "event_type": "view", "is_conversion": true, "metadata_filter": "path = \"value\"", "user_id": "user1" }, }); * ``` */ export declare function getAllAnalyticsEvents( /** @hidden */ this: TrieveSDK, data: GetEventsRequestBody, signal?: AbortSignal): Promise; /** * Function that allows you to run a custom clickhouse query * * Example: * ```js *const data = await trieve.getAnalytics({ query: new AnalyticsQueryBuilder() .select('event_type') .from('events') .where(AnalyticsQueryBuilder.and([ AnalyticsQueryBuilder.eq('event_type', 'view'), AnalyticsQueryBuilder.eq('user_id', 'user1') ])) }); * ``` */ export declare function getAnalytics( /** @hidden */ this: TrieveSDK, data: AnalyticsQuery, signal?: AbortSignal): Promise; //# sourceMappingURL=index.d.ts.map