Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-gupta-ij committed Dec 16, 2024
1 parent 4d8d261 commit 587f41c
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/lib/graph-visualization-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,10 @@ export const getMinimalSpanningTree = (links, acs = true) => {
return mstLinks;
};

// the function which returns metric for given collection and name of the vector

export const getMetrics = async (qdrantClient, { collectionName }) => {
const metricConfig = {};
try {
const collectionInfo = await qdrantClient.getCollection(collectionName);
Object.keys(collectionInfo.config.params.vectors).map((key) => {
if (typeof collectionInfo.config.params.vectors[key] === 'object') {
metricConfig[key] = collectionInfo.config.params.vectors[key].distance;
} else {
metricConfig[''] = collectionInfo.config.params.vectors.distance;
}
});
return metricConfig;
} catch (e) {
console.error(e);
export const getMetrics = async (qdrantClient, { collectionName, vectorName = null }) => {
const collectionInfo = await qdrantClient.getCollection(collectionName);
if (vectorName && collectionInfo.config.params.vectors[vectorName]) {
return collectionInfo.config.params.vectors[vectorName].distance;
}
return collectionInfo.config.params.vectors.distance;
};

0 comments on commit 587f41c

Please sign in to comment.