@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 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 a quote on an image page can be checked
448
- against the text the answer was built on. Pages with a readable text layer are
449
- not returned.
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.includes(quote))
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 a caller
404
- * can check that a quote on an image page is really there by looking for it in
405
- * the text the answer was built on. Pages the platform reads as text are
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
- * const quoted = page.text.includes(quote)
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 a caller
326
- * can check that a quote on an image page is really there by looking for it in
327
- * the text the answer was built on. Pages the platform reads as text are
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
- * const quoted = page.text.includes(quote)
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleplatform/sdk",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Simple Platform Typescript SDK",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.simple.dev",