Skip to content

Commit

Permalink
update openai access to jobs embedding (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Jun 24, 2024
1 parent 0074afd commit 9e08b2b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/registry/pages/api/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function handler(req, res) {

const desiredLength = 3072;

let embedding = completion.data.data[0].embedding;
let embedding = completion.data[0].embedding;

if (embedding.length < desiredLength) {
embedding = embedding.concat(
Expand All @@ -57,7 +57,8 @@ export default async function handler(req, res) {

const filteredJobs = jobs.filter(
(job) =>
new Date(job.created_at) > new Date(Date.now() - 60 * 24 * 60 * 60 * 1000)
new Date(job.created_at) >
new Date(Date.now() - 60 * 24 * 60 * 120 * 1000)
);

return res.status(200).send(filteredJobs);
Expand Down

0 comments on commit 9e08b2b

Please sign in to comment.