更新
This commit is contained in:
@@ -179,6 +179,10 @@ final class DifyRequiredAttachmentUpload
|
||||
self::check($deadline, $shouldAbort);
|
||||
$textCheck = ['status' => 'disabled', 'images' => []];
|
||||
if ($imageSources !== [] && !empty($options['ocr']['enabled'])) {
|
||||
// Created only after the current authorized source copies/uploads succeeded.
|
||||
// Never accept a caller-supplied cache scope; existing reuse opt-out disables OCR reuse too.
|
||||
$options['ocr']['_cache_scope'] = !empty($options['reuse_uploaded_files'])
|
||||
? hash_hmac('sha256', serialize(['clinical-ocr-v1', $endpoint, $user]), $apiKey) : null;
|
||||
$ocrStarted = microtime(true);
|
||||
try { $textCheck = self::optionalImageText($imageSources, $tempRoot, $deadline, $shouldAbort, $options); }
|
||||
finally { $timing['ocr_ms'] += max(0, (int) round((microtime(true) - $ocrStarted) * 1000)); }
|
||||
|
||||
Reference in New Issue
Block a user