vecs: add trait + derive crates

This commit is contained in:
nym21
2025-10-04 23:38:54 +02:00
parent a6062d4c39
commit 5fde0101bf
16 changed files with 324 additions and 20 deletions

View File

@@ -35,8 +35,19 @@ impl ApiMetricsRoutes for Router<AppState> {
Json(app_state.interface.get_indexes()).into_response()
}),
)
.route(
"/api/metrics/list",
get(
async |State(app_state): State<AppState>,
Query(pagination): Query<PaginationParam>|
-> Response {
Json(app_state.interface.get_metrics(pagination)).into_response()
},
),
)
// TODO:
// .route(
// "/api/vecs/metrics",
// "/api/metrics/search",
// get(
// async |State(app_state): State<AppState>,
// Query(pagination): Query<PaginationParam>|
@@ -45,16 +56,6 @@ impl ApiMetricsRoutes for Router<AppState> {
// },
// ),
// )
// .route(
// "/api/vecs/index-to-metrics",
// get(
// async |State(app_state): State<AppState>,
// Query(paginated_index): Query<PaginatedIndexParam>|
// -> Response {
// Json(app_state.interface.get_index_to_vecids(paginated_index)).into_response()
// },
// ),
// )
.route(
"/api/metrics/{metric}",
get(
@@ -85,7 +86,7 @@ impl ApiMetricsRoutes for Router<AppState> {
),
)
// !!!
// DEPRECATED
// DEPRECATED: Do not use
// !!!
.route(
"/api/vecs/query",
@@ -100,7 +101,7 @@ impl ApiMetricsRoutes for Router<AppState> {
),
)
// !!!
// DEPRECATED
// DEPRECATED: Do not use
// !!!
.route(
"/api/vecs/{variant}",