[go: nahoru, domu]

Skip to content

Commit

Permalink
fmt: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh committed Jun 26, 2024
1 parent b3e3d6c commit 0f33426
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
4 changes: 0 additions & 4 deletions analytics/clustering-script/get_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def get_topics(kmeans, vectors, data, n_points=5):
if row[4] == i:
row.append(cosine(centroid, row[3]))

print([data[idx][1] for idx in closest_indices])

# Create a request to the ChatGPT model
response = anthropic_client.messages.create(
model="claude-3-haiku-20240307",
Expand Down Expand Up @@ -104,7 +102,6 @@ def append_cluster_membership(data, kmeans):
def insert_centroids(
client: clickhouse_connect.driver.client.Client, data, dataset_id, topics
):
print(data[0][5])
cluster_ids_to_delete_query = """
SELECT id
FROM trieve.cluster_topics
Expand All @@ -115,7 +112,6 @@ def insert_centroids(
cluster_ids_to_delete = [
str(row[0]) for row in client.query(cluster_ids_to_delete_query).result_rows
]
print(cluster_ids_to_delete)

delete_previous_query = """
DELETE FROM trieve.cluster_topics
Expand Down
22 changes: 11 additions & 11 deletions server/src/handlers/analytics_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use super::auth_handler::AdminOnly;
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get query clusters for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get query clusters for."),
),
security(
Expand Down Expand Up @@ -88,9 +88,9 @@ pub struct GetTopicQueries {
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get query clusters for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get query clusters for."),
("page" = i32, Query, description = "The page number to get the queries for the topic"),
("cluster_id" = uuid, Path, description = "The id of the cluster you want to get queries for.")
("cluster_id" = uuid::Uuid, Path, description = "The id of the cluster you want to get queries for.")
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -151,8 +151,8 @@ pub struct GetQueryRequest {
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get the search for."),
("search_id" = uuid, Path, description = "The id of the search.")
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get the search for."),
("search_id" = uuid::Uuid, Path, description = "The id of the search.")
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -209,7 +209,7 @@ pub struct GetDatasetMetricsRequest {
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get search metrics for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get search metrics for."),
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -279,7 +279,7 @@ pub struct GetHeadQueriesRequest {
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get head queries for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get head queries for."),
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -350,7 +350,7 @@ pub async fn get_head_queries(
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get low confidence queries for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get low confidence queries for."),
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -432,7 +432,7 @@ pub struct GetAllQueriesRequest {
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get queries for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get queries for."),
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -514,7 +514,7 @@ pub struct GetRPSGraphRequest {
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get RPS graph for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get RPS graph for."),
),
security(
("ApiKey" = ["admin"]),
Expand Down Expand Up @@ -609,7 +609,7 @@ pub async fn get_rps_graph(
),
params(
("TR-Dataset" = String, Header, description = "The dataset id to use for the request"),
("dataset_id" = uuid, Path, description = "The id of the dataset you want to get latency graph for."),
("dataset_id" = uuid::Uuid, Path, description = "The id of the dataset you want to get latency graph for."),
),
security(
("ApiKey" = ["admin"]),
Expand Down
2 changes: 1 addition & 1 deletion server/src/operators/analytics_operator.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
data::models::{ChunkMetadataTypes, SearchQueryEvent, SearchQueryEventClickhouse},
data::models::{ChunkMetadataTypes, SearchQueryEventClickhouse},
errors::ServiceError,
handlers::{
chunk_handler::SearchChunkQueryResponseBody, group_handler::SearchWithinGroupResults,
Expand Down
2 changes: 1 addition & 1 deletion server/src/operators/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod chunk_operator;
pub mod analytics_operator;
pub mod chunk_operator;
pub mod dataset_operator;
pub mod email_operator;
pub mod event_operator;
Expand Down

0 comments on commit 0f33426

Please sign in to comment.