690604:1107 ADR-034-134 #06
This commit is contained in:
@@ -116,6 +116,11 @@ export class AiQueueService {
|
|||||||
filePublicId?: string;
|
filePublicId?: string;
|
||||||
pdfPath?: string;
|
pdfPath?: string;
|
||||||
engineType?: string;
|
engineType?: string;
|
||||||
|
typhoonOptions?: {
|
||||||
|
temperature?: number;
|
||||||
|
topP?: number;
|
||||||
|
repeatPenalty?: number;
|
||||||
|
};
|
||||||
extraPayload?: Record<string, unknown>;
|
extraPayload?: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
@@ -131,6 +136,7 @@ export class AiQueueService {
|
|||||||
filePublicId: payload.filePublicId,
|
filePublicId: payload.filePublicId,
|
||||||
pdfPath: payload.pdfPath,
|
pdfPath: payload.pdfPath,
|
||||||
engineType: payload.engineType,
|
engineType: payload.engineType,
|
||||||
|
typhoonOptions: payload.typhoonOptions,
|
||||||
...payload.extraPayload,
|
...payload.extraPayload,
|
||||||
},
|
},
|
||||||
idempotencyKey: payload.idempotencyKey,
|
idempotencyKey: payload.idempotencyKey,
|
||||||
|
|||||||
@@ -452,6 +452,9 @@ export class AiBatchProcessor extends WorkerHost {
|
|||||||
const { idempotencyKey, payload } = data;
|
const { idempotencyKey, payload } = data;
|
||||||
const pdfPath = payload.pdfPath as string;
|
const pdfPath = payload.pdfPath as string;
|
||||||
const engineType = (payload.engineType as SandboxOcrEngineType) || 'auto';
|
const engineType = (payload.engineType as SandboxOcrEngineType) || 'auto';
|
||||||
|
const typhoonOptions = payload.typhoonOptions as
|
||||||
|
| { temperature?: number; topP?: number; repeatPenalty?: number }
|
||||||
|
| undefined;
|
||||||
|
|
||||||
if (!pdfPath) {
|
if (!pdfPath) {
|
||||||
throw new Error('pdfPath is required for sandbox-ocr-only job');
|
throw new Error('pdfPath is required for sandbox-ocr-only job');
|
||||||
@@ -469,7 +472,8 @@ export class AiBatchProcessor extends WorkerHost {
|
|||||||
try {
|
try {
|
||||||
const ocrResult = await this.sandboxOcrEngineService.detectAndExtract(
|
const ocrResult = await this.sandboxOcrEngineService.detectAndExtract(
|
||||||
pdfPath,
|
pdfPath,
|
||||||
engineType
|
engineType,
|
||||||
|
typhoonOptions
|
||||||
);
|
);
|
||||||
|
|
||||||
// Cache OCR text สำหรับ Step 2
|
// Cache OCR text สำหรับ Step 2
|
||||||
|
|||||||
Reference in New Issue
Block a user