Nick: revert trailing comma

This commit is contained in:
Nicolas
2024-12-11 19:51:08 -03:00
parent 52f2e733e2
commit 8a1c404918
121 changed files with 1965 additions and 1952 deletions
+5 -5
View File
@@ -10,7 +10,7 @@ import { logger } from "../logger";
export async function generateCompletions(
documents: Document[],
extractionOptions: ExtractorOptions | undefined,
mode: "markdown" | "raw-html"
mode: "markdown" | "raw-html",
): Promise<Document[]> {
// const schema = zodToJsonSchema(options.schema)
@@ -32,7 +32,7 @@ export async function generateCompletions(
schema: schema,
prompt: prompt,
systemPrompt: systemPrompt,
mode: mode
mode: mode,
});
// Validate the JSON output against the schema using AJV
if (schema) {
@@ -43,8 +43,8 @@ export async function generateCompletions(
`JSON parsing error(s): ${validate.errors
?.map((err) => err.message)
.join(
", "
)}\n\nLLM extraction did not match the extraction schema you provided. This could be because of a model hallucination, or an Error on our side. Try adjusting your prompt, and if it doesn't work reach out to support.`
", ",
)}\n\nLLM extraction did not match the extraction schema you provided. This could be because of a model hallucination, or an Error on our side. Try adjusting your prompt, and if it doesn't work reach out to support.`,
);
}
}
@@ -57,7 +57,7 @@ export async function generateCompletions(
default:
throw new Error("Invalid client");
}
})
}),
);
return completions;