From 04352e88c4039c65f7723f3df51044f5d83fff29 Mon Sep 17 00:00:00 2001 From: Thomas Davis Date: Sat, 1 Feb 2025 19:05:49 +1100 Subject: [PATCH] wip --- apps/registry/pages/api/jobs-graph.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/registry/pages/api/jobs-graph.js b/apps/registry/pages/api/jobs-graph.js index e7f6f06..e675f76 100644 --- a/apps/registry/pages/api/jobs-graph.js +++ b/apps/registry/pages/api/jobs-graph.js @@ -67,7 +67,7 @@ export default async function handler(req, res) { let embedding = completion.data[0].embedding; if (embedding.length < desiredLength) { embedding = embedding.concat( - Array(desiredLength - embedding.length).fill(0) + Array(desiredLength - embedding.length).fill(0), ); } @@ -145,13 +145,13 @@ export default async function handler(req, res) { (best, current) => { const similarity = cosineSimilarity( lessRelevantVector, - JSON.parse(current.embedding_v5) + JSON.parse(current.embedding_v5), ); return similarity > best.similarity ? { job: current, similarity } : best; }, - { job: null, similarity: -1 } + { job: null, similarity: -1 }, ); if (mostSimilarJob.job) { @@ -173,12 +173,6 @@ export default async function handler(req, res) { jobInfoMap[job.uuid] = JSON.parse(job.gpt_content); }); - // Set cache control headers for CDN caching - res.setHeader( - 'Cache-Control', - 'public, max-age=86400, s-maxage=86400, stale-while-revalidate=604800' - ); - res.status(200).json({ graphData, jobInfoMap,