@simpleplatform/sdk 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/ai.d.ts +5 -5
- package/dist/ai.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -444,9 +444,9 @@ console.log(result.data.participants) // ["Customer", "Support Agent"]
|
|
|
444
444
|
Read the pages of a PDF that have no usable text of their own — scans,
|
|
445
445
|
image-only exhibits — from their images. Each such page is transcribed once,
|
|
446
446
|
and it is the same transcription an `extract` or `summarize` that asks for text
|
|
447
|
-
is given in the page's place, so
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
is given in the page's place, so the text you hold for an image page is exactly
|
|
448
|
+
the text the answer was built on. Pages with a readable text layer are not
|
|
449
|
+
returned.
|
|
450
450
|
|
|
451
451
|
```typescript
|
|
452
452
|
import { transcribePages } from '@simpleplatform/sdk/ai'
|
|
@@ -463,7 +463,7 @@ for (const page of data.pages) {
|
|
|
463
463
|
continue
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
console.log(page.page, page.text
|
|
466
|
+
console.log(page.page, page.text)
|
|
467
467
|
}
|
|
468
468
|
```
|
|
469
469
|
|
package/dist/ai.d.ts
CHANGED
|
@@ -400,10 +400,9 @@ export declare function transcribe(input: DocumentHandle, options: AITranscribeO
|
|
|
400
400
|
* image-only exhibits, text that reads as noise — from their images.
|
|
401
401
|
*
|
|
402
402
|
* Every such page is read once, and it is the same transcription an `extract`
|
|
403
|
-
* or `summarize` that asked for text is given in the page's place, so
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
* neither read nor returned.
|
|
403
|
+
* or `summarize` that asked for text is given in the page's place, so the text
|
|
404
|
+
* a caller holds for an image page is exactly the text the answer was built on.
|
|
405
|
+
* Pages the platform reads as text are neither read nor returned.
|
|
407
406
|
*
|
|
408
407
|
* A page is not transcribed a second time to check the first: that would be
|
|
409
408
|
* the same model reading the same image again, doubling the cost of every
|
|
@@ -430,10 +429,11 @@ export declare function transcribe(input: DocumentHandle, options: AITranscribeO
|
|
|
430
429
|
* context,
|
|
431
430
|
* )
|
|
432
431
|
*
|
|
432
|
+
* const pages = new Map<number, string>()
|
|
433
433
|
* for (const page of data.pages) {
|
|
434
434
|
* if ('error' in page)
|
|
435
435
|
* continue
|
|
436
|
-
*
|
|
436
|
+
* pages.set(page.page, page.text) // the text the answer was built on
|
|
437
437
|
* }
|
|
438
438
|
*/
|
|
439
439
|
export declare function transcribePages(document: AITranscribePagesInput, options: AITranscribePagesOptions, context: Context): Promise<AITranscriptionResult>;
|
package/dist/ai.js
CHANGED
|
@@ -322,10 +322,9 @@ export async function transcribe(input, options, context) {
|
|
|
322
322
|
* image-only exhibits, text that reads as noise — from their images.
|
|
323
323
|
*
|
|
324
324
|
* Every such page is read once, and it is the same transcription an `extract`
|
|
325
|
-
* or `summarize` that asked for text is given in the page's place, so
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
* neither read nor returned.
|
|
325
|
+
* or `summarize` that asked for text is given in the page's place, so the text
|
|
326
|
+
* a caller holds for an image page is exactly the text the answer was built on.
|
|
327
|
+
* Pages the platform reads as text are neither read nor returned.
|
|
329
328
|
*
|
|
330
329
|
* A page is not transcribed a second time to check the first: that would be
|
|
331
330
|
* the same model reading the same image again, doubling the cost of every
|
|
@@ -352,10 +351,11 @@ export async function transcribe(input, options, context) {
|
|
|
352
351
|
* context,
|
|
353
352
|
* )
|
|
354
353
|
*
|
|
354
|
+
* const pages = new Map<number, string>()
|
|
355
355
|
* for (const page of data.pages) {
|
|
356
356
|
* if ('error' in page)
|
|
357
357
|
* continue
|
|
358
|
-
*
|
|
358
|
+
* pages.set(page.page, page.text) // the text the answer was built on
|
|
359
359
|
* }
|
|
360
360
|
*/
|
|
361
361
|
export async function transcribePages(document, options, context) {
|