@openrouter/sdk 1.5.23 → 1.5.25
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/funcs/alphaExtractionsCreate.d.ts +19 -0
- package/esm/funcs/alphaExtractionsCreate.js +105 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/classifierfiltersfilter.d.ts +10 -0
- package/esm/models/classifierfiltersfilter.js +16 -0
- package/esm/models/classifierscalarfilter.d.ts +35 -0
- package/esm/models/classifierscalarfilter.js +21 -0
- package/esm/models/classifierscalarfilteroperator.d.ts +16 -0
- package/esm/models/classifierscalarfilteroperator.js +15 -0
- package/esm/models/classifiersetfilter.d.ts +32 -0
- package/esm/models/classifiersetfilter.js +21 -0
- package/esm/models/classifiersetfilteroperator.d.ts +16 -0
- package/esm/models/classifiersetfilteroperator.js +15 -0
- package/esm/models/decisionsresponse.d.ts +3 -3
- package/esm/models/decisionsresponse.js +3 -3
- package/esm/models/extractiondateanswer.d.ts +46 -0
- package/esm/models/extractiondateanswer.js +37 -0
- package/esm/models/extractiondatefield.d.ts +22 -0
- package/esm/models/extractiondatefield.js +20 -0
- package/esm/models/extractiondatetimeanswer.d.ts +46 -0
- package/esm/models/extractiondatetimeanswer.js +37 -0
- package/esm/models/extractiondatetimefield.d.ts +22 -0
- package/esm/models/extractiondatetimefield.js +20 -0
- package/esm/models/extractiondurationanswer.d.ts +50 -0
- package/esm/models/extractiondurationanswer.js +38 -0
- package/esm/models/extractiondurationfield.d.ts +34 -0
- package/esm/models/extractiondurationfield.js +23 -0
- package/esm/models/extractionestimateanswer.d.ts +89 -0
- package/esm/models/extractionestimateanswer.js +80 -0
- package/esm/models/extractionestimatefield.d.ts +70 -0
- package/esm/models/extractionestimatefield.js +65 -0
- package/esm/models/extractionforecastanswer.d.ts +72 -0
- package/esm/models/extractionforecastanswer.js +72 -0
- package/esm/models/extractionforecastfield.d.ts +90 -0
- package/esm/models/extractionforecastfield.js +80 -0
- package/esm/models/extractionforecaststep.d.ts +50 -0
- package/esm/models/extractionforecaststep.js +57 -0
- package/esm/models/extractionlistanswer.d.ts +51 -0
- package/esm/models/extractionlistanswer.js +47 -0
- package/esm/models/extractionlistfield.d.ts +38 -0
- package/esm/models/extractionlistfield.js +31 -0
- package/esm/models/extractionnumberanswer.d.ts +46 -0
- package/esm/models/extractionnumberanswer.js +37 -0
- package/esm/models/extractionnumberfield.d.ts +31 -0
- package/esm/models/extractionnumberfield.js +23 -0
- package/esm/models/extractionsrequest.d.ts +75 -0
- package/esm/models/extractionsrequest.js +65 -0
- package/esm/models/extractionsresponse.d.ts +42 -0
- package/esm/models/extractionsresponse.js +61 -0
- package/esm/models/extractionsusage.d.ts +19 -0
- package/esm/models/extractionsusage.js +29 -0
- package/esm/models/extractiontextanswer.d.ts +46 -0
- package/esm/models/extractiontextanswer.js +37 -0
- package/esm/models/extractiontextfield.d.ts +22 -0
- package/esm/models/extractiontextfield.js +20 -0
- package/esm/models/extractiontimeanswer.d.ts +46 -0
- package/esm/models/extractiontimeanswer.js +37 -0
- package/esm/models/extractiontimefield.d.ts +22 -0
- package/esm/models/extractiontimefield.js +20 -0
- package/esm/models/filter.d.ts +10 -0
- package/esm/models/filter.js +14 -0
- package/esm/models/generationresponse.d.ts +1 -0
- package/esm/models/generationresponse.js +1 -0
- package/esm/models/imagegenerationrequest.d.ts +2 -2
- package/esm/models/index.d.ts +33 -0
- package/esm/models/index.js +33 -0
- package/esm/models/observabilityfilterrulegroup.d.ts +5 -5
- package/esm/models/observabilityfilterrulegroup.js +5 -7
- package/esm/models/operations/createapialphaextractions.d.ts +57 -0
- package/esm/models/operations/createapialphaextractions.js +26 -0
- package/esm/models/operations/deleteinternvaultsecret.d.ts +1 -1
- package/esm/models/operations/deletevaultsecret.d.ts +1 -1
- package/esm/models/operations/getanalyticsmeta.d.ts +6 -50
- package/esm/models/operations/getanalyticsmeta.js +6 -41
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/queryanalytics.d.ts +5 -85
- package/esm/models/operations/queryanalytics.js +3 -60
- package/esm/models/operator.d.ts +50 -0
- package/esm/models/operator.js +46 -0
- package/esm/models/scalarfilter.d.ts +35 -0
- package/esm/models/scalarfilter.js +21 -0
- package/esm/models/scalarfilteroperator.d.ts +20 -0
- package/esm/models/scalarfilteroperator.js +19 -0
- package/esm/models/setfilter.d.ts +37 -0
- package/esm/models/setfilter.js +27 -0
- package/esm/models/setfilteroperator.d.ts +16 -0
- package/esm/models/setfilteroperator.js +15 -0
- package/esm/models/vaultsecretwriterequest.d.ts +1 -1
- package/esm/sdk/alpha.d.ts +3 -0
- package/esm/sdk/alpha.js +4 -0
- package/esm/sdk/extractions.d.ts +13 -0
- package/esm/sdk/extractions.js +19 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { DecisionsImageAsset, DecisionsImageAsset$Outbound } from "./decisionsimageasset.js";
|
|
3
|
+
import { ExtractionDateField, ExtractionDateField$Outbound } from "./extractiondatefield.js";
|
|
4
|
+
import { ExtractionDatetimeField, ExtractionDatetimeField$Outbound } from "./extractiondatetimefield.js";
|
|
5
|
+
import { ExtractionDurationField, ExtractionDurationField$Outbound } from "./extractiondurationfield.js";
|
|
6
|
+
import { ExtractionEstimateField, ExtractionEstimateField$Outbound } from "./extractionestimatefield.js";
|
|
7
|
+
import { ExtractionForecastField, ExtractionForecastField$Outbound } from "./extractionforecastfield.js";
|
|
8
|
+
import { ExtractionListField, ExtractionListField$Outbound } from "./extractionlistfield.js";
|
|
9
|
+
import { ExtractionNumberField, ExtractionNumberField$Outbound } from "./extractionnumberfield.js";
|
|
10
|
+
import { ExtractionTextField, ExtractionTextField$Outbound } from "./extractiontextfield.js";
|
|
11
|
+
import { ExtractionTimeField, ExtractionTimeField$Outbound } from "./extractiontimefield.js";
|
|
12
|
+
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
13
|
+
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
14
|
+
/**
|
|
15
|
+
* A typed field to extract, compute, estimate or forecast from the state. Which types a model answers is model-specific; unsupported types are rejected with 400.
|
|
16
|
+
*/
|
|
17
|
+
export type Fields = ExtractionDateField | ExtractionDatetimeField | ExtractionDurationField | ExtractionEstimateField | ExtractionForecastField | ExtractionListField | ExtractionNumberField | ExtractionTextField | ExtractionTimeField;
|
|
18
|
+
export type ExtractionsRequest = {
|
|
19
|
+
/**
|
|
20
|
+
* Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.
|
|
21
|
+
*/
|
|
22
|
+
assets?: {
|
|
23
|
+
[k: string]: DecisionsImageAsset;
|
|
24
|
+
} | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Map of field name to typed field spec.
|
|
27
|
+
*/
|
|
28
|
+
fields: {
|
|
29
|
+
[k: string]: ExtractionDateField | ExtractionDatetimeField | ExtractionDurationField | ExtractionEstimateField | ExtractionForecastField | ExtractionListField | ExtractionNumberField | ExtractionTextField | ExtractionTimeField;
|
|
30
|
+
};
|
|
31
|
+
model: string;
|
|
32
|
+
provider?: ProviderPreferences | null | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* ISO date that anchors dates written without a year.
|
|
35
|
+
*/
|
|
36
|
+
referenceDate?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
|
|
39
|
+
*/
|
|
40
|
+
sessionId?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The text to read from. May be empty only when the request carries image assets.
|
|
43
|
+
*/
|
|
44
|
+
state: string;
|
|
45
|
+
/**
|
|
46
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
47
|
+
*/
|
|
48
|
+
trace?: TraceConfig | undefined;
|
|
49
|
+
user?: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type Fields$Outbound = ExtractionDateField$Outbound | ExtractionDatetimeField$Outbound | ExtractionDurationField$Outbound | ExtractionEstimateField$Outbound | ExtractionForecastField$Outbound | ExtractionListField$Outbound | ExtractionNumberField$Outbound | ExtractionTextField$Outbound | ExtractionTimeField$Outbound;
|
|
53
|
+
/** @internal */
|
|
54
|
+
export declare const Fields$outboundSchema: z.ZodType<Fields$Outbound, Fields>;
|
|
55
|
+
export declare function fieldsToJSON(fields: Fields): string;
|
|
56
|
+
/** @internal */
|
|
57
|
+
export type ExtractionsRequest$Outbound = {
|
|
58
|
+
assets?: {
|
|
59
|
+
[k: string]: DecisionsImageAsset$Outbound;
|
|
60
|
+
} | undefined;
|
|
61
|
+
fields: {
|
|
62
|
+
[k: string]: ExtractionDateField$Outbound | ExtractionDatetimeField$Outbound | ExtractionDurationField$Outbound | ExtractionEstimateField$Outbound | ExtractionForecastField$Outbound | ExtractionListField$Outbound | ExtractionNumberField$Outbound | ExtractionTextField$Outbound | ExtractionTimeField$Outbound;
|
|
63
|
+
};
|
|
64
|
+
model: string;
|
|
65
|
+
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
66
|
+
reference_date?: string | undefined;
|
|
67
|
+
session_id?: string | undefined;
|
|
68
|
+
state: string;
|
|
69
|
+
trace?: TraceConfig$Outbound | undefined;
|
|
70
|
+
user?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export declare const ExtractionsRequest$outboundSchema: z.ZodType<ExtractionsRequest$Outbound, ExtractionsRequest>;
|
|
74
|
+
export declare function extractionsRequestToJSON(extractionsRequest: ExtractionsRequest): string;
|
|
75
|
+
//# sourceMappingURL=extractionsrequest.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 43bff9429754
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { DecisionsImageAsset$outboundSchema, } from "./decisionsimageasset.js";
|
|
8
|
+
import { ExtractionDateField$outboundSchema, } from "./extractiondatefield.js";
|
|
9
|
+
import { ExtractionDatetimeField$outboundSchema, } from "./extractiondatetimefield.js";
|
|
10
|
+
import { ExtractionDurationField$outboundSchema, } from "./extractiondurationfield.js";
|
|
11
|
+
import { ExtractionEstimateField$outboundSchema, } from "./extractionestimatefield.js";
|
|
12
|
+
import { ExtractionForecastField$outboundSchema, } from "./extractionforecastfield.js";
|
|
13
|
+
import { ExtractionListField$outboundSchema, } from "./extractionlistfield.js";
|
|
14
|
+
import { ExtractionNumberField$outboundSchema, } from "./extractionnumberfield.js";
|
|
15
|
+
import { ExtractionTextField$outboundSchema, } from "./extractiontextfield.js";
|
|
16
|
+
import { ExtractionTimeField$outboundSchema, } from "./extractiontimefield.js";
|
|
17
|
+
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
18
|
+
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Fields$outboundSchema = z
|
|
21
|
+
.union([
|
|
22
|
+
ExtractionDateField$outboundSchema,
|
|
23
|
+
ExtractionDatetimeField$outboundSchema,
|
|
24
|
+
ExtractionDurationField$outboundSchema,
|
|
25
|
+
ExtractionEstimateField$outboundSchema,
|
|
26
|
+
ExtractionForecastField$outboundSchema,
|
|
27
|
+
ExtractionListField$outboundSchema,
|
|
28
|
+
ExtractionNumberField$outboundSchema,
|
|
29
|
+
ExtractionTextField$outboundSchema,
|
|
30
|
+
ExtractionTimeField$outboundSchema,
|
|
31
|
+
]);
|
|
32
|
+
export function fieldsToJSON(fields) {
|
|
33
|
+
return JSON.stringify(Fields$outboundSchema.parse(fields));
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ExtractionsRequest$outboundSchema = z.object({
|
|
37
|
+
assets: z.record(z.string(), DecisionsImageAsset$outboundSchema).optional(),
|
|
38
|
+
fields: z.record(z.string(), z.union([
|
|
39
|
+
ExtractionDateField$outboundSchema,
|
|
40
|
+
ExtractionDatetimeField$outboundSchema,
|
|
41
|
+
ExtractionDurationField$outboundSchema,
|
|
42
|
+
ExtractionEstimateField$outboundSchema,
|
|
43
|
+
ExtractionForecastField$outboundSchema,
|
|
44
|
+
ExtractionListField$outboundSchema,
|
|
45
|
+
ExtractionNumberField$outboundSchema,
|
|
46
|
+
ExtractionTextField$outboundSchema,
|
|
47
|
+
ExtractionTimeField$outboundSchema,
|
|
48
|
+
])),
|
|
49
|
+
model: z.string(),
|
|
50
|
+
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
51
|
+
referenceDate: z.string().optional(),
|
|
52
|
+
sessionId: z.string().optional(),
|
|
53
|
+
state: z.string(),
|
|
54
|
+
trace: TraceConfig$outboundSchema.optional(),
|
|
55
|
+
user: z.string().optional(),
|
|
56
|
+
}).transform((v) => {
|
|
57
|
+
return remap$(v, {
|
|
58
|
+
referenceDate: "reference_date",
|
|
59
|
+
sessionId: "session_id",
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
export function extractionsRequestToJSON(extractionsRequest) {
|
|
63
|
+
return JSON.stringify(ExtractionsRequest$outboundSchema.parse(extractionsRequest));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=extractionsrequest.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ExtractionDateAnswer } from "./extractiondateanswer.js";
|
|
6
|
+
import { ExtractionDatetimeAnswer } from "./extractiondatetimeanswer.js";
|
|
7
|
+
import { ExtractionDurationAnswer } from "./extractiondurationanswer.js";
|
|
8
|
+
import { ExtractionEstimateAnswer } from "./extractionestimateanswer.js";
|
|
9
|
+
import { ExtractionForecastAnswer } from "./extractionforecastanswer.js";
|
|
10
|
+
import { ExtractionListAnswer } from "./extractionlistanswer.js";
|
|
11
|
+
import { ExtractionNumberAnswer } from "./extractionnumberanswer.js";
|
|
12
|
+
import { ExtractionsUsage } from "./extractionsusage.js";
|
|
13
|
+
import { ExtractionTextAnswer } from "./extractiontextanswer.js";
|
|
14
|
+
import { ExtractionTimeAnswer } from "./extractiontimeanswer.js";
|
|
15
|
+
/**
|
|
16
|
+
* One answer per requested field. `value` is null when the state does not determine it.
|
|
17
|
+
*/
|
|
18
|
+
export type ExtractionsResponseAnswers = ExtractionDateAnswer | ExtractionDatetimeAnswer | ExtractionDurationAnswer | ExtractionEstimateAnswer | ExtractionForecastAnswer | ExtractionListAnswer | ExtractionNumberAnswer | ExtractionTextAnswer | ExtractionTimeAnswer | discriminatedUnionTypes.Unknown<"type">;
|
|
19
|
+
export type ExtractionsResponse = {
|
|
20
|
+
answers: {
|
|
21
|
+
[k: string]: ExtractionDateAnswer | ExtractionDatetimeAnswer | ExtractionDurationAnswer | ExtractionEstimateAnswer | ExtractionForecastAnswer | ExtractionListAnswer | ExtractionNumberAnswer | ExtractionTextAnswer | ExtractionTimeAnswer | discriminatedUnionTypes.Unknown<"type">;
|
|
22
|
+
};
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
model: string;
|
|
25
|
+
provider?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The text that spans index into, when requested through provider options.
|
|
28
|
+
*/
|
|
29
|
+
stateText?: string | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* True when the provider read only a prefix of the state.
|
|
32
|
+
*/
|
|
33
|
+
truncated?: boolean | undefined;
|
|
34
|
+
usage: ExtractionsUsage;
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const ExtractionsResponseAnswers$inboundSchema: z.ZodType<ExtractionsResponseAnswers, unknown>;
|
|
38
|
+
export declare function extractionsResponseAnswersFromJSON(jsonString: string): SafeParseResult<ExtractionsResponseAnswers, SDKValidationError>;
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const ExtractionsResponse$inboundSchema: z.ZodType<ExtractionsResponse, unknown>;
|
|
41
|
+
export declare function extractionsResponseFromJSON(jsonString: string): SafeParseResult<ExtractionsResponse, SDKValidationError>;
|
|
42
|
+
//# sourceMappingURL=extractionsresponse.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2c4d0e7507e5
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
9
|
+
import { ExtractionDateAnswer$inboundSchema, } from "./extractiondateanswer.js";
|
|
10
|
+
import { ExtractionDatetimeAnswer$inboundSchema, } from "./extractiondatetimeanswer.js";
|
|
11
|
+
import { ExtractionDurationAnswer$inboundSchema, } from "./extractiondurationanswer.js";
|
|
12
|
+
import { ExtractionEstimateAnswer$inboundSchema, } from "./extractionestimateanswer.js";
|
|
13
|
+
import { ExtractionForecastAnswer$inboundSchema, } from "./extractionforecastanswer.js";
|
|
14
|
+
import { ExtractionListAnswer$inboundSchema, } from "./extractionlistanswer.js";
|
|
15
|
+
import { ExtractionNumberAnswer$inboundSchema, } from "./extractionnumberanswer.js";
|
|
16
|
+
import { ExtractionsUsage$inboundSchema, } from "./extractionsusage.js";
|
|
17
|
+
import { ExtractionTextAnswer$inboundSchema, } from "./extractiontextanswer.js";
|
|
18
|
+
import { ExtractionTimeAnswer$inboundSchema, } from "./extractiontimeanswer.js";
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ExtractionsResponseAnswers$inboundSchema = discriminatedUnion("type", {
|
|
21
|
+
date: ExtractionDateAnswer$inboundSchema,
|
|
22
|
+
datetime: ExtractionDatetimeAnswer$inboundSchema,
|
|
23
|
+
duration: ExtractionDurationAnswer$inboundSchema,
|
|
24
|
+
estimate: ExtractionEstimateAnswer$inboundSchema,
|
|
25
|
+
forecast: ExtractionForecastAnswer$inboundSchema,
|
|
26
|
+
list: ExtractionListAnswer$inboundSchema,
|
|
27
|
+
number: ExtractionNumberAnswer$inboundSchema,
|
|
28
|
+
text: ExtractionTextAnswer$inboundSchema,
|
|
29
|
+
time: ExtractionTimeAnswer$inboundSchema,
|
|
30
|
+
});
|
|
31
|
+
export function extractionsResponseAnswersFromJSON(jsonString) {
|
|
32
|
+
return safeParse(jsonString, (x) => ExtractionsResponseAnswers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionsResponseAnswers' from JSON`);
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const ExtractionsResponse$inboundSchema = z.object({
|
|
36
|
+
answers: z.record(z.string(), discriminatedUnion("type", {
|
|
37
|
+
date: ExtractionDateAnswer$inboundSchema,
|
|
38
|
+
datetime: ExtractionDatetimeAnswer$inboundSchema,
|
|
39
|
+
duration: ExtractionDurationAnswer$inboundSchema,
|
|
40
|
+
estimate: ExtractionEstimateAnswer$inboundSchema,
|
|
41
|
+
forecast: ExtractionForecastAnswer$inboundSchema,
|
|
42
|
+
list: ExtractionListAnswer$inboundSchema,
|
|
43
|
+
number: ExtractionNumberAnswer$inboundSchema,
|
|
44
|
+
text: ExtractionTextAnswer$inboundSchema,
|
|
45
|
+
time: ExtractionTimeAnswer$inboundSchema,
|
|
46
|
+
})),
|
|
47
|
+
id: z.string().optional(),
|
|
48
|
+
model: z.string(),
|
|
49
|
+
provider: z.string().optional(),
|
|
50
|
+
state_text: z.nullable(z.string()).optional(),
|
|
51
|
+
truncated: z.boolean().optional(),
|
|
52
|
+
usage: ExtractionsUsage$inboundSchema,
|
|
53
|
+
}).transform((v) => {
|
|
54
|
+
return remap$(v, {
|
|
55
|
+
"state_text": "stateText",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
export function extractionsResponseFromJSON(jsonString) {
|
|
59
|
+
return safeParse(jsonString, (x) => ExtractionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionsResponse' from JSON`);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=extractionsresponse.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type ExtractionsUsage = {
|
|
5
|
+
cost?: number | undefined;
|
|
6
|
+
imageTokens?: number | undefined;
|
|
7
|
+
inputTokens: number;
|
|
8
|
+
outputTokens: number;
|
|
9
|
+
/**
|
|
10
|
+
* Number of upstream passes when the fields did not fit in one.
|
|
11
|
+
*/
|
|
12
|
+
passes?: number | undefined;
|
|
13
|
+
schemaTokens?: number | undefined;
|
|
14
|
+
stateTokens?: number | undefined;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const ExtractionsUsage$inboundSchema: z.ZodType<ExtractionsUsage, unknown>;
|
|
18
|
+
export declare function extractionsUsageFromJSON(jsonString: string): SafeParseResult<ExtractionsUsage, SDKValidationError>;
|
|
19
|
+
//# sourceMappingURL=extractionsusage.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 539fcca69ecb
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const ExtractionsUsage$inboundSchema = z.object({
|
|
10
|
+
cost: z.number().optional(),
|
|
11
|
+
image_tokens: z.int().optional(),
|
|
12
|
+
input_tokens: z.int(),
|
|
13
|
+
output_tokens: z.int(),
|
|
14
|
+
passes: z.int().optional(),
|
|
15
|
+
schema_tokens: z.int().optional(),
|
|
16
|
+
state_tokens: z.int().optional(),
|
|
17
|
+
}).transform((v) => {
|
|
18
|
+
return remap$(v, {
|
|
19
|
+
"image_tokens": "imageTokens",
|
|
20
|
+
"input_tokens": "inputTokens",
|
|
21
|
+
"output_tokens": "outputTokens",
|
|
22
|
+
"schema_tokens": "schemaTokens",
|
|
23
|
+
"state_tokens": "stateTokens",
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
export function extractionsUsageFromJSON(jsonString) {
|
|
27
|
+
return safeParse(jsonString, (x) => ExtractionsUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionsUsage' from JSON`);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=extractionsusage.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
/**
|
|
6
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ExtractionTextAnswerSource: {
|
|
9
|
+
readonly State: "state";
|
|
10
|
+
readonly Image: "image";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
*/
|
|
15
|
+
export type ExtractionTextAnswerSource = OpenEnum<typeof ExtractionTextAnswerSource>;
|
|
16
|
+
export type ExtractionTextAnswer = {
|
|
17
|
+
confidence?: number | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The most likely value even when `value` is null because `p_null` crossed the threshold.
|
|
20
|
+
*/
|
|
21
|
+
guess?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Probability that the state contains nothing for this field.
|
|
24
|
+
*/
|
|
25
|
+
pNull?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
*/
|
|
29
|
+
source?: ExtractionTextAnswerSource | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
|
|
32
|
+
*/
|
|
33
|
+
span?: Array<number> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Confidence in the spelling of text read from an image.
|
|
36
|
+
*/
|
|
37
|
+
spellConfidence?: number | undefined;
|
|
38
|
+
type: "text";
|
|
39
|
+
value: string | null;
|
|
40
|
+
};
|
|
41
|
+
/** @internal */
|
|
42
|
+
export declare const ExtractionTextAnswerSource$inboundSchema: z.ZodType<ExtractionTextAnswerSource, unknown>;
|
|
43
|
+
/** @internal */
|
|
44
|
+
export declare const ExtractionTextAnswer$inboundSchema: z.ZodType<ExtractionTextAnswer, unknown>;
|
|
45
|
+
export declare function extractionTextAnswerFromJSON(jsonString: string): SafeParseResult<ExtractionTextAnswer, SDKValidationError>;
|
|
46
|
+
//# sourceMappingURL=extractiontextanswer.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4c006742e2fc
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
11
|
+
*/
|
|
12
|
+
export const ExtractionTextAnswerSource = {
|
|
13
|
+
State: "state",
|
|
14
|
+
Image: "image",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ExtractionTextAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionTextAnswerSource);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ExtractionTextAnswer$inboundSchema = z.object({
|
|
20
|
+
confidence: z.number().optional(),
|
|
21
|
+
guess: z.string().optional(),
|
|
22
|
+
p_null: z.number().optional(),
|
|
23
|
+
source: ExtractionTextAnswerSource$inboundSchema.optional(),
|
|
24
|
+
span: z.array(z.int()).optional(),
|
|
25
|
+
spell_confidence: z.number().optional(),
|
|
26
|
+
type: z.literal("text"),
|
|
27
|
+
value: z.nullable(z.string()),
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"p_null": "pNull",
|
|
31
|
+
"spell_confidence": "spellConfidence",
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
export function extractionTextAnswerFromJSON(jsonString) {
|
|
35
|
+
return safeParse(jsonString, (x) => ExtractionTextAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionTextAnswer' from JSON`);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=extractiontextanswer.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type ExtractionTextField = {
|
|
3
|
+
/**
|
|
4
|
+
* What the field should contain.
|
|
5
|
+
*/
|
|
6
|
+
instructions?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Probability of null above which `value` is null. Default 0.5.
|
|
9
|
+
*/
|
|
10
|
+
nullThreshold?: number | undefined;
|
|
11
|
+
type: "text";
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export type ExtractionTextField$Outbound = {
|
|
15
|
+
instructions?: string | undefined;
|
|
16
|
+
null_threshold?: number | undefined;
|
|
17
|
+
type: "text";
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const ExtractionTextField$outboundSchema: z.ZodType<ExtractionTextField$Outbound, ExtractionTextField>;
|
|
21
|
+
export declare function extractionTextFieldToJSON(extractionTextField: ExtractionTextField): string;
|
|
22
|
+
//# sourceMappingURL=extractiontextfield.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 601482d94cbe
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ExtractionTextField$outboundSchema = z.object({
|
|
9
|
+
instructions: z.string().optional(),
|
|
10
|
+
nullThreshold: z.number().optional(),
|
|
11
|
+
type: z.literal("text"),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
nullThreshold: "null_threshold",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
export function extractionTextFieldToJSON(extractionTextField) {
|
|
18
|
+
return JSON.stringify(ExtractionTextField$outboundSchema.parse(extractionTextField));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=extractiontextfield.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
/**
|
|
6
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ExtractionTimeAnswerSource: {
|
|
9
|
+
readonly State: "state";
|
|
10
|
+
readonly Image: "image";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
14
|
+
*/
|
|
15
|
+
export type ExtractionTimeAnswerSource = OpenEnum<typeof ExtractionTimeAnswerSource>;
|
|
16
|
+
export type ExtractionTimeAnswer = {
|
|
17
|
+
confidence?: number | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The most likely value even when `value` is null because `p_null` crossed the threshold.
|
|
20
|
+
*/
|
|
21
|
+
guess?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Probability that the state contains nothing for this field.
|
|
24
|
+
*/
|
|
25
|
+
pNull?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
28
|
+
*/
|
|
29
|
+
source?: ExtractionTimeAnswerSource | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
|
|
32
|
+
*/
|
|
33
|
+
span?: Array<number> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Confidence in the spelling of text read from an image.
|
|
36
|
+
*/
|
|
37
|
+
spellConfidence?: number | undefined;
|
|
38
|
+
type: "time";
|
|
39
|
+
value: string | null;
|
|
40
|
+
};
|
|
41
|
+
/** @internal */
|
|
42
|
+
export declare const ExtractionTimeAnswerSource$inboundSchema: z.ZodType<ExtractionTimeAnswerSource, unknown>;
|
|
43
|
+
/** @internal */
|
|
44
|
+
export declare const ExtractionTimeAnswer$inboundSchema: z.ZodType<ExtractionTimeAnswer, unknown>;
|
|
45
|
+
export declare function extractionTimeAnswerFromJSON(jsonString: string): SafeParseResult<ExtractionTimeAnswer, SDKValidationError>;
|
|
46
|
+
//# sourceMappingURL=extractiontimeanswer.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: bf3ef8199855
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Set to `image` when the answer was read from an image rather than the state text.
|
|
11
|
+
*/
|
|
12
|
+
export const ExtractionTimeAnswerSource = {
|
|
13
|
+
State: "state",
|
|
14
|
+
Image: "image",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ExtractionTimeAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionTimeAnswerSource);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ExtractionTimeAnswer$inboundSchema = z.object({
|
|
20
|
+
confidence: z.number().optional(),
|
|
21
|
+
guess: z.string().optional(),
|
|
22
|
+
p_null: z.number().optional(),
|
|
23
|
+
source: ExtractionTimeAnswerSource$inboundSchema.optional(),
|
|
24
|
+
span: z.array(z.int()).optional(),
|
|
25
|
+
spell_confidence: z.number().optional(),
|
|
26
|
+
type: z.literal("time"),
|
|
27
|
+
value: z.nullable(z.string()),
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"p_null": "pNull",
|
|
31
|
+
"spell_confidence": "spellConfidence",
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
export function extractionTimeAnswerFromJSON(jsonString) {
|
|
35
|
+
return safeParse(jsonString, (x) => ExtractionTimeAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionTimeAnswer' from JSON`);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=extractiontimeanswer.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type ExtractionTimeField = {
|
|
3
|
+
/**
|
|
4
|
+
* What the field should contain.
|
|
5
|
+
*/
|
|
6
|
+
instructions?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Probability of null above which `value` is null. Default 0.5.
|
|
9
|
+
*/
|
|
10
|
+
nullThreshold?: number | undefined;
|
|
11
|
+
type: "time";
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export type ExtractionTimeField$Outbound = {
|
|
15
|
+
instructions?: string | undefined;
|
|
16
|
+
null_threshold?: number | undefined;
|
|
17
|
+
type: "time";
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const ExtractionTimeField$outboundSchema: z.ZodType<ExtractionTimeField$Outbound, ExtractionTimeField>;
|
|
21
|
+
export declare function extractionTimeFieldToJSON(extractionTimeField: ExtractionTimeField): string;
|
|
22
|
+
//# sourceMappingURL=extractiontimefield.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 20957cc003d4
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ExtractionTimeField$outboundSchema = z.object({
|
|
9
|
+
instructions: z.string().optional(),
|
|
10
|
+
nullThreshold: z.number().optional(),
|
|
11
|
+
type: z.literal("time"),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
nullThreshold: "null_threshold",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
export function extractionTimeFieldToJSON(extractionTimeField) {
|
|
18
|
+
return JSON.stringify(ExtractionTimeField$outboundSchema.parse(extractionTimeField));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=extractiontimefield.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ScalarFilter, ScalarFilter$Outbound } from "./scalarfilter.js";
|
|
3
|
+
import { SetFilter, SetFilter$Outbound } from "./setfilter.js";
|
|
4
|
+
export type Filter = ScalarFilter | SetFilter;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type Filter$Outbound = ScalarFilter$Outbound | SetFilter$Outbound;
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const Filter$outboundSchema: z.ZodType<Filter$Outbound, Filter>;
|
|
9
|
+
export declare function filterToJSON(filter: Filter): string;
|
|
10
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: bf04a8cd8dcd
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { ScalarFilter$outboundSchema, } from "./scalarfilter.js";
|
|
7
|
+
import { SetFilter$outboundSchema, } from "./setfilter.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const Filter$outboundSchema = z
|
|
10
|
+
.union([ScalarFilter$outboundSchema, SetFilter$outboundSchema]);
|
|
11
|
+
export function filterToJSON(filter) {
|
|
12
|
+
return JSON.stringify(Filter$outboundSchema.parse(filter));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -118,7 +118,7 @@ export type ImageGenerationRequest = {
|
|
|
118
118
|
*/
|
|
119
119
|
n?: number | undefined;
|
|
120
120
|
/**
|
|
121
|
-
* Compression level (0-100) for webp
|
|
121
|
+
* Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp").
|
|
122
122
|
*/
|
|
123
123
|
outputCompression?: number | undefined;
|
|
124
124
|
/**
|
|
@@ -150,7 +150,7 @@ export type ImageGenerationRequest = {
|
|
|
150
150
|
*/
|
|
151
151
|
sessionId?: string | undefined;
|
|
152
152
|
/**
|
|
153
|
-
* Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048")
|
|
153
|
+
* Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`.
|
|
154
154
|
*/
|
|
155
155
|
size?: string | undefined;
|
|
156
156
|
/**
|