fix: make search work
This commit is contained in:
@@ -74,7 +74,7 @@ export function getRecommendation(
|
||||
}
|
||||
|
||||
export async function getSimilarMovies(id: string) {
|
||||
const recs = getRecommendation(id, "movie");
|
||||
const recs = getRecommendation(id, "movies");
|
||||
if (!recs?.keywords?.length) return;
|
||||
|
||||
const recommendations = await openai.getMovieRecommendations(
|
||||
|
||||
@@ -60,7 +60,7 @@ export async function searchResource(
|
||||
(!types || types.includes("recipes")) && listResources("recipes"),
|
||||
])).flat().filter(isResource);
|
||||
|
||||
console.log({ types, rating, tags, q });
|
||||
console.log({ types, rating, tags, q, resourceLength: resources.length });
|
||||
|
||||
const results: Record<string, GenericResource> = {};
|
||||
|
||||
@@ -104,6 +104,7 @@ export async function searchResource(
|
||||
],
|
||||
threshold: 0.3,
|
||||
});
|
||||
console.log({ fuzzyResult });
|
||||
for (const result of fuzzyResult) {
|
||||
results[result.obj.name] = result.obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user