fixes ocr for newer open ai models

This commit is contained in:
Timon_bed committed 2026-08-30 17:37:52 +02:00
1 parent 320788a984
commit 6ab3b02935
5 files changed
+49 -11

No files matched your search

@@ -37,6 +37,9 @@ describe("supportsVisionForConfig", () => {
] as const) {
expect(supportsVisionForConfig(providerType, "gpt-4o")).toBe(true);
expect(supportsVisionForConfig(providerType, "gpt-4o-mini")).toBe(true);
expect(supportsVisionForConfig(providerType, "gpt-5.6-terra")).toBe(
true,
);
expect(supportsVisionForConfig(providerType, "gpt-4.1")).toBe(true);
expect(supportsVisionForConfig(providerType, "gpt-4-turbo")).toBe(true);
// Full o-series reasoning models read images.
+4 -3
View File
@@ -189,13 +189,14 @@ export const AI_BUDGETS = {
* v1.18.9 — Lab-OCR structured extraction. ONE vision call transcribes a
* photo / PDF of a paper lab report into a JSON array of analyte rows
* (analyte + value/valueText + unit + reference range + date + per-field
* confidence). A full panel is a dozen-plus rows of compact JSON; 4000
* tokens covers a dense report plus the envelope. Temperature 0 — the task
* confidence). A full panel is a dozen-plus rows of compact JSON; 8000
* tokens leaves room for GPT-5 reasoning plus the dense report envelope.
* Temperature 0 — the task
* is faithful transcription, not generation, so the lowest setting minimises
* invented values. Vision input tokens are expensive, so the route also
* gates with a tight 6/hour rate bucket + reserveBudget + upload-size cap.
*/
ocrExtract: { temperature: 0, maxTokens: 4000 },
ocrExtract: { temperature: 0, maxTokens: 8000 },
/**
* v1.20.1 — Lab-OCR text-mode structuring. The browser OCR's the image
+1
View File
@@ -63,6 +63,7 @@ function isVisionReasoningSlug(m: string): boolean {
function openaiSupportsVision(model: string): boolean {
const m = model.toLowerCase();
return (
m.startsWith("gpt-5") ||
m.startsWith("gpt-4o") ||
m.startsWith("gpt-4.1") ||
m.startsWith("gpt-4-turbo") ||