Skip to content

Commit

Permalink
Nick:
Browse files Browse the repository at this point in the history
  • Loading branch information
nickscamara committed Nov 20, 2024
1 parent d02a8bc commit c9b0a80
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions apps/api/src/__tests__/e2e_extract/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,29 @@ describe("E2E Tests for Extract API Routes", () => {
// expect(response.body).toHaveProperty("data");
// expect(response.body.data?.pciDssCompliance).toBe(true);
}, 60000);

it.concurrent("should return Greenhouse Applicant Tracking System for Abnormal Security", async () => {
const response = await request(TEST_URL)
.post("/v1/extract")
.set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
.set("Content-Type", "application/json")
.send({
urls: ["https://careers.abnormalsecurity.com/jobs/6119456003?gh_jid=6119456003"],
prompt: "what applicant tracking system is this company using?",
schema: {
type: "object",
properties: {
isGreenhouseATS: { type: "boolean" },
answer: { type: "string" }
}
},
allowExternalLinks: true
})

console.log(response.body);
expect(response.statusCode).toBe(200);
expect(response.body).toHaveProperty("data");
expect(response.body.data?.isGreenhouseATS).toBe(true);
}, 60000);

});
1 change: 1 addition & 0 deletions apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export async function generateOpenAICompletions(logger: Logger, options: Extract

const jsonCompletion = await openai.beta.chat.completions.parse({
model,
temperature: 0,
messages: [
{
role: "system",
Expand Down

0 comments on commit c9b0a80

Please sign in to comment.