Skip to content

Commit

Permalink
bugfix: fix load error
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh authored and skeptrunedev committed Feb 25, 2025
1 parent bd39cf4 commit 256f192
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 24 deletions.
7 changes: 6 additions & 1 deletion clients/search-component/src/utils/hooks/setClickTriggers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { startTransition } from "react";
import { ModalProps, SearchModes, useModalState } from "./modal-context";

Check failure on line 2 in clients/search-component/src/utils/hooks/setClickTriggers.ts

View workflow job for this annotation

GitHub Actions / tests

'useModalState' is defined but never used
import { TrieveSDK } from "trieve-ts-sdk";

export const setClickTriggers = (
setOpen: (open: boolean) => void,
Expand Down Expand Up @@ -27,7 +28,11 @@ export const setClickTriggers = (
}

if (element) {
const { trieveSDK } = useModalState();
const trieveSDK = new TrieveSDK({
apiKey: props.apiKey,
datasetId: props.datasetId,
});

trieveSDK.sendAnalyticsEvent({
event_name: `${props.componentName}_click`,
event_type: "click",
Expand Down
47 changes: 28 additions & 19 deletions clients/ts-sdk/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9829,37 +9829,44 @@
"p99",
"p95",
"p50",
"percent_thumbs_up",
"percent_thumbs_down"
"total_positive_ratings",
"total_negative_ratings"
],
"properties": {
"avg_latency": {
"type": "number",
"format": "double"
"format": "double",
"description": "Average latency of search queries"
},
"p50": {
"type": "number",
"format": "double"
"format": "double",
"description": "50th percentile latency of search queries"
},
"p95": {
"type": "number",
"format": "double"
"format": "double",
"description": "95th percentile latency of search queries"
},
"p99": {
"type": "number",
"format": "double"
"format": "double",
"description": "99th percentile latency of search queries"
},
"percent_thumbs_down": {
"total_negative_ratings": {
"type": "number",
"format": "double"
"format": "double",
"description": "Total number of searches with a negative rating"
},
"percent_thumbs_up": {
"total_positive_ratings": {
"type": "number",
"format": "double"
"format": "double",
"description": "Total number of searches with a positive rating"
},
"total_queries": {
"type": "integer",
"format": "int64"
"format": "int64",
"description": "Total number of search queries"
}
}
},
Expand Down Expand Up @@ -13884,17 +13891,19 @@
"type": "object",
"title": "RagQueryRatingsResponse",
"required": [
"percent_thumbs_up",
"percent_thumbs_down"
"total_positive_ratings",
"total_negative_ratings"
],
"properties": {
"percent_thumbs_down": {
"type": "number",
"format": "double"
"total_negative_ratings": {
"type": "integer",
"format": "int64",
"description": "Total number of negative RAG ratings"
},
"percent_thumbs_up": {
"type": "number",
"format": "double"
"total_positive_ratings": {
"type": "integer",
"format": "int64",
"description": "Total number of positive RAG ratings"
}
}
},
Expand Down
35 changes: 31 additions & 4 deletions clients/ts-sdk/src/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,33 @@ export type Dataset = {
};

export type DatasetAnalytics = {
/**
* Average latency of search queries
*/
avg_latency: number;
/**
* 50th percentile latency of search queries
*/
p50: number;
/**
* 95th percentile latency of search queries
*/
p95: number;
/**
* 99th percentile latency of search queries
*/
p99: number;
percent_thumbs_down: number;
percent_thumbs_up: number;
/**
* Total number of searches with a negative rating
*/
total_negative_ratings: number;
/**
* Total number of searches with a positive rating
*/
total_positive_ratings: number;
/**
* Total number of search queries
*/
total_queries: number;
};

Expand Down Expand Up @@ -2401,8 +2422,14 @@ export type RagQueryEvent = {
};

export type RagQueryRatingsResponse = {
percent_thumbs_down: number;
percent_thumbs_up: number;
/**
* Total number of negative RAG ratings
*/
total_negative_ratings: number;
/**
* Total number of positive RAG ratings
*/
total_positive_ratings: number;
};

export type RagQueryResponse = {
Expand Down

0 comments on commit 256f192

Please sign in to comment.