@openrouter/sdk 1.5.24 → 1.5.26

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.
Files changed (70) hide show
  1. package/esm/funcs/alphaExtractionsCreate.d.ts +19 -0
  2. package/esm/funcs/alphaExtractionsCreate.js +105 -0
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/models/decisionsresponse.d.ts +3 -3
  6. package/esm/models/decisionsresponse.js +3 -3
  7. package/esm/models/extractiondateanswer.d.ts +46 -0
  8. package/esm/models/extractiondateanswer.js +37 -0
  9. package/esm/models/extractiondatefield.d.ts +22 -0
  10. package/esm/models/extractiondatefield.js +20 -0
  11. package/esm/models/extractiondatetimeanswer.d.ts +46 -0
  12. package/esm/models/extractiondatetimeanswer.js +37 -0
  13. package/esm/models/extractiondatetimefield.d.ts +22 -0
  14. package/esm/models/extractiondatetimefield.js +20 -0
  15. package/esm/models/extractiondurationanswer.d.ts +50 -0
  16. package/esm/models/extractiondurationanswer.js +38 -0
  17. package/esm/models/extractiondurationfield.d.ts +34 -0
  18. package/esm/models/extractiondurationfield.js +23 -0
  19. package/esm/models/extractionestimateanswer.d.ts +89 -0
  20. package/esm/models/extractionestimateanswer.js +80 -0
  21. package/esm/models/extractionestimatefield.d.ts +70 -0
  22. package/esm/models/extractionestimatefield.js +65 -0
  23. package/esm/models/extractionforecastanswer.d.ts +72 -0
  24. package/esm/models/extractionforecastanswer.js +72 -0
  25. package/esm/models/extractionforecastfield.d.ts +90 -0
  26. package/esm/models/extractionforecastfield.js +80 -0
  27. package/esm/models/extractionforecaststep.d.ts +50 -0
  28. package/esm/models/extractionforecaststep.js +57 -0
  29. package/esm/models/extractionlistanswer.d.ts +51 -0
  30. package/esm/models/extractionlistanswer.js +47 -0
  31. package/esm/models/extractionlistfield.d.ts +38 -0
  32. package/esm/models/extractionlistfield.js +31 -0
  33. package/esm/models/extractionnumberanswer.d.ts +46 -0
  34. package/esm/models/extractionnumberanswer.js +37 -0
  35. package/esm/models/extractionnumberfield.d.ts +31 -0
  36. package/esm/models/extractionnumberfield.js +23 -0
  37. package/esm/models/extractionsrequest.d.ts +75 -0
  38. package/esm/models/extractionsrequest.js +65 -0
  39. package/esm/models/extractionsresponse.d.ts +42 -0
  40. package/esm/models/extractionsresponse.js +61 -0
  41. package/esm/models/extractionsusage.d.ts +19 -0
  42. package/esm/models/extractionsusage.js +29 -0
  43. package/esm/models/extractiontextanswer.d.ts +46 -0
  44. package/esm/models/extractiontextanswer.js +37 -0
  45. package/esm/models/extractiontextfield.d.ts +22 -0
  46. package/esm/models/extractiontextfield.js +20 -0
  47. package/esm/models/extractiontimeanswer.d.ts +46 -0
  48. package/esm/models/extractiontimeanswer.js +37 -0
  49. package/esm/models/extractiontimefield.d.ts +22 -0
  50. package/esm/models/extractiontimefield.js +20 -0
  51. package/esm/models/generationresponse.d.ts +1 -0
  52. package/esm/models/generationresponse.js +1 -0
  53. package/esm/models/imagegenerationproviderpreferences.d.ts +1 -1
  54. package/esm/models/index.d.ts +22 -0
  55. package/esm/models/index.js +22 -0
  56. package/esm/models/operations/createapialphaextractions.d.ts +57 -0
  57. package/esm/models/operations/createapialphaextractions.js +26 -0
  58. package/esm/models/operations/index.d.ts +1 -0
  59. package/esm/models/operations/index.js +1 -0
  60. package/esm/models/provideroptions.d.ts +1 -1
  61. package/esm/models/providerpreferences.d.ts +1 -1
  62. package/esm/models/speechrequest.d.ts +1 -1
  63. package/esm/models/sttrequest.d.ts +1 -1
  64. package/esm/models/videogenerationrequest.d.ts +1 -1
  65. package/esm/sdk/alpha.d.ts +3 -0
  66. package/esm/sdk/alpha.js +4 -0
  67. package/esm/sdk/extractions.d.ts +13 -0
  68. package/esm/sdk/extractions.js +19 -0
  69. package/jsr.json +1 -1
  70. package/package.json +9 -9
@@ -0,0 +1,89 @@
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
+ * The most likely value even when `value` is null because `p_null` crossed the threshold.
7
+ */
8
+ export type ExtractionEstimateAnswerGuess = number | string;
9
+ export type ExtractionEstimateAnswerMean = number | string;
10
+ export type ExtractionEstimateAnswerMedian = number | string;
11
+ export type ExtractionEstimateAnswerP10 = number | string;
12
+ export type ExtractionEstimateAnswerP90 = number | string;
13
+ export type ExtractionEstimateAnswerQuantile = number | string;
14
+ /**
15
+ * Set to `image` when the answer was read from an image rather than the state text.
16
+ */
17
+ export declare const ExtractionEstimateAnswerSource: {
18
+ readonly State: "state";
19
+ readonly Image: "image";
20
+ };
21
+ /**
22
+ * Set to `image` when the answer was read from an image rather than the state text.
23
+ */
24
+ export type ExtractionEstimateAnswerSource = OpenEnum<typeof ExtractionEstimateAnswerSource>;
25
+ export type ExtractionEstimateAnswerValue = number | string;
26
+ export type ExtractionEstimateAnswer = {
27
+ confidence?: number | undefined;
28
+ /**
29
+ * The most likely value even when `value` is null because `p_null` crossed the threshold.
30
+ */
31
+ guess?: number | string | undefined;
32
+ mean?: number | string | undefined;
33
+ median?: number | string | undefined;
34
+ /**
35
+ * Probability mass above `max`.
36
+ */
37
+ pAbove?: number | undefined;
38
+ /**
39
+ * Probability mass below `min`.
40
+ */
41
+ pBelow?: number | undefined;
42
+ /**
43
+ * Probability that the state contains nothing for this field.
44
+ */
45
+ pNull?: number | undefined;
46
+ p10?: number | string | undefined;
47
+ p90?: number | string | undefined;
48
+ /**
49
+ * 99 percentiles, present when the provider is asked for quantiles.
50
+ */
51
+ quantiles?: Array<number | string> | undefined;
52
+ /**
53
+ * Set to `image` when the answer was read from an image rather than the state text.
54
+ */
55
+ source?: ExtractionEstimateAnswerSource | undefined;
56
+ /**
57
+ * Confidence in the spelling of text read from an image.
58
+ */
59
+ spellConfidence?: number | undefined;
60
+ type: "estimate";
61
+ value: number | string | null;
62
+ };
63
+ /** @internal */
64
+ export declare const ExtractionEstimateAnswerGuess$inboundSchema: z.ZodType<ExtractionEstimateAnswerGuess, unknown>;
65
+ export declare function extractionEstimateAnswerGuessFromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerGuess, SDKValidationError>;
66
+ /** @internal */
67
+ export declare const ExtractionEstimateAnswerMean$inboundSchema: z.ZodType<ExtractionEstimateAnswerMean, unknown>;
68
+ export declare function extractionEstimateAnswerMeanFromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerMean, SDKValidationError>;
69
+ /** @internal */
70
+ export declare const ExtractionEstimateAnswerMedian$inboundSchema: z.ZodType<ExtractionEstimateAnswerMedian, unknown>;
71
+ export declare function extractionEstimateAnswerMedianFromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerMedian, SDKValidationError>;
72
+ /** @internal */
73
+ export declare const ExtractionEstimateAnswerP10$inboundSchema: z.ZodType<ExtractionEstimateAnswerP10, unknown>;
74
+ export declare function extractionEstimateAnswerP10FromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerP10, SDKValidationError>;
75
+ /** @internal */
76
+ export declare const ExtractionEstimateAnswerP90$inboundSchema: z.ZodType<ExtractionEstimateAnswerP90, unknown>;
77
+ export declare function extractionEstimateAnswerP90FromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerP90, SDKValidationError>;
78
+ /** @internal */
79
+ export declare const ExtractionEstimateAnswerQuantile$inboundSchema: z.ZodType<ExtractionEstimateAnswerQuantile, unknown>;
80
+ export declare function extractionEstimateAnswerQuantileFromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerQuantile, SDKValidationError>;
81
+ /** @internal */
82
+ export declare const ExtractionEstimateAnswerSource$inboundSchema: z.ZodType<ExtractionEstimateAnswerSource, unknown>;
83
+ /** @internal */
84
+ export declare const ExtractionEstimateAnswerValue$inboundSchema: z.ZodType<ExtractionEstimateAnswerValue, unknown>;
85
+ export declare function extractionEstimateAnswerValueFromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswerValue, SDKValidationError>;
86
+ /** @internal */
87
+ export declare const ExtractionEstimateAnswer$inboundSchema: z.ZodType<ExtractionEstimateAnswer, unknown>;
88
+ export declare function extractionEstimateAnswerFromJSON(jsonString: string): SafeParseResult<ExtractionEstimateAnswer, SDKValidationError>;
89
+ //# sourceMappingURL=extractionestimateanswer.d.ts.map
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 48f87e35341d
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 ExtractionEstimateAnswerSource = {
13
+ State: "state",
14
+ Image: "image",
15
+ };
16
+ /** @internal */
17
+ export const ExtractionEstimateAnswerGuess$inboundSchema = z.union([z.number(), z.string()]);
18
+ export function extractionEstimateAnswerGuessFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerGuess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerGuess' from JSON`);
20
+ }
21
+ /** @internal */
22
+ export const ExtractionEstimateAnswerMean$inboundSchema = z.union([z.number(), z.string()]);
23
+ export function extractionEstimateAnswerMeanFromJSON(jsonString) {
24
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerMean$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerMean' from JSON`);
25
+ }
26
+ /** @internal */
27
+ export const ExtractionEstimateAnswerMedian$inboundSchema = z.union([z.number(), z.string()]);
28
+ export function extractionEstimateAnswerMedianFromJSON(jsonString) {
29
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerMedian$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerMedian' from JSON`);
30
+ }
31
+ /** @internal */
32
+ export const ExtractionEstimateAnswerP10$inboundSchema = z.union([z.number(), z.string()]);
33
+ export function extractionEstimateAnswerP10FromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerP10$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerP10' from JSON`);
35
+ }
36
+ /** @internal */
37
+ export const ExtractionEstimateAnswerP90$inboundSchema = z.union([z.number(), z.string()]);
38
+ export function extractionEstimateAnswerP90FromJSON(jsonString) {
39
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerP90$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerP90' from JSON`);
40
+ }
41
+ /** @internal */
42
+ export const ExtractionEstimateAnswerQuantile$inboundSchema = z.union([z.number(), z.string()]);
43
+ export function extractionEstimateAnswerQuantileFromJSON(jsonString) {
44
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerQuantile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerQuantile' from JSON`);
45
+ }
46
+ /** @internal */
47
+ export const ExtractionEstimateAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionEstimateAnswerSource);
48
+ /** @internal */
49
+ export const ExtractionEstimateAnswerValue$inboundSchema = z.union([z.number(), z.string()]);
50
+ export function extractionEstimateAnswerValueFromJSON(jsonString) {
51
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswerValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswerValue' from JSON`);
52
+ }
53
+ /** @internal */
54
+ export const ExtractionEstimateAnswer$inboundSchema = z.object({
55
+ confidence: z.number().optional(),
56
+ guess: z.union([z.number(), z.string()]).optional(),
57
+ mean: z.union([z.number(), z.string()]).optional(),
58
+ median: z.union([z.number(), z.string()]).optional(),
59
+ p_above: z.number().optional(),
60
+ p_below: z.number().optional(),
61
+ p_null: z.number().optional(),
62
+ p10: z.union([z.number(), z.string()]).optional(),
63
+ p90: z.union([z.number(), z.string()]).optional(),
64
+ quantiles: z.array(z.union([z.number(), z.string()])).optional(),
65
+ source: ExtractionEstimateAnswerSource$inboundSchema.optional(),
66
+ spell_confidence: z.number().optional(),
67
+ type: z.literal("estimate"),
68
+ value: z.nullable(z.union([z.number(), z.string()])),
69
+ }).transform((v) => {
70
+ return remap$(v, {
71
+ "p_above": "pAbove",
72
+ "p_below": "pBelow",
73
+ "p_null": "pNull",
74
+ "spell_confidence": "spellConfidence",
75
+ });
76
+ });
77
+ export function extractionEstimateAnswerFromJSON(jsonString) {
78
+ return safeParse(jsonString, (x) => ExtractionEstimateAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionEstimateAnswer' from JSON`);
79
+ }
80
+ //# sourceMappingURL=extractionestimateanswer.js.map
@@ -0,0 +1,70 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ export type ExtractionEstimateFieldMax = number | string;
4
+ export type ExtractionEstimateFieldMin = number | string;
5
+ export declare const ExtractionEstimateFieldScale: {
6
+ readonly Linear: "linear";
7
+ readonly Log: "log";
8
+ };
9
+ export type ExtractionEstimateFieldScale = OpenEnum<typeof ExtractionEstimateFieldScale>;
10
+ export declare const ExtractionEstimateFieldStepYear: {
11
+ readonly Year: "year";
12
+ };
13
+ export type ExtractionEstimateFieldStepYear = ClosedEnum<typeof ExtractionEstimateFieldStepYear>;
14
+ export declare const ExtractionEstimateFieldStepMonth: {
15
+ readonly Month: "month";
16
+ };
17
+ export type ExtractionEstimateFieldStepMonth = ClosedEnum<typeof ExtractionEstimateFieldStepMonth>;
18
+ export type ExtractionEstimateFieldStepUnion = number | ExtractionEstimateFieldStepMonth | ExtractionEstimateFieldStepYear;
19
+ export type ExtractionEstimateField = {
20
+ /**
21
+ * What the field should contain.
22
+ */
23
+ instructions?: string | undefined;
24
+ max: number | string;
25
+ min: number | string;
26
+ /**
27
+ * Probability of null above which `value` is null. Default 0.5.
28
+ */
29
+ nullThreshold?: number | undefined;
30
+ scale?: ExtractionEstimateFieldScale | undefined;
31
+ step?: number | ExtractionEstimateFieldStepMonth | ExtractionEstimateFieldStepYear | undefined;
32
+ type: "estimate";
33
+ unit?: string | undefined;
34
+ };
35
+ /** @internal */
36
+ export type ExtractionEstimateFieldMax$Outbound = number | string;
37
+ /** @internal */
38
+ export declare const ExtractionEstimateFieldMax$outboundSchema: z.ZodType<ExtractionEstimateFieldMax$Outbound, ExtractionEstimateFieldMax>;
39
+ export declare function extractionEstimateFieldMaxToJSON(extractionEstimateFieldMax: ExtractionEstimateFieldMax): string;
40
+ /** @internal */
41
+ export type ExtractionEstimateFieldMin$Outbound = number | string;
42
+ /** @internal */
43
+ export declare const ExtractionEstimateFieldMin$outboundSchema: z.ZodType<ExtractionEstimateFieldMin$Outbound, ExtractionEstimateFieldMin>;
44
+ export declare function extractionEstimateFieldMinToJSON(extractionEstimateFieldMin: ExtractionEstimateFieldMin): string;
45
+ /** @internal */
46
+ export declare const ExtractionEstimateFieldScale$outboundSchema: z.ZodType<string, ExtractionEstimateFieldScale>;
47
+ /** @internal */
48
+ export declare const ExtractionEstimateFieldStepYear$outboundSchema: z.ZodEnum<typeof ExtractionEstimateFieldStepYear>;
49
+ /** @internal */
50
+ export declare const ExtractionEstimateFieldStepMonth$outboundSchema: z.ZodEnum<typeof ExtractionEstimateFieldStepMonth>;
51
+ /** @internal */
52
+ export type ExtractionEstimateFieldStepUnion$Outbound = number | string | string;
53
+ /** @internal */
54
+ export declare const ExtractionEstimateFieldStepUnion$outboundSchema: z.ZodType<ExtractionEstimateFieldStepUnion$Outbound, ExtractionEstimateFieldStepUnion>;
55
+ export declare function extractionEstimateFieldStepUnionToJSON(extractionEstimateFieldStepUnion: ExtractionEstimateFieldStepUnion): string;
56
+ /** @internal */
57
+ export type ExtractionEstimateField$Outbound = {
58
+ instructions?: string | undefined;
59
+ max: number | string;
60
+ min: number | string;
61
+ null_threshold?: number | undefined;
62
+ scale?: string | undefined;
63
+ step?: number | string | string | undefined;
64
+ type: "estimate";
65
+ unit?: string | undefined;
66
+ };
67
+ /** @internal */
68
+ export declare const ExtractionEstimateField$outboundSchema: z.ZodType<ExtractionEstimateField$Outbound, ExtractionEstimateField>;
69
+ export declare function extractionEstimateFieldToJSON(extractionEstimateField: ExtractionEstimateField): string;
70
+ //# sourceMappingURL=extractionestimatefield.d.ts.map
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1a1d98c8e726
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 ExtractionEstimateFieldScale = {
9
+ Linear: "linear",
10
+ Log: "log",
11
+ };
12
+ export const ExtractionEstimateFieldStepYear = {
13
+ Year: "year",
14
+ };
15
+ export const ExtractionEstimateFieldStepMonth = {
16
+ Month: "month",
17
+ };
18
+ /** @internal */
19
+ export const ExtractionEstimateFieldMax$outboundSchema = z.union([z.number(), z.string()]);
20
+ export function extractionEstimateFieldMaxToJSON(extractionEstimateFieldMax) {
21
+ return JSON.stringify(ExtractionEstimateFieldMax$outboundSchema.parse(extractionEstimateFieldMax));
22
+ }
23
+ /** @internal */
24
+ export const ExtractionEstimateFieldMin$outboundSchema = z.union([z.number(), z.string()]);
25
+ export function extractionEstimateFieldMinToJSON(extractionEstimateFieldMin) {
26
+ return JSON.stringify(ExtractionEstimateFieldMin$outboundSchema.parse(extractionEstimateFieldMin));
27
+ }
28
+ /** @internal */
29
+ export const ExtractionEstimateFieldScale$outboundSchema = openEnums.outboundSchema(ExtractionEstimateFieldScale);
30
+ /** @internal */
31
+ export const ExtractionEstimateFieldStepYear$outboundSchema = z.enum(ExtractionEstimateFieldStepYear);
32
+ /** @internal */
33
+ export const ExtractionEstimateFieldStepMonth$outboundSchema = z.enum(ExtractionEstimateFieldStepMonth);
34
+ /** @internal */
35
+ export const ExtractionEstimateFieldStepUnion$outboundSchema = z.union([
36
+ z.number(),
37
+ ExtractionEstimateFieldStepMonth$outboundSchema,
38
+ ExtractionEstimateFieldStepYear$outboundSchema,
39
+ ]);
40
+ export function extractionEstimateFieldStepUnionToJSON(extractionEstimateFieldStepUnion) {
41
+ return JSON.stringify(ExtractionEstimateFieldStepUnion$outboundSchema.parse(extractionEstimateFieldStepUnion));
42
+ }
43
+ /** @internal */
44
+ export const ExtractionEstimateField$outboundSchema = z.object({
45
+ instructions: z.string().optional(),
46
+ max: z.union([z.number(), z.string()]),
47
+ min: z.union([z.number(), z.string()]),
48
+ nullThreshold: z.number().optional(),
49
+ scale: ExtractionEstimateFieldScale$outboundSchema.optional(),
50
+ step: z.union([
51
+ z.number(),
52
+ ExtractionEstimateFieldStepMonth$outboundSchema,
53
+ ExtractionEstimateFieldStepYear$outboundSchema,
54
+ ]).optional(),
55
+ type: z.literal("estimate"),
56
+ unit: z.string().optional(),
57
+ }).transform((v) => {
58
+ return remap$(v, {
59
+ nullThreshold: "null_threshold",
60
+ });
61
+ });
62
+ export function extractionEstimateFieldToJSON(extractionEstimateField) {
63
+ return JSON.stringify(ExtractionEstimateField$outboundSchema.parse(extractionEstimateField));
64
+ }
65
+ //# sourceMappingURL=extractionestimatefield.js.map
@@ -0,0 +1,72 @@
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
+ import { ExtractionForecastStep } from "./extractionforecaststep.js";
6
+ export type ExtractionForecastAnswerGuess = number | string;
7
+ export type ExtractionForecastAnswerMean = number | string;
8
+ export type ExtractionForecastAnswerMedian = number | string;
9
+ export type ExtractionForecastAnswerP10 = number | string;
10
+ export type ExtractionForecastAnswerP90 = number | string;
11
+ /**
12
+ * Set to `image` when the answer was read from an image rather than the state text.
13
+ */
14
+ export declare const ExtractionForecastAnswerSource: {
15
+ readonly State: "state";
16
+ readonly Image: "image";
17
+ };
18
+ /**
19
+ * Set to `image` when the answer was read from an image rather than the state text.
20
+ */
21
+ export type ExtractionForecastAnswerSource = OpenEnum<typeof ExtractionForecastAnswerSource>;
22
+ export type ExtractionForecastAnswerValue = number | string;
23
+ export type ExtractionForecastAnswer = {
24
+ confidence?: number | undefined;
25
+ /**
26
+ * The most likely value even when `value` is null because `p_null` crossed the threshold.
27
+ */
28
+ guess?: Array<number | string> | undefined;
29
+ mean?: Array<number | string> | undefined;
30
+ median?: Array<number | string> | undefined;
31
+ /**
32
+ * Probability that the state contains nothing for this field.
33
+ */
34
+ pNull?: number | undefined;
35
+ p10?: Array<number | string> | undefined;
36
+ p90?: Array<number | string> | undefined;
37
+ /**
38
+ * Set to `image` when the answer was read from an image rather than the state text.
39
+ */
40
+ source?: ExtractionForecastAnswerSource | undefined;
41
+ /**
42
+ * Confidence in the spelling of text read from an image.
43
+ */
44
+ spellConfidence?: number | undefined;
45
+ steps?: Array<ExtractionForecastStep> | undefined;
46
+ type: "forecast";
47
+ value: Array<number | string> | null;
48
+ };
49
+ /** @internal */
50
+ export declare const ExtractionForecastAnswerGuess$inboundSchema: z.ZodType<ExtractionForecastAnswerGuess, unknown>;
51
+ export declare function extractionForecastAnswerGuessFromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswerGuess, SDKValidationError>;
52
+ /** @internal */
53
+ export declare const ExtractionForecastAnswerMean$inboundSchema: z.ZodType<ExtractionForecastAnswerMean, unknown>;
54
+ export declare function extractionForecastAnswerMeanFromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswerMean, SDKValidationError>;
55
+ /** @internal */
56
+ export declare const ExtractionForecastAnswerMedian$inboundSchema: z.ZodType<ExtractionForecastAnswerMedian, unknown>;
57
+ export declare function extractionForecastAnswerMedianFromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswerMedian, SDKValidationError>;
58
+ /** @internal */
59
+ export declare const ExtractionForecastAnswerP10$inboundSchema: z.ZodType<ExtractionForecastAnswerP10, unknown>;
60
+ export declare function extractionForecastAnswerP10FromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswerP10, SDKValidationError>;
61
+ /** @internal */
62
+ export declare const ExtractionForecastAnswerP90$inboundSchema: z.ZodType<ExtractionForecastAnswerP90, unknown>;
63
+ export declare function extractionForecastAnswerP90FromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswerP90, SDKValidationError>;
64
+ /** @internal */
65
+ export declare const ExtractionForecastAnswerSource$inboundSchema: z.ZodType<ExtractionForecastAnswerSource, unknown>;
66
+ /** @internal */
67
+ export declare const ExtractionForecastAnswerValue$inboundSchema: z.ZodType<ExtractionForecastAnswerValue, unknown>;
68
+ export declare function extractionForecastAnswerValueFromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswerValue, SDKValidationError>;
69
+ /** @internal */
70
+ export declare const ExtractionForecastAnswer$inboundSchema: z.ZodType<ExtractionForecastAnswer, unknown>;
71
+ export declare function extractionForecastAnswerFromJSON(jsonString: string): SafeParseResult<ExtractionForecastAnswer, SDKValidationError>;
72
+ //# sourceMappingURL=extractionforecastanswer.d.ts.map
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6bee54876576
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
+ import { ExtractionForecastStep$inboundSchema, } from "./extractionforecaststep.js";
10
+ /**
11
+ * Set to `image` when the answer was read from an image rather than the state text.
12
+ */
13
+ export const ExtractionForecastAnswerSource = {
14
+ State: "state",
15
+ Image: "image",
16
+ };
17
+ /** @internal */
18
+ export const ExtractionForecastAnswerGuess$inboundSchema = z.union([z.number(), z.string()]);
19
+ export function extractionForecastAnswerGuessFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => ExtractionForecastAnswerGuess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswerGuess' from JSON`);
21
+ }
22
+ /** @internal */
23
+ export const ExtractionForecastAnswerMean$inboundSchema = z.union([z.number(), z.string()]);
24
+ export function extractionForecastAnswerMeanFromJSON(jsonString) {
25
+ return safeParse(jsonString, (x) => ExtractionForecastAnswerMean$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswerMean' from JSON`);
26
+ }
27
+ /** @internal */
28
+ export const ExtractionForecastAnswerMedian$inboundSchema = z.union([z.number(), z.string()]);
29
+ export function extractionForecastAnswerMedianFromJSON(jsonString) {
30
+ return safeParse(jsonString, (x) => ExtractionForecastAnswerMedian$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswerMedian' from JSON`);
31
+ }
32
+ /** @internal */
33
+ export const ExtractionForecastAnswerP10$inboundSchema = z.union([z.number(), z.string()]);
34
+ export function extractionForecastAnswerP10FromJSON(jsonString) {
35
+ return safeParse(jsonString, (x) => ExtractionForecastAnswerP10$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswerP10' from JSON`);
36
+ }
37
+ /** @internal */
38
+ export const ExtractionForecastAnswerP90$inboundSchema = z.union([z.number(), z.string()]);
39
+ export function extractionForecastAnswerP90FromJSON(jsonString) {
40
+ return safeParse(jsonString, (x) => ExtractionForecastAnswerP90$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswerP90' from JSON`);
41
+ }
42
+ /** @internal */
43
+ export const ExtractionForecastAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionForecastAnswerSource);
44
+ /** @internal */
45
+ export const ExtractionForecastAnswerValue$inboundSchema = z.union([z.number(), z.string()]);
46
+ export function extractionForecastAnswerValueFromJSON(jsonString) {
47
+ return safeParse(jsonString, (x) => ExtractionForecastAnswerValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswerValue' from JSON`);
48
+ }
49
+ /** @internal */
50
+ export const ExtractionForecastAnswer$inboundSchema = z.object({
51
+ confidence: z.number().optional(),
52
+ guess: z.array(z.union([z.number(), z.string()])).optional(),
53
+ mean: z.array(z.union([z.number(), z.string()])).optional(),
54
+ median: z.array(z.union([z.number(), z.string()])).optional(),
55
+ p_null: z.number().optional(),
56
+ p10: z.array(z.union([z.number(), z.string()])).optional(),
57
+ p90: z.array(z.union([z.number(), z.string()])).optional(),
58
+ source: ExtractionForecastAnswerSource$inboundSchema.optional(),
59
+ spell_confidence: z.number().optional(),
60
+ steps: z.array(ExtractionForecastStep$inboundSchema).optional(),
61
+ type: z.literal("forecast"),
62
+ value: z.nullable(z.array(z.union([z.number(), z.string()]))),
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ "p_null": "pNull",
66
+ "spell_confidence": "spellConfidence",
67
+ });
68
+ });
69
+ export function extractionForecastAnswerFromJSON(jsonString) {
70
+ return safeParse(jsonString, (x) => ExtractionForecastAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExtractionForecastAnswer' from JSON`);
71
+ }
72
+ //# sourceMappingURL=extractionforecastanswer.js.map
@@ -0,0 +1,90 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ export declare const Interval: {
4
+ readonly Step: "step";
5
+ readonly Minute: "minute";
6
+ readonly Hour: "hour";
7
+ readonly Day: "day";
8
+ readonly Week: "week";
9
+ readonly Month: "month";
10
+ readonly Quarter: "quarter";
11
+ readonly Year: "year";
12
+ };
13
+ export type Interval = OpenEnum<typeof Interval>;
14
+ export type ExtractionForecastFieldMax = number | string;
15
+ export type ExtractionForecastFieldMin = number | string;
16
+ export declare const ExtractionForecastFieldScale: {
17
+ readonly Linear: "linear";
18
+ readonly Log: "log";
19
+ };
20
+ export type ExtractionForecastFieldScale = OpenEnum<typeof ExtractionForecastFieldScale>;
21
+ export declare const ExtractionForecastFieldStepYear: {
22
+ readonly Year: "year";
23
+ };
24
+ export type ExtractionForecastFieldStepYear = ClosedEnum<typeof ExtractionForecastFieldStepYear>;
25
+ export declare const ExtractionForecastFieldStepMonth: {
26
+ readonly Month: "month";
27
+ };
28
+ export type ExtractionForecastFieldStepMonth = ClosedEnum<typeof ExtractionForecastFieldStepMonth>;
29
+ export type ExtractionForecastFieldStepUnion = number | ExtractionForecastFieldStepMonth | ExtractionForecastFieldStepYear;
30
+ export type ExtractionForecastField = {
31
+ /**
32
+ * Number of forecast steps.
33
+ */
34
+ horizon: number;
35
+ /**
36
+ * What the field should contain.
37
+ */
38
+ instructions?: string | undefined;
39
+ interval: Interval;
40
+ max: number | string;
41
+ min: number | string;
42
+ /**
43
+ * Probability of null above which `value` is null. Default 0.5.
44
+ */
45
+ nullThreshold?: number | undefined;
46
+ scale?: ExtractionForecastFieldScale | undefined;
47
+ step?: number | ExtractionForecastFieldStepMonth | ExtractionForecastFieldStepYear | undefined;
48
+ type: "forecast";
49
+ unit?: string | undefined;
50
+ };
51
+ /** @internal */
52
+ export declare const Interval$outboundSchema: z.ZodType<string, Interval>;
53
+ /** @internal */
54
+ export type ExtractionForecastFieldMax$Outbound = number | string;
55
+ /** @internal */
56
+ export declare const ExtractionForecastFieldMax$outboundSchema: z.ZodType<ExtractionForecastFieldMax$Outbound, ExtractionForecastFieldMax>;
57
+ export declare function extractionForecastFieldMaxToJSON(extractionForecastFieldMax: ExtractionForecastFieldMax): string;
58
+ /** @internal */
59
+ export type ExtractionForecastFieldMin$Outbound = number | string;
60
+ /** @internal */
61
+ export declare const ExtractionForecastFieldMin$outboundSchema: z.ZodType<ExtractionForecastFieldMin$Outbound, ExtractionForecastFieldMin>;
62
+ export declare function extractionForecastFieldMinToJSON(extractionForecastFieldMin: ExtractionForecastFieldMin): string;
63
+ /** @internal */
64
+ export declare const ExtractionForecastFieldScale$outboundSchema: z.ZodType<string, ExtractionForecastFieldScale>;
65
+ /** @internal */
66
+ export declare const ExtractionForecastFieldStepYear$outboundSchema: z.ZodEnum<typeof ExtractionForecastFieldStepYear>;
67
+ /** @internal */
68
+ export declare const ExtractionForecastFieldStepMonth$outboundSchema: z.ZodEnum<typeof ExtractionForecastFieldStepMonth>;
69
+ /** @internal */
70
+ export type ExtractionForecastFieldStepUnion$Outbound = number | string | string;
71
+ /** @internal */
72
+ export declare const ExtractionForecastFieldStepUnion$outboundSchema: z.ZodType<ExtractionForecastFieldStepUnion$Outbound, ExtractionForecastFieldStepUnion>;
73
+ export declare function extractionForecastFieldStepUnionToJSON(extractionForecastFieldStepUnion: ExtractionForecastFieldStepUnion): string;
74
+ /** @internal */
75
+ export type ExtractionForecastField$Outbound = {
76
+ horizon: number;
77
+ instructions?: string | undefined;
78
+ interval: string;
79
+ max: number | string;
80
+ min: number | string;
81
+ null_threshold?: number | undefined;
82
+ scale?: string | undefined;
83
+ step?: number | string | string | undefined;
84
+ type: "forecast";
85
+ unit?: string | undefined;
86
+ };
87
+ /** @internal */
88
+ export declare const ExtractionForecastField$outboundSchema: z.ZodType<ExtractionForecastField$Outbound, ExtractionForecastField>;
89
+ export declare function extractionForecastFieldToJSON(extractionForecastField: ExtractionForecastField): string;
90
+ //# sourceMappingURL=extractionforecastfield.d.ts.map
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 25643b9662b3
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 Interval = {
9
+ Step: "step",
10
+ Minute: "minute",
11
+ Hour: "hour",
12
+ Day: "day",
13
+ Week: "week",
14
+ Month: "month",
15
+ Quarter: "quarter",
16
+ Year: "year",
17
+ };
18
+ export const ExtractionForecastFieldScale = {
19
+ Linear: "linear",
20
+ Log: "log",
21
+ };
22
+ export const ExtractionForecastFieldStepYear = {
23
+ Year: "year",
24
+ };
25
+ export const ExtractionForecastFieldStepMonth = {
26
+ Month: "month",
27
+ };
28
+ /** @internal */
29
+ export const Interval$outboundSchema = openEnums
30
+ .outboundSchema(Interval);
31
+ /** @internal */
32
+ export const ExtractionForecastFieldMax$outboundSchema = z.union([z.number(), z.string()]);
33
+ export function extractionForecastFieldMaxToJSON(extractionForecastFieldMax) {
34
+ return JSON.stringify(ExtractionForecastFieldMax$outboundSchema.parse(extractionForecastFieldMax));
35
+ }
36
+ /** @internal */
37
+ export const ExtractionForecastFieldMin$outboundSchema = z.union([z.number(), z.string()]);
38
+ export function extractionForecastFieldMinToJSON(extractionForecastFieldMin) {
39
+ return JSON.stringify(ExtractionForecastFieldMin$outboundSchema.parse(extractionForecastFieldMin));
40
+ }
41
+ /** @internal */
42
+ export const ExtractionForecastFieldScale$outboundSchema = openEnums.outboundSchema(ExtractionForecastFieldScale);
43
+ /** @internal */
44
+ export const ExtractionForecastFieldStepYear$outboundSchema = z.enum(ExtractionForecastFieldStepYear);
45
+ /** @internal */
46
+ export const ExtractionForecastFieldStepMonth$outboundSchema = z.enum(ExtractionForecastFieldStepMonth);
47
+ /** @internal */
48
+ export const ExtractionForecastFieldStepUnion$outboundSchema = z.union([
49
+ z.number(),
50
+ ExtractionForecastFieldStepMonth$outboundSchema,
51
+ ExtractionForecastFieldStepYear$outboundSchema,
52
+ ]);
53
+ export function extractionForecastFieldStepUnionToJSON(extractionForecastFieldStepUnion) {
54
+ return JSON.stringify(ExtractionForecastFieldStepUnion$outboundSchema.parse(extractionForecastFieldStepUnion));
55
+ }
56
+ /** @internal */
57
+ export const ExtractionForecastField$outboundSchema = z.object({
58
+ horizon: z.int(),
59
+ instructions: z.string().optional(),
60
+ interval: Interval$outboundSchema,
61
+ max: z.union([z.number(), z.string()]),
62
+ min: z.union([z.number(), z.string()]),
63
+ nullThreshold: z.number().optional(),
64
+ scale: ExtractionForecastFieldScale$outboundSchema.optional(),
65
+ step: z.union([
66
+ z.number(),
67
+ ExtractionForecastFieldStepMonth$outboundSchema,
68
+ ExtractionForecastFieldStepYear$outboundSchema,
69
+ ]).optional(),
70
+ type: z.literal("forecast"),
71
+ unit: z.string().optional(),
72
+ }).transform((v) => {
73
+ return remap$(v, {
74
+ nullThreshold: "null_threshold",
75
+ });
76
+ });
77
+ export function extractionForecastFieldToJSON(extractionForecastField) {
78
+ return JSON.stringify(ExtractionForecastField$outboundSchema.parse(extractionForecastField));
79
+ }
80
+ //# sourceMappingURL=extractionforecastfield.js.map