graphor 0.18.0 → 0.19.1
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/CHANGELOG.md +42 -0
- package/README.md +113 -354
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +11 -0
- package/client.js.map +1 -1
- package/client.mjs +11 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/sources.d.mts +168 -23
- package/resources/sources.d.mts.map +1 -1
- package/resources/sources.d.ts +168 -23
- package/resources/sources.d.ts.map +1 -1
- package/resources/sources.js +50 -8
- package/resources/sources.js.map +1 -1
- package/resources/sources.mjs +50 -8
- package/resources/sources.mjs.map +1 -1
- package/src/client.ts +16 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/index.ts +2 -0
- package/src/resources/sources.ts +197 -22
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
SourceGetBuildStatusResponse,
|
|
32
32
|
SourceGetElementsParams,
|
|
33
33
|
SourceGetElementsResponse,
|
|
34
|
+
SourceGetPageScreenshotParams,
|
|
35
|
+
SourceGetPageScreenshotResponse,
|
|
34
36
|
SourceIngestFileParams,
|
|
35
37
|
SourceIngestFileResponse,
|
|
36
38
|
SourceIngestGitHubParams,
|
|
@@ -199,6 +201,18 @@ export class Graphor {
|
|
|
199
201
|
this.#undiciDispatcher = null;
|
|
200
202
|
this.#encoder = Opts.FallbackEncoder;
|
|
201
203
|
|
|
204
|
+
const customHeadersEnv = readEnv('GRAPHOR_CUSTOM_HEADERS');
|
|
205
|
+
if (customHeadersEnv) {
|
|
206
|
+
const parsed: Record<string, string> = {};
|
|
207
|
+
for (const line of customHeadersEnv.split('\n')) {
|
|
208
|
+
const colon = line.indexOf(':');
|
|
209
|
+
if (colon >= 0) {
|
|
210
|
+
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
|
|
214
|
+
}
|
|
215
|
+
|
|
202
216
|
this._options = options;
|
|
203
217
|
|
|
204
218
|
this.apiKey = apiKey;
|
|
@@ -786,6 +800,7 @@ export declare namespace Graphor {
|
|
|
786
800
|
type SourceExtractResponse as SourceExtractResponse,
|
|
787
801
|
type SourceGetBuildStatusResponse as SourceGetBuildStatusResponse,
|
|
788
802
|
type SourceGetElementsResponse as SourceGetElementsResponse,
|
|
803
|
+
type SourceGetPageScreenshotResponse as SourceGetPageScreenshotResponse,
|
|
789
804
|
type SourceIngestFileResponse as SourceIngestFileResponse,
|
|
790
805
|
type SourceIngestGitHubResponse as SourceIngestGitHubResponse,
|
|
791
806
|
type SourceIngestURLResponse as SourceIngestURLResponse,
|
|
@@ -798,6 +813,7 @@ export declare namespace Graphor {
|
|
|
798
813
|
type SourceExtractParams as SourceExtractParams,
|
|
799
814
|
type SourceGetBuildStatusParams as SourceGetBuildStatusParams,
|
|
800
815
|
type SourceGetElementsParams as SourceGetElementsParams,
|
|
816
|
+
type SourceGetPageScreenshotParams as SourceGetPageScreenshotParams,
|
|
801
817
|
type SourceIngestFileParams as SourceIngestFileParams,
|
|
802
818
|
type SourceIngestGitHubParams as SourceIngestGitHubParams,
|
|
803
819
|
type SourceIngestURLParams as SourceIngestURLParams,
|
package/src/internal/types.ts
CHANGED
|
@@ -40,7 +40,6 @@ type OverloadedParameters<T> =
|
|
|
40
40
|
: T extends (...args: infer A) => unknown ? A
|
|
41
41
|
: never;
|
|
42
42
|
|
|
43
|
-
/* eslint-disable */
|
|
44
43
|
/**
|
|
45
44
|
* These imports attempt to get types from a parent package's dependencies.
|
|
46
45
|
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
|
|
@@ -63,19 +62,18 @@ type OverloadedParameters<T> =
|
|
|
63
62
|
*
|
|
64
63
|
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
|
|
65
64
|
*/
|
|
66
|
-
/** @ts-ignore For users with \@types/node */
|
|
65
|
+
/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
|
|
67
66
|
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
|
|
68
|
-
/** @ts-ignore For users with undici */
|
|
67
|
+
/** @ts-ignore For users with undici */ /* prettier-ignore */
|
|
69
68
|
type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
|
|
70
|
-
/** @ts-ignore For users with \@types/bun */
|
|
69
|
+
/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
|
|
71
70
|
type BunRequestInit = globalThis.FetchRequestInit;
|
|
72
|
-
/** @ts-ignore For users with node-fetch@2 */
|
|
71
|
+
/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
|
|
73
72
|
type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
|
|
74
|
-
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
|
|
73
|
+
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
|
|
75
74
|
type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
|
|
76
|
-
/** @ts-ignore For users who use Deno */
|
|
75
|
+
/** @ts-ignore For users who use Deno */ /* prettier-ignore */
|
|
77
76
|
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
|
|
78
|
-
/* eslint-enable */
|
|
79
77
|
|
|
80
78
|
type RequestInits =
|
|
81
79
|
| NotAny<UndiciTypesRequestInit>
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
package/src/resources/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export {
|
|
|
11
11
|
type SourceExtractResponse,
|
|
12
12
|
type SourceGetBuildStatusResponse,
|
|
13
13
|
type SourceGetElementsResponse,
|
|
14
|
+
type SourceGetPageScreenshotResponse,
|
|
14
15
|
type SourceIngestFileResponse,
|
|
15
16
|
type SourceIngestGitHubResponse,
|
|
16
17
|
type SourceIngestURLResponse,
|
|
@@ -23,6 +24,7 @@ export {
|
|
|
23
24
|
type SourceExtractParams,
|
|
24
25
|
type SourceGetBuildStatusParams,
|
|
25
26
|
type SourceGetElementsParams,
|
|
27
|
+
type SourceGetPageScreenshotParams,
|
|
26
28
|
type SourceIngestFileParams,
|
|
27
29
|
type SourceIngestGitHubParams,
|
|
28
30
|
type SourceIngestURLParams,
|
package/src/resources/sources.ts
CHANGED
|
@@ -125,7 +125,7 @@ export class Sources extends APIResource {
|
|
|
125
125
|
* @example
|
|
126
126
|
* ```ts
|
|
127
127
|
* const response = await client.sources.ask({
|
|
128
|
-
* question: '
|
|
128
|
+
* question: "What was the company's revenue in 2025?",
|
|
129
129
|
* });
|
|
130
130
|
* ```
|
|
131
131
|
*/
|
|
@@ -169,8 +169,9 @@ export class Sources extends APIResource {
|
|
|
169
169
|
* @example
|
|
170
170
|
* ```ts
|
|
171
171
|
* const response = await client.sources.extract({
|
|
172
|
-
* output_schema: {
|
|
173
|
-
* user_instruction:
|
|
172
|
+
* output_schema: { properties: 'bar', type: 'bar' },
|
|
173
|
+
* user_instruction:
|
|
174
|
+
* 'Extract all invoice line items including product name, quantity, unit price, and total.',
|
|
174
175
|
* });
|
|
175
176
|
* ```
|
|
176
177
|
*/
|
|
@@ -296,6 +297,52 @@ export class Sources extends APIResource {
|
|
|
296
297
|
return this._client.get('/sources/get-elements', { query, ...options });
|
|
297
298
|
}
|
|
298
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Render a single page of a source file as a base64-encoded PNG screenshot.
|
|
302
|
+
*
|
|
303
|
+
* Use this endpoint to lazily fetch the visual preview of a citation returned by
|
|
304
|
+
* `/ask-sources` without paying the payload cost of inlining base64 in the answer.
|
|
305
|
+
* Supports PDFs, image files (`page_number` must be 1), and Office documents
|
|
306
|
+
* (doc/docx/ppt/pptx/odt — rendered from the converted PDF).
|
|
307
|
+
*
|
|
308
|
+
* **Path parameters:**
|
|
309
|
+
*
|
|
310
|
+
* - **file_id** (str): UUID of the source file.
|
|
311
|
+
* - **page_number** (int): 1-based page number.
|
|
312
|
+
*
|
|
313
|
+
* **Query parameters:**
|
|
314
|
+
*
|
|
315
|
+
* - **max_width** (int, optional, default `900`): Pixel width cap. Clamped to the
|
|
316
|
+
* 300-1600 range.
|
|
317
|
+
*
|
|
318
|
+
* **Returns** a `PublicPageScreenshotResponse` containing:
|
|
319
|
+
*
|
|
320
|
+
* - `file_id`, `file_name`, `page_number` — identifying metadata.
|
|
321
|
+
* - `mime_type` — always `"image/png"`.
|
|
322
|
+
* - `width`, `height` — rendered image dimensions in pixels.
|
|
323
|
+
* - `image_base64` — the base64-encoded PNG bytes.
|
|
324
|
+
*
|
|
325
|
+
* **Error responses:**
|
|
326
|
+
*
|
|
327
|
+
* - `404` — File not found, unsupported file type, or invalid page number.
|
|
328
|
+
* - `500` — Unexpected internal error while rendering.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* const response = await client.sources.getPageScreenshot(0, {
|
|
333
|
+
* file_id: 'file_id',
|
|
334
|
+
* });
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
getPageScreenshot(
|
|
338
|
+
pageNumber: number,
|
|
339
|
+
params: SourceGetPageScreenshotParams,
|
|
340
|
+
options?: RequestOptions,
|
|
341
|
+
): APIPromise<SourceGetPageScreenshotResponse> {
|
|
342
|
+
const { file_id, ...query } = params;
|
|
343
|
+
return this._client.get(path`/sources/${file_id}/pages/${pageNumber}/screenshot`, { query, ...options });
|
|
344
|
+
}
|
|
345
|
+
|
|
299
346
|
/**
|
|
300
347
|
* Upload a local file and schedule ingestion in the background.
|
|
301
348
|
*
|
|
@@ -344,7 +391,7 @@ export class Sources extends APIResource {
|
|
|
344
391
|
* @example
|
|
345
392
|
* ```ts
|
|
346
393
|
* const response = await client.sources.ingestGitHub({
|
|
347
|
-
* url: '
|
|
394
|
+
* url: 'https://github.com/langchain-ai/langchain',
|
|
348
395
|
* });
|
|
349
396
|
* ```
|
|
350
397
|
*/
|
|
@@ -390,7 +437,7 @@ export class Sources extends APIResource {
|
|
|
390
437
|
* @example
|
|
391
438
|
* ```ts
|
|
392
439
|
* const response = await client.sources.ingestURL({
|
|
393
|
-
* url: '
|
|
440
|
+
* url: 'https://example.com/blog/ai-trends-2025',
|
|
394
441
|
* });
|
|
395
442
|
* ```
|
|
396
443
|
*/
|
|
@@ -415,7 +462,7 @@ export class Sources extends APIResource {
|
|
|
415
462
|
* @example
|
|
416
463
|
* ```ts
|
|
417
464
|
* const response = await client.sources.ingestYoutube({
|
|
418
|
-
* url: '
|
|
465
|
+
* url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
|
419
466
|
* });
|
|
420
467
|
* ```
|
|
421
468
|
*/
|
|
@@ -444,7 +491,7 @@ export class Sources extends APIResource {
|
|
|
444
491
|
* @example
|
|
445
492
|
* ```ts
|
|
446
493
|
* const response = await client.sources.reprocess({
|
|
447
|
-
* file_id: '
|
|
494
|
+
* file_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
|
|
448
495
|
* });
|
|
449
496
|
* ```
|
|
450
497
|
*/
|
|
@@ -484,7 +531,7 @@ export class Sources extends APIResource {
|
|
|
484
531
|
* @example
|
|
485
532
|
* ```ts
|
|
486
533
|
* const response = await client.sources.retrieveChunks({
|
|
487
|
-
* query: '
|
|
534
|
+
* query: "What was the company's net income in 2025?",
|
|
488
535
|
* });
|
|
489
536
|
* ```
|
|
490
537
|
*/
|
|
@@ -607,10 +654,9 @@ export interface Element {
|
|
|
607
654
|
* - fast → basic
|
|
608
655
|
* - balanced → hi_res
|
|
609
656
|
* - accurate → hi_res_ft
|
|
610
|
-
* - vlm → mai
|
|
611
657
|
* - agentic → graphorlm
|
|
612
658
|
*/
|
|
613
|
-
export type Method = 'fast' | 'balanced' | 'accurate' | '
|
|
659
|
+
export type Method = 'fast' | 'balanced' | 'accurate' | 'agentic';
|
|
614
660
|
|
|
615
661
|
export interface PublicSource {
|
|
616
662
|
/**
|
|
@@ -661,7 +707,7 @@ export interface PublicSource {
|
|
|
661
707
|
|
|
662
708
|
/**
|
|
663
709
|
* Partitioning strategy used during ingestion. V1 API: basic, hi_res, hi_res_ft,
|
|
664
|
-
* mai, graphorlm. V2 API: fast, balanced, accurate,
|
|
710
|
+
* mai, graphorlm. V2 API: fast, balanced, accurate, agentic.
|
|
665
711
|
*/
|
|
666
712
|
method?: string | null;
|
|
667
713
|
}
|
|
@@ -704,10 +750,18 @@ export interface SourceAskResponse {
|
|
|
704
750
|
/**
|
|
705
751
|
* The answer to the question. When output_schema is provided, this will be a short
|
|
706
752
|
* status message and the structured data will be in structured_output (and the raw
|
|
707
|
-
* JSON-text in raw_json).
|
|
753
|
+
* JSON-text in raw_json). Inline citations appear as `[N]` markers; use the
|
|
754
|
+
* `citations` field to resolve each marker to its source.
|
|
708
755
|
*/
|
|
709
756
|
answer: string;
|
|
710
757
|
|
|
758
|
+
/**
|
|
759
|
+
* Structured citations extracted from the `[N]` markers in `answer`. When the
|
|
760
|
+
* request includes `include_citation_images=true`, each entry carries a
|
|
761
|
+
* base64-encoded PNG screenshot of the cited page in `image_base64`.
|
|
762
|
+
*/
|
|
763
|
+
citations?: Array<SourceAskResponse.Citation> | null;
|
|
764
|
+
|
|
711
765
|
/**
|
|
712
766
|
* Conversation identifier used to maintain memory context
|
|
713
767
|
*/
|
|
@@ -737,6 +791,57 @@ export interface SourceAskResponse {
|
|
|
737
791
|
}
|
|
738
792
|
|
|
739
793
|
export namespace SourceAskResponse {
|
|
794
|
+
/**
|
|
795
|
+
* A structured citation extracted from the inline `[N]` markers in the answer.
|
|
796
|
+
*
|
|
797
|
+
* Each citation corresponds to one `[N]` marker in the `answer` text. Use the
|
|
798
|
+
* `index` field to map between the marker and the citation entry.
|
|
799
|
+
*/
|
|
800
|
+
export interface Citation {
|
|
801
|
+
/**
|
|
802
|
+
* Optional element identifier within the page/section (e.g. a specific paragraph
|
|
803
|
+
* or table).
|
|
804
|
+
*/
|
|
805
|
+
element_id?: string | null;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* The unique identifier of the source file the citation refers to.
|
|
809
|
+
*/
|
|
810
|
+
file_id?: string | null;
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Display name of the source file.
|
|
814
|
+
*/
|
|
815
|
+
file_name?: string | null;
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Base64-encoded PNG screenshot of the cited page. Only populated when the request
|
|
819
|
+
* was made with `include_citation_images=true`. May be null if the underlying
|
|
820
|
+
* source is not visualizable (e.g. plain text).
|
|
821
|
+
*/
|
|
822
|
+
image_base64?: string | null;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* The 1-based citation number that appears as `[N]` in the answer text.
|
|
826
|
+
*/
|
|
827
|
+
index?: number | null;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* 1-based page number where the cited content appears.
|
|
831
|
+
*/
|
|
832
|
+
page_number?: number | null;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Optional section number within the page.
|
|
836
|
+
*/
|
|
837
|
+
section_number?: number | null;
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Short text excerpt around the cited content, useful for quick context.
|
|
841
|
+
*/
|
|
842
|
+
text_preview?: string | null;
|
|
843
|
+
}
|
|
844
|
+
|
|
740
845
|
/**
|
|
741
846
|
* Token usage breakdown for this request.
|
|
742
847
|
*/
|
|
@@ -861,7 +966,6 @@ export interface SourceGetBuildStatusResponse {
|
|
|
861
966
|
* - fast → basic
|
|
862
967
|
* - balanced → hi_res
|
|
863
968
|
* - accurate → hi_res_ft
|
|
864
|
-
* - vlm → mai
|
|
865
969
|
* - agentic → graphorlm
|
|
866
970
|
*/
|
|
867
971
|
method?: Method | null;
|
|
@@ -931,6 +1035,46 @@ export interface SourceGetElementsResponse {
|
|
|
931
1035
|
total_pages?: number | null;
|
|
932
1036
|
}
|
|
933
1037
|
|
|
1038
|
+
/**
|
|
1039
|
+
* Base64-encoded PNG screenshot of a page from a source file.
|
|
1040
|
+
*/
|
|
1041
|
+
export interface SourceGetPageScreenshotResponse {
|
|
1042
|
+
/**
|
|
1043
|
+
* The unique identifier of the source file.
|
|
1044
|
+
*/
|
|
1045
|
+
file_id: string;
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Base64-encoded PNG image bytes.
|
|
1049
|
+
*/
|
|
1050
|
+
image_base64: string;
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* 1-based page number that was rendered.
|
|
1054
|
+
*/
|
|
1055
|
+
page_number: number;
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Display name of the source file.
|
|
1059
|
+
*/
|
|
1060
|
+
file_name?: string | null;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Pixel height of the rendered image.
|
|
1064
|
+
*/
|
|
1065
|
+
height?: number | null;
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* MIME type of the encoded image (always image/png).
|
|
1069
|
+
*/
|
|
1070
|
+
mime_type?: string;
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Pixel width of the rendered image.
|
|
1074
|
+
*/
|
|
1075
|
+
width?: number | null;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
934
1078
|
export interface SourceIngestFileResponse {
|
|
935
1079
|
/**
|
|
936
1080
|
* The ID of the build. This ID can be used to check the status of the request.
|
|
@@ -1109,6 +1253,25 @@ export interface SourceAskParams {
|
|
|
1109
1253
|
*/
|
|
1110
1254
|
file_names?: Array<string> | null;
|
|
1111
1255
|
|
|
1256
|
+
/**
|
|
1257
|
+
* When true, the response's `citations` entries are populated with a
|
|
1258
|
+
* base64-encoded PNG screenshot of each cited page in `image_base64`. Increases
|
|
1259
|
+
* payload size and latency — leave false (the default) when not needed and fetch
|
|
1260
|
+
* screenshots on demand via
|
|
1261
|
+
* `GET /sources/{file_id}/pages/{page_number}/screenshot`.
|
|
1262
|
+
*/
|
|
1263
|
+
include_citation_images?: boolean | null;
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* When true, the `answer` field keeps the structured citation markup
|
|
1267
|
+
* `[N](file_id|pX|sY|eZ|fNAME)` emitted by the agent. When false (default), the
|
|
1268
|
+
* markup is stripped to plain `[N]` markers and the structured data is exposed via
|
|
1269
|
+
* `citations` instead. Note: the markup format is an implementation detail and may
|
|
1270
|
+
* change in future versions — prefer the `citations` field for stable parsing. Has
|
|
1271
|
+
* no effect when `output_schema` is set.
|
|
1272
|
+
*/
|
|
1273
|
+
include_citation_markup?: boolean | null;
|
|
1274
|
+
|
|
1112
1275
|
/**
|
|
1113
1276
|
* Optional JSON Schema for requesting structured output. When provided, the answer
|
|
1114
1277
|
* field will contain a short status message and the structured data will be in
|
|
@@ -1122,10 +1285,10 @@ export interface SourceAskParams {
|
|
|
1122
1285
|
reset?: boolean | null;
|
|
1123
1286
|
|
|
1124
1287
|
/**
|
|
1125
|
-
* Controls model and thinking budget: 'fast' (cheapest/fastest), 'balanced',
|
|
1126
|
-
* 'accurate' (most thorough)
|
|
1288
|
+
* Controls model and thinking budget: 'fast' (cheapest/fastest), 'balanced',
|
|
1289
|
+
* 'accurate', or 'max' (most thorough)
|
|
1127
1290
|
*/
|
|
1128
|
-
thinking_level?: 'fast' | 'balanced' | 'accurate' | null;
|
|
1291
|
+
thinking_level?: 'fast' | 'balanced' | 'accurate' | 'max' | null;
|
|
1129
1292
|
}
|
|
1130
1293
|
|
|
1131
1294
|
export interface SourceExtractParams {
|
|
@@ -1151,10 +1314,10 @@ export interface SourceExtractParams {
|
|
|
1151
1314
|
file_names?: Array<string> | null;
|
|
1152
1315
|
|
|
1153
1316
|
/**
|
|
1154
|
-
* Controls model and thinking budget: 'fast' (cheapest/fastest), 'balanced',
|
|
1155
|
-
* 'accurate' (most thorough)
|
|
1317
|
+
* Controls model and thinking budget: 'fast' (cheapest/fastest), 'balanced',
|
|
1318
|
+
* 'accurate', or 'max' (most thorough)
|
|
1156
1319
|
*/
|
|
1157
|
-
thinking_level?: 'fast' | 'balanced' | 'accurate' | null;
|
|
1320
|
+
thinking_level?: 'fast' | 'balanced' | 'accurate' | 'max' | null;
|
|
1158
1321
|
}
|
|
1159
1322
|
|
|
1160
1323
|
export interface SourceGetBuildStatusParams {
|
|
@@ -1209,6 +1372,18 @@ export interface SourceGetElementsParams {
|
|
|
1209
1372
|
type?: string | null;
|
|
1210
1373
|
}
|
|
1211
1374
|
|
|
1375
|
+
export interface SourceGetPageScreenshotParams {
|
|
1376
|
+
/**
|
|
1377
|
+
* Path param
|
|
1378
|
+
*/
|
|
1379
|
+
file_id: string;
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Query param: Pixel width cap for the rendered image (clamped to 300-1600).
|
|
1383
|
+
*/
|
|
1384
|
+
max_width?: number;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1212
1387
|
export interface SourceIngestFileParams {
|
|
1213
1388
|
file: Uploadable;
|
|
1214
1389
|
|
|
@@ -1220,7 +1395,6 @@ export interface SourceIngestFileParams {
|
|
|
1220
1395
|
* - fast → basic
|
|
1221
1396
|
* - balanced → hi_res
|
|
1222
1397
|
* - accurate → hi_res_ft
|
|
1223
|
-
* - vlm → mai
|
|
1224
1398
|
* - agentic → graphorlm
|
|
1225
1399
|
*/
|
|
1226
1400
|
method?: Method | null;
|
|
@@ -1252,7 +1426,6 @@ export interface SourceIngestURLParams {
|
|
|
1252
1426
|
* - fast → basic
|
|
1253
1427
|
* - balanced → hi_res
|
|
1254
1428
|
* - accurate → hi_res_ft
|
|
1255
|
-
* - vlm → mai
|
|
1256
1429
|
* - agentic → graphorlm
|
|
1257
1430
|
*/
|
|
1258
1431
|
method?: Method | null;
|
|
@@ -1273,7 +1446,7 @@ export interface SourceReprocessParams {
|
|
|
1273
1446
|
file_id: string;
|
|
1274
1447
|
|
|
1275
1448
|
/**
|
|
1276
|
-
* Partitioning strategy. One of: fast, balanced, accurate,
|
|
1449
|
+
* Partitioning strategy. One of: fast, balanced, accurate, agentic.
|
|
1277
1450
|
*/
|
|
1278
1451
|
method?: Method;
|
|
1279
1452
|
}
|
|
@@ -1307,6 +1480,7 @@ export declare namespace Sources {
|
|
|
1307
1480
|
type SourceExtractResponse as SourceExtractResponse,
|
|
1308
1481
|
type SourceGetBuildStatusResponse as SourceGetBuildStatusResponse,
|
|
1309
1482
|
type SourceGetElementsResponse as SourceGetElementsResponse,
|
|
1483
|
+
type SourceGetPageScreenshotResponse as SourceGetPageScreenshotResponse,
|
|
1310
1484
|
type SourceIngestFileResponse as SourceIngestFileResponse,
|
|
1311
1485
|
type SourceIngestGitHubResponse as SourceIngestGitHubResponse,
|
|
1312
1486
|
type SourceIngestURLResponse as SourceIngestURLResponse,
|
|
@@ -1319,6 +1493,7 @@ export declare namespace Sources {
|
|
|
1319
1493
|
type SourceExtractParams as SourceExtractParams,
|
|
1320
1494
|
type SourceGetBuildStatusParams as SourceGetBuildStatusParams,
|
|
1321
1495
|
type SourceGetElementsParams as SourceGetElementsParams,
|
|
1496
|
+
type SourceGetPageScreenshotParams as SourceGetPageScreenshotParams,
|
|
1322
1497
|
type SourceIngestFileParams as SourceIngestFileParams,
|
|
1323
1498
|
type SourceIngestGitHubParams as SourceIngestGitHubParams,
|
|
1324
1499
|
type SourceIngestURLParams as SourceIngestURLParams,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.19.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.19.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.19.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.19.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|