Nick: revert trailing comma
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user