From 4bb46ed1520d239ab1c9e67bacd41914ab10e5a4 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 1 Dec 2024 20:29:03 -0300 Subject: [PATCH] Nick: extract prompt fixes and limit the number of urls --- apps/api/src/controllers/v1/extract.ts | 2 +- apps/api/src/controllers/v1/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/controllers/v1/extract.ts b/apps/api/src/controllers/v1/extract.ts index f59b1ff13..736c87600 100644 --- a/apps/api/src/controllers/v1/extract.ts +++ b/apps/api/src/controllers/v1/extract.ts @@ -207,7 +207,7 @@ export async function extractController( logger.child({ method: "extractController/generateOpenAICompletions" }), { mode: "llm", - systemPrompt: "Always prioritize using the provided content to answer the question. Do not make up an answer. Be concise and follow the schema if provided.", + systemPrompt: "Always prioritize using the provided content to answer the question. Do not make up an answer. Be concise and follow the schema if provided. Here are the urls the user provided of which he wants to extract information from: " + links.join(", "), prompt: req.body.prompt, schema: req.body.schema, }, diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 639589eef..f03d014ae 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -155,7 +155,7 @@ export const scrapeOptions = z.object({ export type ScrapeOptions = z.infer; export const extractV1Options = z.object({ - urls: url.array(), + urls: url.array().max(10, "Maximum of 10 URLs allowed per request while in beta."), prompt: z.string().optional(), schema: z.any().optional(), limit: z.number().int().positive().finite().safe().optional(),