@openrouter/sdk 1.5.27 → 1.5.29
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/extractionasset.d.ts +36 -0
- package/esm/models/extractionasset.js +35 -0
- package/esm/models/extractiondateanswer.d.ts +4 -3
- package/esm/models/extractiondateanswer.js +2 -1
- package/esm/models/extractiondatetimeanswer.d.ts +4 -3
- package/esm/models/extractiondatetimeanswer.js +2 -1
- package/esm/models/extractiondurationanswer.d.ts +4 -3
- package/esm/models/extractiondurationanswer.js +2 -1
- package/esm/models/extractionestimateanswer.d.ts +4 -3
- package/esm/models/extractionestimateanswer.js +2 -1
- package/esm/models/extractionforecastanswer.d.ts +4 -3
- package/esm/models/extractionforecastanswer.js +2 -1
- package/esm/models/extractionlistanswer.d.ts +8 -3
- package/esm/models/extractionlistanswer.js +3 -1
- package/esm/models/extractionnumberanswer.d.ts +4 -3
- package/esm/models/extractionnumberanswer.js +2 -1
- package/esm/models/extractionsrequest.d.ts +4 -4
- package/esm/models/extractionsrequest.js +2 -2
- package/esm/models/extractiontextanswer.d.ts +4 -3
- package/esm/models/extractiontextanswer.js +2 -1
- package/esm/models/extractiontimeanswer.d.ts +4 -3
- package/esm/models/extractiontimeanswer.js +2 -1
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/openresponsesresult.d.ts +21 -0
- package/esm/models/openresponsesresult.js +16 -0
- package/esm/models/responsesrequest.d.ts +26 -0
- package/esm/models/responsesrequest.js +17 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.5.
|
|
53
|
+
readonly sdkVersion: "1.5.29";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.29 2.950.13 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.5.
|
|
32
|
+
sdkVersion: "1.5.29",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.29 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const ExtractionAssetFormat: {
|
|
4
|
+
readonly Png: "png";
|
|
5
|
+
readonly Jpg: "jpg";
|
|
6
|
+
readonly Jpeg: "jpeg";
|
|
7
|
+
readonly Pdf: "pdf";
|
|
8
|
+
};
|
|
9
|
+
export type ExtractionAssetFormat = OpenEnum<typeof ExtractionAssetFormat>;
|
|
10
|
+
export declare const ExtractionAssetType: {
|
|
11
|
+
readonly Image: "image";
|
|
12
|
+
readonly Document: "document";
|
|
13
|
+
};
|
|
14
|
+
export type ExtractionAssetType = OpenEnum<typeof ExtractionAssetType>;
|
|
15
|
+
/**
|
|
16
|
+
* An image or PDF sent once and referenced by its key in the `assets` map. `data_base64` is the file in standard base64 with no `data:` prefix. PDF is read by document models only.
|
|
17
|
+
*/
|
|
18
|
+
export type ExtractionAsset = {
|
|
19
|
+
dataBase64: string;
|
|
20
|
+
format: ExtractionAssetFormat;
|
|
21
|
+
type?: ExtractionAssetType | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const ExtractionAssetFormat$outboundSchema: z.ZodType<string, ExtractionAssetFormat>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ExtractionAssetType$outboundSchema: z.ZodType<string, ExtractionAssetType>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type ExtractionAsset$Outbound = {
|
|
29
|
+
data_base64: string;
|
|
30
|
+
format: string;
|
|
31
|
+
type?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
/** @internal */
|
|
34
|
+
export declare const ExtractionAsset$outboundSchema: z.ZodType<ExtractionAsset$Outbound, ExtractionAsset>;
|
|
35
|
+
export declare function extractionAssetToJSON(extractionAsset: ExtractionAsset): string;
|
|
36
|
+
//# sourceMappingURL=extractionasset.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 07f8c3a66e60
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
export const ExtractionAssetFormat = {
|
|
9
|
+
Png: "png",
|
|
10
|
+
Jpg: "jpg",
|
|
11
|
+
Jpeg: "jpeg",
|
|
12
|
+
Pdf: "pdf",
|
|
13
|
+
};
|
|
14
|
+
export const ExtractionAssetType = {
|
|
15
|
+
Image: "image",
|
|
16
|
+
Document: "document",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ExtractionAssetFormat$outboundSchema = openEnums.outboundSchema(ExtractionAssetFormat);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const ExtractionAssetType$outboundSchema = openEnums.outboundSchema(ExtractionAssetType);
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ExtractionAsset$outboundSchema = z.object({
|
|
24
|
+
dataBase64: z.string(),
|
|
25
|
+
format: ExtractionAssetFormat$outboundSchema,
|
|
26
|
+
type: ExtractionAssetType$outboundSchema.optional(),
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
dataBase64: "data_base64",
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
export function extractionAssetToJSON(extractionAsset) {
|
|
33
|
+
return JSON.stringify(ExtractionAsset$outboundSchema.parse(extractionAsset));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=extractionasset.js.map
|
|
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
6
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtractionDateAnswerSource: {
|
|
9
9
|
readonly State: "state";
|
|
10
10
|
readonly Image: "image";
|
|
11
|
+
readonly Document: "document";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
14
15
|
*/
|
|
15
16
|
export type ExtractionDateAnswerSource = OpenEnum<typeof ExtractionDateAnswerSource>;
|
|
16
17
|
export type ExtractionDateAnswer = {
|
|
@@ -24,7 +25,7 @@ export type ExtractionDateAnswer = {
|
|
|
24
25
|
*/
|
|
25
26
|
pNull?: number | undefined;
|
|
26
27
|
/**
|
|
27
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
28
29
|
*/
|
|
29
30
|
source?: ExtractionDateAnswerSource | undefined;
|
|
30
31
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionDateAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionDateAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionDateAnswerSource);
|
|
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
6
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtractionDatetimeAnswerSource: {
|
|
9
9
|
readonly State: "state";
|
|
10
10
|
readonly Image: "image";
|
|
11
|
+
readonly Document: "document";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
14
15
|
*/
|
|
15
16
|
export type ExtractionDatetimeAnswerSource = OpenEnum<typeof ExtractionDatetimeAnswerSource>;
|
|
16
17
|
export type ExtractionDatetimeAnswer = {
|
|
@@ -24,7 +25,7 @@ export type ExtractionDatetimeAnswer = {
|
|
|
24
25
|
*/
|
|
25
26
|
pNull?: number | undefined;
|
|
26
27
|
/**
|
|
27
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
28
29
|
*/
|
|
29
30
|
source?: ExtractionDatetimeAnswerSource | undefined;
|
|
30
31
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionDatetimeAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionDatetimeAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionDatetimeAnswerSource);
|
|
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
6
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtractionDurationAnswerSource: {
|
|
9
9
|
readonly State: "state";
|
|
10
10
|
readonly Image: "image";
|
|
11
|
+
readonly Document: "document";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
14
15
|
*/
|
|
15
16
|
export type ExtractionDurationAnswerSource = OpenEnum<typeof ExtractionDurationAnswerSource>;
|
|
16
17
|
export type ExtractionDurationAnswer = {
|
|
@@ -24,7 +25,7 @@ export type ExtractionDurationAnswer = {
|
|
|
24
25
|
*/
|
|
25
26
|
pNull?: number | undefined;
|
|
26
27
|
/**
|
|
27
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
28
29
|
*/
|
|
29
30
|
source?: ExtractionDurationAnswerSource | undefined;
|
|
30
31
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionDurationAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionDurationAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionDurationAnswerSource);
|
|
@@ -12,14 +12,15 @@ export type ExtractionEstimateAnswerP10 = number | string;
|
|
|
12
12
|
export type ExtractionEstimateAnswerP90 = number | string;
|
|
13
13
|
export type ExtractionEstimateAnswerQuantile = number | string;
|
|
14
14
|
/**
|
|
15
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
15
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
16
16
|
*/
|
|
17
17
|
export declare const ExtractionEstimateAnswerSource: {
|
|
18
18
|
readonly State: "state";
|
|
19
19
|
readonly Image: "image";
|
|
20
|
+
readonly Document: "document";
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
23
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
23
24
|
*/
|
|
24
25
|
export type ExtractionEstimateAnswerSource = OpenEnum<typeof ExtractionEstimateAnswerSource>;
|
|
25
26
|
export type ExtractionEstimateAnswerValue = number | string;
|
|
@@ -50,7 +51,7 @@ export type ExtractionEstimateAnswer = {
|
|
|
50
51
|
*/
|
|
51
52
|
quantiles?: Array<number | string> | undefined;
|
|
52
53
|
/**
|
|
53
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
54
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
54
55
|
*/
|
|
55
56
|
source?: ExtractionEstimateAnswerSource | undefined;
|
|
56
57
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionEstimateAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionEstimateAnswerGuess$inboundSchema = z.union([z.number(), z.string()]);
|
|
@@ -9,14 +9,15 @@ export type ExtractionForecastAnswerMedian = number | string;
|
|
|
9
9
|
export type ExtractionForecastAnswerP10 = number | string;
|
|
10
10
|
export type ExtractionForecastAnswerP90 = number | string;
|
|
11
11
|
/**
|
|
12
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
12
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
13
13
|
*/
|
|
14
14
|
export declare const ExtractionForecastAnswerSource: {
|
|
15
15
|
readonly State: "state";
|
|
16
16
|
readonly Image: "image";
|
|
17
|
+
readonly Document: "document";
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
20
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
20
21
|
*/
|
|
21
22
|
export type ExtractionForecastAnswerSource = OpenEnum<typeof ExtractionForecastAnswerSource>;
|
|
22
23
|
export type ExtractionForecastAnswerValue = number | string;
|
|
@@ -35,7 +36,7 @@ export type ExtractionForecastAnswer = {
|
|
|
35
36
|
p10?: Array<number | string> | undefined;
|
|
36
37
|
p90?: Array<number | string> | undefined;
|
|
37
38
|
/**
|
|
38
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
39
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
39
40
|
*/
|
|
40
41
|
source?: ExtractionForecastAnswerSource | undefined;
|
|
41
42
|
/**
|
|
@@ -8,11 +8,12 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
import { ExtractionForecastStep$inboundSchema, } from "./extractionforecaststep.js";
|
|
10
10
|
/**
|
|
11
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
11
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
12
12
|
*/
|
|
13
13
|
export const ExtractionForecastAnswerSource = {
|
|
14
14
|
State: "state",
|
|
15
15
|
Image: "image",
|
|
16
|
+
Document: "document",
|
|
16
17
|
};
|
|
17
18
|
/** @internal */
|
|
18
19
|
export const ExtractionForecastAnswerGuess$inboundSchema = z.union([z.number(), z.string()]);
|
|
@@ -4,19 +4,24 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
export type ExtractionListAnswerGuess = string | number;
|
|
6
6
|
/**
|
|
7
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
7
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
8
8
|
*/
|
|
9
9
|
export declare const ExtractionListAnswerSource: {
|
|
10
10
|
readonly State: "state";
|
|
11
11
|
readonly Image: "image";
|
|
12
|
+
readonly Document: "document";
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
15
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
15
16
|
*/
|
|
16
17
|
export type ExtractionListAnswerSource = OpenEnum<typeof ExtractionListAnswerSource>;
|
|
17
18
|
export type ExtractionListAnswerValue = string | number;
|
|
18
19
|
export type ExtractionListAnswer = {
|
|
19
20
|
confidence?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* One confidence per item of `value`, in the same order.
|
|
23
|
+
*/
|
|
24
|
+
confidences?: Array<number> | undefined;
|
|
20
25
|
/**
|
|
21
26
|
* The most likely value even when `value` is null because `p_null` crossed the threshold.
|
|
22
27
|
*/
|
|
@@ -26,7 +31,7 @@ export type ExtractionListAnswer = {
|
|
|
26
31
|
*/
|
|
27
32
|
pNull?: number | undefined;
|
|
28
33
|
/**
|
|
29
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
34
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
30
35
|
*/
|
|
31
36
|
source?: ExtractionListAnswerSource | undefined;
|
|
32
37
|
spans?: Array<Array<number>> | undefined;
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionListAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionListAnswerGuess$inboundSchema = z.union([z.string(), z.number()]);
|
|
@@ -28,6 +29,7 @@ export function extractionListAnswerValueFromJSON(jsonString) {
|
|
|
28
29
|
/** @internal */
|
|
29
30
|
export const ExtractionListAnswer$inboundSchema = z.object({
|
|
30
31
|
confidence: z.number().optional(),
|
|
32
|
+
confidences: z.array(z.number()).optional(),
|
|
31
33
|
guess: z.array(z.union([z.string(), z.number()])).optional(),
|
|
32
34
|
p_null: z.number().optional(),
|
|
33
35
|
source: ExtractionListAnswerSource$inboundSchema.optional(),
|
|
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
6
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtractionNumberAnswerSource: {
|
|
9
9
|
readonly State: "state";
|
|
10
10
|
readonly Image: "image";
|
|
11
|
+
readonly Document: "document";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
14
15
|
*/
|
|
15
16
|
export type ExtractionNumberAnswerSource = OpenEnum<typeof ExtractionNumberAnswerSource>;
|
|
16
17
|
export type ExtractionNumberAnswer = {
|
|
@@ -24,7 +25,7 @@ export type ExtractionNumberAnswer = {
|
|
|
24
25
|
*/
|
|
25
26
|
pNull?: number | undefined;
|
|
26
27
|
/**
|
|
27
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
28
29
|
*/
|
|
29
30
|
source?: ExtractionNumberAnswerSource | undefined;
|
|
30
31
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionNumberAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionNumberAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionNumberAnswerSource);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import {
|
|
2
|
+
import { ExtractionAsset, ExtractionAsset$Outbound } from "./extractionasset.js";
|
|
3
3
|
import { ExtractionDateField, ExtractionDateField$Outbound } from "./extractiondatefield.js";
|
|
4
4
|
import { ExtractionDatetimeField, ExtractionDatetimeField$Outbound } from "./extractiondatetimefield.js";
|
|
5
5
|
import { ExtractionDurationField, ExtractionDurationField$Outbound } from "./extractiondurationfield.js";
|
|
@@ -17,10 +17,10 @@ import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
|
17
17
|
export type Fields = ExtractionDateField | ExtractionDatetimeField | ExtractionDurationField | ExtractionEstimateField | ExtractionForecastField | ExtractionListField | ExtractionNumberField | ExtractionTextField | ExtractionTimeField;
|
|
18
18
|
export type ExtractionsRequest = {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400.
|
|
21
21
|
*/
|
|
22
22
|
assets?: {
|
|
23
|
-
[k: string]:
|
|
23
|
+
[k: string]: ExtractionAsset;
|
|
24
24
|
} | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* Map of field name to typed field spec.
|
|
@@ -56,7 +56,7 @@ export declare function fieldsToJSON(fields: Fields): string;
|
|
|
56
56
|
/** @internal */
|
|
57
57
|
export type ExtractionsRequest$Outbound = {
|
|
58
58
|
assets?: {
|
|
59
|
-
[k: string]:
|
|
59
|
+
[k: string]: ExtractionAsset$Outbound;
|
|
60
60
|
} | undefined;
|
|
61
61
|
fields: {
|
|
62
62
|
[k: string]: ExtractionDateField$Outbound | ExtractionDatetimeField$Outbound | ExtractionDurationField$Outbound | ExtractionEstimateField$Outbound | ExtractionForecastField$Outbound | ExtractionListField$Outbound | ExtractionNumberField$Outbound | ExtractionTextField$Outbound | ExtractionTimeField$Outbound;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ExtractionAsset$outboundSchema, } from "./extractionasset.js";
|
|
8
8
|
import { ExtractionDateField$outboundSchema, } from "./extractiondatefield.js";
|
|
9
9
|
import { ExtractionDatetimeField$outboundSchema, } from "./extractiondatetimefield.js";
|
|
10
10
|
import { ExtractionDurationField$outboundSchema, } from "./extractiondurationfield.js";
|
|
@@ -34,7 +34,7 @@ export function fieldsToJSON(fields) {
|
|
|
34
34
|
}
|
|
35
35
|
/** @internal */
|
|
36
36
|
export const ExtractionsRequest$outboundSchema = z.object({
|
|
37
|
-
assets: z.record(z.string(),
|
|
37
|
+
assets: z.record(z.string(), ExtractionAsset$outboundSchema).optional(),
|
|
38
38
|
fields: z.record(z.string(), z.union([
|
|
39
39
|
ExtractionDateField$outboundSchema,
|
|
40
40
|
ExtractionDatetimeField$outboundSchema,
|
|
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
6
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtractionTextAnswerSource: {
|
|
9
9
|
readonly State: "state";
|
|
10
10
|
readonly Image: "image";
|
|
11
|
+
readonly Document: "document";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
14
15
|
*/
|
|
15
16
|
export type ExtractionTextAnswerSource = OpenEnum<typeof ExtractionTextAnswerSource>;
|
|
16
17
|
export type ExtractionTextAnswer = {
|
|
@@ -24,7 +25,7 @@ export type ExtractionTextAnswer = {
|
|
|
24
25
|
*/
|
|
25
26
|
pNull?: number | undefined;
|
|
26
27
|
/**
|
|
27
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
28
29
|
*/
|
|
29
30
|
source?: ExtractionTextAnswerSource | undefined;
|
|
30
31
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionTextAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionTextAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionTextAnswerSource);
|
|
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
6
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtractionTimeAnswerSource: {
|
|
9
9
|
readonly State: "state";
|
|
10
10
|
readonly Image: "image";
|
|
11
|
+
readonly Document: "document";
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
14
15
|
*/
|
|
15
16
|
export type ExtractionTimeAnswerSource = OpenEnum<typeof ExtractionTimeAnswerSource>;
|
|
16
17
|
export type ExtractionTimeAnswer = {
|
|
@@ -24,7 +25,7 @@ export type ExtractionTimeAnswer = {
|
|
|
24
25
|
*/
|
|
25
26
|
pNull?: number | undefined;
|
|
26
27
|
/**
|
|
27
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
28
29
|
*/
|
|
29
30
|
source?: ExtractionTimeAnswerSource | undefined;
|
|
30
31
|
/**
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Set to `image` when the answer was read from an image rather than the state text.
|
|
10
|
+
* Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
|
|
11
11
|
*/
|
|
12
12
|
export const ExtractionTimeAnswerSource = {
|
|
13
13
|
State: "state",
|
|
14
14
|
Image: "image",
|
|
15
|
+
Document: "document",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ExtractionTimeAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionTimeAnswerSource);
|
package/esm/models/index.d.ts
CHANGED
|
@@ -331,6 +331,7 @@ export * from "./enumcapability.js";
|
|
|
331
331
|
export * from "./errorevent.js";
|
|
332
332
|
export * from "./externaluser.js";
|
|
333
333
|
export * from "./externaluserresponse.js";
|
|
334
|
+
export * from "./extractionasset.js";
|
|
334
335
|
export * from "./extractiondateanswer.js";
|
|
335
336
|
export * from "./extractiondatefield.js";
|
|
336
337
|
export * from "./extractiondatetimeanswer.js";
|
package/esm/models/index.js
CHANGED
|
@@ -335,6 +335,7 @@ export * from "./enumcapability.js";
|
|
|
335
335
|
export * from "./errorevent.js";
|
|
336
336
|
export * from "./externaluser.js";
|
|
337
337
|
export * from "./externaluserresponse.js";
|
|
338
|
+
export * from "./extractionasset.js";
|
|
338
339
|
export * from "./extractiondateanswer.js";
|
|
339
340
|
export * from "./extractiondatefield.js";
|
|
340
341
|
export * from "./extractiondatetimeanswer.js";
|
|
@@ -131,6 +131,18 @@ export type Usage = {
|
|
|
131
131
|
*/
|
|
132
132
|
serverToolUseDetails?: ServerToolUseDetails | null | undefined;
|
|
133
133
|
};
|
|
134
|
+
export declare const OpenResponsesResultCyber: {
|
|
135
|
+
readonly Standard: "standard";
|
|
136
|
+
readonly DaybreakBlue: "daybreak_blue";
|
|
137
|
+
readonly DaybreakRed: "daybreak_red";
|
|
138
|
+
};
|
|
139
|
+
export type OpenResponsesResultCyber = OpenEnum<typeof OpenResponsesResultCyber>;
|
|
140
|
+
/**
|
|
141
|
+
* Access program the upstream provider reported for this response (OpenAI `access_programs`). `null` when the provider reported none, including OpenAI's implicit Standard program.
|
|
142
|
+
*/
|
|
143
|
+
export type OpenResponsesResultAccessPrograms = {
|
|
144
|
+
cyber: OpenResponsesResultCyber;
|
|
145
|
+
};
|
|
134
146
|
/**
|
|
135
147
|
* Complete non-streaming response from the Responses API
|
|
136
148
|
*/
|
|
@@ -215,6 +227,10 @@ export type OpenResponsesResult = {
|
|
|
215
227
|
*/
|
|
216
228
|
usage?: Usage | null | undefined;
|
|
217
229
|
user?: string | null | undefined;
|
|
230
|
+
/**
|
|
231
|
+
* Access program the upstream provider reported for this response (OpenAI `access_programs`). `null` when the provider reported none, including OpenAI's implicit Standard program.
|
|
232
|
+
*/
|
|
233
|
+
accessPrograms?: OpenResponsesResultAccessPrograms | null | undefined;
|
|
218
234
|
/**
|
|
219
235
|
* Beta. The result of the alignment plugin for this request; the shape may change.
|
|
220
236
|
*/
|
|
@@ -252,6 +268,11 @@ export declare function usageCostDetailsFromJSON(jsonString: string): SafeParseR
|
|
|
252
268
|
export declare const Usage$inboundSchema: z.ZodType<Usage, unknown>;
|
|
253
269
|
export declare function usageFromJSON(jsonString: string): SafeParseResult<Usage, SDKValidationError>;
|
|
254
270
|
/** @internal */
|
|
271
|
+
export declare const OpenResponsesResultCyber$inboundSchema: z.ZodType<OpenResponsesResultCyber, unknown>;
|
|
272
|
+
/** @internal */
|
|
273
|
+
export declare const OpenResponsesResultAccessPrograms$inboundSchema: z.ZodType<OpenResponsesResultAccessPrograms, unknown>;
|
|
274
|
+
export declare function openResponsesResultAccessProgramsFromJSON(jsonString: string): SafeParseResult<OpenResponsesResultAccessPrograms, SDKValidationError>;
|
|
275
|
+
/** @internal */
|
|
255
276
|
export declare const OpenResponsesResult$inboundSchema: z.ZodType<OpenResponsesResult, unknown>;
|
|
256
277
|
export declare function openResponsesResultFromJSON(jsonString: string): SafeParseResult<OpenResponsesResult, SDKValidationError>;
|
|
257
278
|
//# sourceMappingURL=openresponsesresult.d.ts.map
|
|
@@ -44,6 +44,11 @@ export const OpenResponsesResultAllowedCaller = {
|
|
|
44
44
|
Direct: "direct",
|
|
45
45
|
Programmatic: "programmatic",
|
|
46
46
|
};
|
|
47
|
+
export const OpenResponsesResultCyber = {
|
|
48
|
+
Standard: "standard",
|
|
49
|
+
DaybreakBlue: "daybreak_blue",
|
|
50
|
+
DaybreakRed: "daybreak_red",
|
|
51
|
+
};
|
|
47
52
|
/** @internal */
|
|
48
53
|
export const OpenResponsesResultObject$inboundSchema = z.enum(OpenResponsesResultObject);
|
|
49
54
|
/** @internal */
|
|
@@ -159,6 +164,15 @@ export function usageFromJSON(jsonString) {
|
|
|
159
164
|
return safeParse(jsonString, (x) => Usage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Usage' from JSON`);
|
|
160
165
|
}
|
|
161
166
|
/** @internal */
|
|
167
|
+
export const OpenResponsesResultCyber$inboundSchema = openEnums.inboundSchema(OpenResponsesResultCyber);
|
|
168
|
+
/** @internal */
|
|
169
|
+
export const OpenResponsesResultAccessPrograms$inboundSchema = z.object({
|
|
170
|
+
cyber: OpenResponsesResultCyber$inboundSchema,
|
|
171
|
+
});
|
|
172
|
+
export function openResponsesResultAccessProgramsFromJSON(jsonString) {
|
|
173
|
+
return safeParse(jsonString, (x) => OpenResponsesResultAccessPrograms$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesResultAccessPrograms' from JSON`);
|
|
174
|
+
}
|
|
175
|
+
/** @internal */
|
|
162
176
|
export const OpenResponsesResult$inboundSchema = z.object({
|
|
163
177
|
background: z.nullable(z.boolean()).optional(),
|
|
164
178
|
completed_at: z.nullable(z.int()),
|
|
@@ -211,6 +225,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
211
225
|
truncation: z.nullable(Truncation$inboundSchema).optional(),
|
|
212
226
|
usage: z.nullable(z.lazy(() => Usage$inboundSchema)).optional(),
|
|
213
227
|
user: z.nullable(z.string()).optional(),
|
|
228
|
+
access_programs: z.nullable(z.lazy(() => OpenResponsesResultAccessPrograms$inboundSchema)).optional(),
|
|
214
229
|
alignment: Alignment$inboundSchema.optional(),
|
|
215
230
|
error_type: ApiErrorType$inboundSchema.optional(),
|
|
216
231
|
openrouter_metadata: OpenRouterMetadata$inboundSchema.optional(),
|
|
@@ -234,6 +249,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
234
249
|
"tool_choice": "toolChoice",
|
|
235
250
|
"top_logprobs": "topLogprobs",
|
|
236
251
|
"top_p": "topP",
|
|
252
|
+
"access_programs": "accessPrograms",
|
|
237
253
|
"error_type": "errorType",
|
|
238
254
|
"openrouter_metadata": "openrouterMetadata",
|
|
239
255
|
"safeguard_results": "safeguardResults",
|
|
@@ -60,6 +60,18 @@ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchserve
|
|
|
60
60
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
61
61
|
import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
|
|
62
62
|
import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
|
|
63
|
+
export declare const ResponsesRequestCyber: {
|
|
64
|
+
readonly Standard: "standard";
|
|
65
|
+
readonly DaybreakBlue: "daybreak_blue";
|
|
66
|
+
readonly DaybreakRed: "daybreak_red";
|
|
67
|
+
};
|
|
68
|
+
export type ResponsesRequestCyber = OpenEnum<typeof ResponsesRequestCyber>;
|
|
69
|
+
/**
|
|
70
|
+
* OpenAI access programs for this request. `cyber` selects the Cyber access program: `standard`, `daybreak_blue`, or `daybreak_red`. A program other than `standard` is supported only on BYOK requests that run on your own OpenAI key enrolled in that program; any other endpoint, including OpenRouter's own OpenAI credentials, rejects it with a 400 error. Requests on OpenRouter's OpenAI credentials always run `standard`. Omit the field unless your key is enrolled in a Daybreak program.
|
|
71
|
+
*/
|
|
72
|
+
export type ResponsesRequestAccessPrograms = {
|
|
73
|
+
cyber?: ResponsesRequestCyber | undefined;
|
|
74
|
+
};
|
|
63
75
|
export type ResponsesRequestPlugin = AlignmentPlugin | ArmorPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
64
76
|
export type ReasoningConfig = {
|
|
65
77
|
/**
|
|
@@ -183,6 +195,10 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | (PreviewW
|
|
|
183
195
|
* Request schema for Responses endpoint
|
|
184
196
|
*/
|
|
185
197
|
export type ResponsesRequest = {
|
|
198
|
+
/**
|
|
199
|
+
* OpenAI access programs for this request. `cyber` selects the Cyber access program: `standard`, `daybreak_blue`, or `daybreak_red`. A program other than `standard` is supported only on BYOK requests that run on your own OpenAI key enrolled in that program; any other endpoint, including OpenRouter's own OpenAI credentials, rejects it with a 400 error. Requests on OpenRouter's OpenAI credentials always run `standard`. Omit the field unless your key is enrolled in a Daybreak program.
|
|
200
|
+
*/
|
|
201
|
+
accessPrograms?: ResponsesRequestAccessPrograms | undefined;
|
|
186
202
|
background?: boolean | null | undefined;
|
|
187
203
|
/**
|
|
188
204
|
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
|
|
@@ -347,6 +363,15 @@ export type ResponsesRequest = {
|
|
|
347
363
|
user?: string | undefined;
|
|
348
364
|
};
|
|
349
365
|
/** @internal */
|
|
366
|
+
export declare const ResponsesRequestCyber$outboundSchema: z.ZodType<string, ResponsesRequestCyber>;
|
|
367
|
+
/** @internal */
|
|
368
|
+
export type ResponsesRequestAccessPrograms$Outbound = {
|
|
369
|
+
cyber?: string | undefined;
|
|
370
|
+
};
|
|
371
|
+
/** @internal */
|
|
372
|
+
export declare const ResponsesRequestAccessPrograms$outboundSchema: z.ZodType<ResponsesRequestAccessPrograms$Outbound, ResponsesRequestAccessPrograms>;
|
|
373
|
+
export declare function responsesRequestAccessProgramsToJSON(responsesRequestAccessPrograms: ResponsesRequestAccessPrograms): string;
|
|
374
|
+
/** @internal */
|
|
350
375
|
export type ResponsesRequestPlugin$Outbound = AlignmentPlugin$Outbound | ArmorPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
351
376
|
/** @internal */
|
|
352
377
|
export declare const ResponsesRequestPlugin$outboundSchema: z.ZodType<ResponsesRequestPlugin$Outbound, ResponsesRequestPlugin>;
|
|
@@ -452,6 +477,7 @@ export declare const ResponsesRequestToolUnion$outboundSchema: z.ZodType<Respons
|
|
|
452
477
|
export declare function responsesRequestToolUnionToJSON(responsesRequestToolUnion: ResponsesRequestToolUnion): string;
|
|
453
478
|
/** @internal */
|
|
454
479
|
export type ResponsesRequest$Outbound = {
|
|
480
|
+
access_programs?: ResponsesRequestAccessPrograms$Outbound | undefined;
|
|
455
481
|
background?: boolean | null | undefined;
|
|
456
482
|
cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
|
|
457
483
|
debug?: ChatDebugOptions$Outbound | undefined;
|
|
@@ -65,6 +65,11 @@ import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
|
|
|
65
65
|
import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
|
|
66
66
|
import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
|
|
67
67
|
import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
|
|
68
|
+
export const ResponsesRequestCyber = {
|
|
69
|
+
Standard: "standard",
|
|
70
|
+
DaybreakBlue: "daybreak_blue",
|
|
71
|
+
DaybreakRed: "daybreak_red",
|
|
72
|
+
};
|
|
68
73
|
/**
|
|
69
74
|
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints.
|
|
70
75
|
*/
|
|
@@ -82,6 +87,15 @@ export const ResponsesRequestAllowedCaller = {
|
|
|
82
87
|
Programmatic: "programmatic",
|
|
83
88
|
};
|
|
84
89
|
/** @internal */
|
|
90
|
+
export const ResponsesRequestCyber$outboundSchema = openEnums.outboundSchema(ResponsesRequestCyber);
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const ResponsesRequestAccessPrograms$outboundSchema = z.object({
|
|
93
|
+
cyber: ResponsesRequestCyber$outboundSchema.optional(),
|
|
94
|
+
});
|
|
95
|
+
export function responsesRequestAccessProgramsToJSON(responsesRequestAccessPrograms) {
|
|
96
|
+
return JSON.stringify(ResponsesRequestAccessPrograms$outboundSchema.parse(responsesRequestAccessPrograms));
|
|
97
|
+
}
|
|
98
|
+
/** @internal */
|
|
85
99
|
export const ResponsesRequestPlugin$outboundSchema = z.union([
|
|
86
100
|
AlignmentPlugin$outboundSchema,
|
|
87
101
|
ArmorPlugin$outboundSchema,
|
|
@@ -183,6 +197,8 @@ export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
|
|
|
183
197
|
}
|
|
184
198
|
/** @internal */
|
|
185
199
|
export const ResponsesRequest$outboundSchema = z.object({
|
|
200
|
+
accessPrograms: z.lazy(() => ResponsesRequestAccessPrograms$outboundSchema)
|
|
201
|
+
.optional(),
|
|
186
202
|
background: z.nullable(z.boolean()).optional(),
|
|
187
203
|
cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
|
|
188
204
|
debug: ChatDebugOptions$outboundSchema.optional(),
|
|
@@ -272,6 +288,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
272
288
|
user: z.string().optional(),
|
|
273
289
|
}).transform((v) => {
|
|
274
290
|
return remap$(v, {
|
|
291
|
+
accessPrograms: "access_programs",
|
|
275
292
|
cacheControl: "cache_control",
|
|
276
293
|
deferredTools: "deferred_tools",
|
|
277
294
|
frequencyPenalty: "frequency_penalty",
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.29",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"test:
|
|
76
|
+
"test:transit": "exit 0",
|
|
77
|
+
"test:watch": "vitest --watch --project unit",
|
|
77
78
|
"typecheck": "tsc --noEmit",
|
|
78
|
-
"typecheck:transit": "exit 0",
|
|
79
79
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
80
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
81
80
|
"prepare": "npm run build",
|
|
82
|
-
"test
|
|
83
|
-
"
|
|
84
|
-
"
|
|
81
|
+
"test": "vitest --run --project unit",
|
|
82
|
+
"typecheck:transit": "exit 0",
|
|
83
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
+
"test:e2e": "vitest --run --project e2e"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|