@databricks/sdk-aifunctions 0.0.0-beta → 0.5.0

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.
@@ -0,0 +1,317 @@
1
+ import { z } from "zod";
2
+ import { JsonValue } from "@databricks/sdk-core/wkt";
3
+
4
+ //#region src/v1/model.d.ts
5
+ /** ai_classify */
6
+ interface AiClassifyOptions {
7
+ /** Natural-language guidance that steers how the text is classified (up to 20,000 characters). */
8
+ instructions?: string | undefined;
9
+ /** The function version to invoke. Defaults to the latest version. Supported versions: ["2.1"]. */
10
+ version?: string | undefined;
11
+ /** When true, allows more than one label to be returned per input. */
12
+ multilabel?: boolean | undefined;
13
+ /** When true, includes a per-label confidence score in the response. */
14
+ enableConfidenceScores?: boolean | undefined;
15
+ /** When true, includes a rationale explaining each classification in the response. */
16
+ enableRationales?: boolean | undefined;
17
+ }
18
+ interface AiClassifyRequest {
19
+ /** The content to classify. It accepts a plain string or the response object of [ai_parse_document](:method:AiFunctions/AiParseDocument). */
20
+ content?: JsonValue | undefined;
21
+ /** The label set to classify as. Either a JSON array of label strings (e.g. ["spam", "not_spam"]), or a JSON object mapping each label to a description (e.g. {"spam": "unsolicited bulk message", "not_spam": "a legitimate message"}). Accepts 2 to 500 labels, each 1 to 100 characters. */
22
+ labels?: JsonValue | undefined;
23
+ /** Function options. Omitted fields fall back to their documented defaults. */
24
+ options?: AiClassifyOptions | undefined;
25
+ }
26
+ interface AiClassifyResponse {
27
+ /** The function result as a JSON value. An array of per-label objects: one element in single-label mode (the default), or multiple elements when `multilabel` is true. When `enable_confidence_scores` and `enable_rationales` are true, `confidence_score` and `rationale` are included in each response value, respectively. */
28
+ response?: JsonValue | undefined;
29
+ /** Additional metadata returned by AI Classify. */
30
+ metadata?: AiClassifyResponseMetadata | undefined;
31
+ }
32
+ interface AiClassifyResponseMetadata {
33
+ /** The resolved function version. */
34
+ version?: string | undefined;
35
+ }
36
+ /** ai_decide */
37
+ interface AiDecideOptions {
38
+ /** The function API version to invoke. Defaults to "1.0". Supported versions: ["1.0"]. */
39
+ version?: string | undefined;
40
+ }
41
+ interface AiDecideRequest {
42
+ /** A string, JSON object, or array containing the content, related context, and examples needed to answer the provided questions. For example, provide a support message, a conversation, or records describing the current state of an application. All questions receive this same state. */
43
+ state?: JsonValue | undefined;
44
+ /**
45
+ * A JSON object mapping question IDs to their definitions. Choose a nonempty string for each ID; its answer is returned with the same ID in `response.answers`.
46
+ *
47
+ * Each definition is an object with the required fields `type` and `instructions`. The `criteria` field is optional for the type `noul` but is required for the types `choice` and `score`.
48
+ *
49
+ * The `instructions` field describes the judgment to make and can be a string, object, or array. Use an object or array to include supporting context alongside the instructions.
50
+ *
51
+ * The `type` can be one of:
52
+ *
53
+ * - `choice`: Selects one option from a defined set. Requires `criteria` to be an object mapping 1 to 255 nonempty option names to descriptions. The criteria description can be a string, object, array, or null when the name needs no additional detail. For example:
54
+ *
55
+ * ```json
56
+ * {
57
+ * "team": {
58
+ * "type": "choice",
59
+ * "instructions": "Which team should handle this ticket?",
60
+ * "criteria": {
61
+ * "billing": "Payments, charges, and refunds",
62
+ * "technical_support": null
63
+ * }
64
+ * }
65
+ * }
66
+ * ```
67
+ *
68
+ * - `noul`: Estimates the probability that the answer to a true-or-false question is true. `criteria` can take the fields `true` or `false`, or both, with descriptions that are strings, objects, or arrays. Omit `criteria` to use the question alone. For example, both of the following are valid:
69
+ *
70
+ * ```json
71
+ * {
72
+ * "escalate": {
73
+ * "type": "noul",
74
+ * "instructions": "Does this ticket need escalation?",
75
+ * "criteria": {
76
+ * "true": "Suspected fraud or an exception to standard policy",
77
+ * "false": "A routine issue frontline support can resolve"
78
+ * }
79
+ * }
80
+ * }
81
+ * ```
82
+ *
83
+ * or
84
+ *
85
+ * ```json
86
+ * {
87
+ * "escalate": {
88
+ * "type": "noul",
89
+ * "instructions": "Does this ticket need escalation?"
90
+ * }
91
+ * }
92
+ * ```
93
+ *
94
+ * - `score`: Rates the state on an ordered scale. Requires `criteria` to be an array of 2 to 10 level descriptions, ordered from low to high. Descriptions can be strings, objects, or arrays. Array positions define levels starting at 0. For example:
95
+ *
96
+ * ```json
97
+ * {
98
+ * "urgency": {
99
+ * "type": "score",
100
+ * "instructions": "How urgent is this ticket?",
101
+ * "criteria": [
102
+ * "Routine: can wait a few days",
103
+ * "Time-sensitive: needs attention today",
104
+ * "Critical: needs immediate action"
105
+ * ]
106
+ * }
107
+ * }
108
+ * ```
109
+ */
110
+ questions?: JsonValue | undefined;
111
+ /** Function options. Omitted fields fall back to their documented defaults. */
112
+ options?: AiDecideOptions | undefined;
113
+ }
114
+ interface AiDecideResponse {
115
+ /**
116
+ * A JSON object containing an `answers` map with one answer for each question, keyed by the same IDs as `questions`.
117
+ *
118
+ * Each answer has a `type` matching its question and the following fields:
119
+ *
120
+ * - `choice`: choice is the highest-probability option from `criteria`. `probabilities` maps every option name to its probability. `confidence` is a number from 0 to 1 indicating how well the state supports the assessment. The `probabilities` values sum to 1. For example:
121
+ *
122
+ * ```json
123
+ * {
124
+ * "answers": {
125
+ * "team": {
126
+ * "type": "choice",
127
+ * "choice": "billing",
128
+ * "probabilities": {
129
+ * "billing": 0.85,
130
+ * "technical_support": 0.15
131
+ * },
132
+ * "confidence": 0.9
133
+ * }
134
+ * }
135
+ * }
136
+ * ```
137
+ *
138
+ * - `noul`: `probability` is a number from 0 to 1 estimating the probability that the answer is true. For example:
139
+ *
140
+ * ```json
141
+ * {
142
+ * "answers": {
143
+ * "escalate": {
144
+ * "type": "noul",
145
+ * "probability": 0.8
146
+ * }
147
+ * }
148
+ * }
149
+ * ```
150
+ *
151
+ * - `score`: score is the probability-weighted mean of the zero-based level indices. It can fall between levels, from 0 to the number of levels minus 1. `probabilities` maps each level index to its probability, and `legend` maps each index to its original description. Both maps use string keys such as "0", "1", and "2". `confidence` is a number from 0 to 1 indicating how well the state supports the assessment. The `probabilities` values sum to 1. For example:
152
+ *
153
+ * ```json
154
+ * {
155
+ * "answers": {
156
+ * "urgency": {
157
+ * "type": "score",
158
+ * "score": 1.6,
159
+ * "probabilities": {
160
+ * "0": 0.1,
161
+ * "1": 0.2,
162
+ * "2": 0.7
163
+ * },
164
+ * "legend": {
165
+ * "0": "Routine: can wait a few days",
166
+ * "1": "Time-sensitive: needs attention today",
167
+ * "2": "Critical: needs immediate action"
168
+ * },
169
+ * "confidence": 0.85
170
+ * }
171
+ * }
172
+ * }
173
+ * ```
174
+ */
175
+ response?: JsonValue | undefined;
176
+ /** Metadata identifying the function API version used for this request. */
177
+ metadata?: AiDecideResponseMetadata | undefined;
178
+ }
179
+ interface AiDecideResponseMetadata {
180
+ /** The function API version used to evaluate the request. */
181
+ version?: string | undefined;
182
+ }
183
+ /** A bounding box on a source page; used by bbox-input citations. */
184
+ interface AiExtractBbox {
185
+ /** Pixel coordinates on the page image as [x0, y0, x1, y1]. */
186
+ coord?: bigint[] | undefined;
187
+ /** 0-based page index the box is on. */
188
+ pageId?: bigint | undefined;
189
+ }
190
+ /** A citation locating an extracted value in the source. start/stop are set for span (STRING input) citations, bbox for bbox (parsed-document input) citations. */
191
+ interface AiExtractCitation {
192
+ /** Integer matching a citation_ids entry on an extracted field. */
193
+ id?: bigint | undefined;
194
+ /** Inclusive 0-based character offset into the input string; set for span citations. */
195
+ start?: bigint | undefined;
196
+ /** Exclusive 0-based character offset into the input string; set for span citations. */
197
+ stop?: bigint | undefined;
198
+ /** Bounding boxes locating the citation on the source pages; set for bbox citations. */
199
+ bbox?: AiExtractBbox[] | undefined;
200
+ }
201
+ /** ai_extract */
202
+ interface AiExtractOptions {
203
+ /** Natural-language guidance that steers how data is extracted (up to 20,000 characters). */
204
+ instructions?: string | undefined;
205
+ /** The function version to invoke. Defaults to the latest version. Supported versions: ["2.1"]. */
206
+ version?: string | undefined;
207
+ /** Extraction mode. Supported modes: "precision" — more powerful extraction for complex schemas, long documents, and reasoning-heavy extractions. Defaults to none (standard extraction). */
208
+ mode?: string | undefined;
209
+ /**
210
+ * When true, includes citation metadata locating each extracted value in the source. Depending on the type of input, citations can be one of two types:
211
+ *
212
+ * For raw text (STRING) inputs, a citation is a span of text in the original input. Each object in `metadata.citations` has an `id` (integer matching a `citation_ids` entry on a field), a `start` (inclusive 0-based character offset into the input string), and a `stop` (exclusive 0-based character offset into the input string).
213
+ *
214
+ * For PDF documents and images (when using ai_extract downstream of ai_parse_document), a citation is a bounding box in the original input. Each object in `metadata.citations` has an `id` (integer matching a `citation_ids` entry on a field) and a `bbox` (array of {coord, page_id} objects, identical in shape to element.bbox in ai_parse_document output; coord is pixel coordinates on the page image as [x0, y0, x1, y1], and page_id is a 0-based page index).
215
+ */
216
+ enableCitations?: boolean | undefined;
217
+ /** When true, includes a per-field confidence score in the response. */
218
+ enableConfidenceScores?: boolean | undefined;
219
+ }
220
+ interface AiExtractRequest {
221
+ /** The text to extract from. It accepts a plain string or the response object of [ai_parse_document](:method:AiFunctions/AiParseDocument). */
222
+ content?: JsonValue | undefined;
223
+ /** The extraction schema defining the fields to extract. Either a JSON array of field names, assumed to be strings (e.g. ["company", "valuation"]), or a JSON object mapping each field to its type/description/nullability (e.g. {"company": {"type": "string", "description": "the company name"}}). Accepts up to 256 fields, 12 levels of nesting, and 500 enum values. Supported field types are string, integer, number, boolean, and enum. */
224
+ schema?: JsonValue | undefined;
225
+ /** Function options. Omitted fields fall back to their documented defaults. */
226
+ options?: AiExtractOptions | undefined;
227
+ }
228
+ interface AiExtractResponse {
229
+ /** The function result as a JSON value. When `enable_confidence_scores` and `enable_citations` are true, `confidence` and `citation_ids` are included in each response field, respectively. */
230
+ response?: JsonValue | undefined;
231
+ /** Additional metadata returned by AI Extract. */
232
+ metadata?: AiExtractResponseMetadata | undefined;
233
+ }
234
+ interface AiExtractResponseMetadata {
235
+ /** The resolved function version. */
236
+ version?: string | undefined;
237
+ /** The resolved extraction mode; present when a non-default mode was used. */
238
+ mode?: string | undefined;
239
+ /** How the source was chunked for citation offsets (span for text input, bbox for parsed-document input); present when citations are enabled. */
240
+ chunkType?: string | undefined;
241
+ /** Citation objects locating each result in the source; present when citations are enabled. */
242
+ citations?: AiExtractCitation[] | undefined;
243
+ }
244
+ /** Metadata about the source file; present only for file-path input. */
245
+ interface AiParseDocumentFileMetadata {
246
+ /** Unity Catalog volume path of the source file. */
247
+ filePath?: string | undefined;
248
+ /** Base name of the source file. */
249
+ fileName?: string | undefined;
250
+ /** Size of the source file in bytes. */
251
+ fileSize?: bigint | undefined;
252
+ /** Last-modified timestamp of the source file, as an HTTP date string. */
253
+ fileModificationTime?: string | undefined;
254
+ }
255
+ /** ai_parse_document */
256
+ interface AiParseDocumentOptions {
257
+ /** The ai_parse_document output schema version. Supported value: "2.0". */
258
+ version?: string | undefined;
259
+ /** Element types for which an AI-generated description is produced. Use "*" (default) to generate descriptions for all supported element types, "figure" to generate them for figures only, or "" (empty string) to generate none. Only figure descriptions are supported for version "2.0", so "*" and "figure" produce the same behavior. */
260
+ descriptionElementTypes?: string | undefined;
261
+ /** Unity Catalog volume path where rendered page and element images are written. */
262
+ imageOutputPath?: string | undefined;
263
+ /** Pages to parse (1-indexed), as a comma-separated list of page numbers or ranges (e.g. "1,3,5-10"). */
264
+ pageRange?: string | undefined;
265
+ }
266
+ /** A single page that failed to parse while the overall request succeeded. */
267
+ interface AiParseDocumentPageError {
268
+ /** Message describing why the page failed. */
269
+ errorMessage?: string | undefined;
270
+ /** 0-based index of the page that failed. */
271
+ pageId?: bigint | undefined;
272
+ }
273
+ interface AiParseDocumentRequest {
274
+ /** The document to parse, given as a Unity Catalog volume path to the source file (the REST API accepts only a UC volume path, not inline binary data). Supported formats: PDF, DOCX, DOC, PPTX, PPT, JPG, JPEG, PNG, TIFF. Accepts up to 100 pages and 100 MB per document. */
275
+ content?: string | undefined;
276
+ /** Function options. Omitted fields fall back to their documented defaults. */
277
+ options?: AiParseDocumentOptions | undefined;
278
+ }
279
+ interface AiParseDocumentResponse {
280
+ /** The parsed document as a JSON value, containing the extracted pages and elements. */
281
+ document?: JsonValue | undefined;
282
+ /** Per-page partial-failure details; present when the request succeeds (2xx) but individual pages fail. */
283
+ errorStatus?: AiParseDocumentPageError[] | undefined;
284
+ /** Additional metadata returned by AI Parse Document. */
285
+ metadata?: AiParseDocumentResponseMetadata | undefined;
286
+ }
287
+ interface AiParseDocumentResponseMetadata {
288
+ /** Unique identifier for the parse request. */
289
+ id?: string | undefined;
290
+ /** The resolved function version. */
291
+ version?: string | undefined;
292
+ /** Describes the source file; present only for file-path input. */
293
+ fileMetadata?: AiParseDocumentFileMetadata | undefined;
294
+ }
295
+ declare const unmarshalAiClassifyResponseSchema: z.ZodType<AiClassifyResponse>;
296
+ declare const unmarshalAiClassifyResponseMetadataSchema: z.ZodType<AiClassifyResponseMetadata>;
297
+ declare const unmarshalAiDecideResponseSchema: z.ZodType<AiDecideResponse>;
298
+ declare const unmarshalAiDecideResponseMetadataSchema: z.ZodType<AiDecideResponseMetadata>;
299
+ declare const unmarshalAiExtractBboxSchema: z.ZodType<AiExtractBbox>;
300
+ declare const unmarshalAiExtractCitationSchema: z.ZodType<AiExtractCitation>;
301
+ declare const unmarshalAiExtractResponseSchema: z.ZodType<AiExtractResponse>;
302
+ declare const unmarshalAiExtractResponseMetadataSchema: z.ZodType<AiExtractResponseMetadata>;
303
+ declare const unmarshalAiParseDocumentFileMetadataSchema: z.ZodType<AiParseDocumentFileMetadata>;
304
+ declare const unmarshalAiParseDocumentPageErrorSchema: z.ZodType<AiParseDocumentPageError>;
305
+ declare const unmarshalAiParseDocumentResponseSchema: z.ZodType<AiParseDocumentResponse>;
306
+ declare const unmarshalAiParseDocumentResponseMetadataSchema: z.ZodType<AiParseDocumentResponseMetadata>;
307
+ declare const marshalAiClassifyOptionsSchema: z.ZodType;
308
+ declare const marshalAiClassifyRequestSchema: z.ZodType;
309
+ declare const marshalAiDecideOptionsSchema: z.ZodType;
310
+ declare const marshalAiDecideRequestSchema: z.ZodType;
311
+ declare const marshalAiExtractOptionsSchema: z.ZodType;
312
+ declare const marshalAiExtractRequestSchema: z.ZodType;
313
+ declare const marshalAiParseDocumentOptionsSchema: z.ZodType;
314
+ declare const marshalAiParseDocumentRequestSchema: z.ZodType;
315
+ //#endregion
316
+ export { AiClassifyOptions, AiClassifyRequest, AiClassifyResponse, AiClassifyResponseMetadata, AiDecideOptions, AiDecideRequest, AiDecideResponse, AiDecideResponseMetadata, AiExtractBbox, AiExtractCitation, AiExtractOptions, AiExtractRequest, AiExtractResponse, AiExtractResponseMetadata, AiParseDocumentFileMetadata, AiParseDocumentOptions, AiParseDocumentPageError, AiParseDocumentRequest, AiParseDocumentResponse, AiParseDocumentResponseMetadata, marshalAiClassifyOptionsSchema, marshalAiClassifyRequestSchema, marshalAiDecideOptionsSchema, marshalAiDecideRequestSchema, marshalAiExtractOptionsSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentOptionsSchema, marshalAiParseDocumentRequestSchema, unmarshalAiClassifyResponseMetadataSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseMetadataSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractBboxSchema, unmarshalAiExtractCitationSchema, unmarshalAiExtractResponseMetadataSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentFileMetadataSchema, unmarshalAiParseDocumentPageErrorSchema, unmarshalAiParseDocumentResponseMetadataSchema, unmarshalAiParseDocumentResponseSchema };
317
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1/model.ts"],"mappings":";;;;;UAiBiB,iBAAA;EAAA;EAEf,YAAA;;EAEA,OAAA;EAFA;EAIA,UAAA;EAAA;EAEA,sBAAA;EAEA;EAAA,gBAAA;AAAA;AAAA,UAGe,iBAAA;EAAiB;EAEhC,OAAA,GAAU,SAAA;EAAA;EAEV,MAAA,GAAS,SAAA;EAEC;EAAV,OAAA,GAAU,iBAAA;AAAA;AAAA,UAGK,kBAAA;EAPL;EASV,QAAA,GAAW,SAAA;EAPF;EAST,QAAA,GAA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,OAAA,CAAQ,uBAAA;AAAA,cAiBlD,8CAAA,EAAgD,CAAA,CAAE,OAAA,CAAQ,+BAAA;AAAA,cAe1D,8BAAA,EAAgC,CAAA,CAAE,OAAA;AAAA,cAgBlC,8BAAA,EAAgC,CAAA,CAAE,OAAA;AAAA,cAYlC,4BAAA,EAA8B,CAAA,CAAE,OAAA;AAAA,cAQhC,4BAAA,EAA8B,CAAA,CAAE,OAAA;AAAA,cAYhC,6BAAA,EAA+B,CAAA,CAAE,OAAA;AAAA,cAgBjC,6BAAA,EAA+B,CAAA,CAAE,OAAA;AAAA,cAYjC,mCAAA,EAAqC,CAAA,CAAE,OAAA;AAAA,cAcvC,mCAAA,EAAqC,CAAA,CAAE,OAAA"}
@@ -0,0 +1,203 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/v1/model.ts
4
+ const jsonValueSchema = z.lazy(() => z.union([
5
+ z.null(),
6
+ z.number(),
7
+ z.string(),
8
+ z.boolean(),
9
+ z.record(z.string(), jsonValueSchema),
10
+ z.array(jsonValueSchema)
11
+ ]));
12
+ const unmarshalAiClassifyResponseSchema = z.object({
13
+ response: jsonValueSchema.optional(),
14
+ metadata: z.lazy(() => unmarshalAiClassifyResponseMetadataSchema).optional()
15
+ }).transform((d) => ({
16
+ response: d.response,
17
+ metadata: d.metadata
18
+ }));
19
+ const unmarshalAiClassifyResponseMetadataSchema = z.object({ version: z.string().optional() }).transform((d) => ({ version: d.version }));
20
+ const unmarshalAiDecideResponseSchema = z.object({
21
+ response: jsonValueSchema.optional(),
22
+ metadata: z.lazy(() => unmarshalAiDecideResponseMetadataSchema).optional()
23
+ }).transform((d) => ({
24
+ response: d.response,
25
+ metadata: d.metadata
26
+ }));
27
+ const unmarshalAiDecideResponseMetadataSchema = z.object({ version: z.string().optional() }).transform((d) => ({ version: d.version }));
28
+ const unmarshalAiExtractBboxSchema = z.object({
29
+ coord: z.array(z.union([
30
+ z.number(),
31
+ z.bigint(),
32
+ z.string()
33
+ ]).transform((v) => BigInt(v))).optional(),
34
+ page_id: z.union([
35
+ z.number(),
36
+ z.bigint(),
37
+ z.string()
38
+ ]).transform((v) => BigInt(v)).optional()
39
+ }).transform((d) => ({
40
+ coord: d.coord,
41
+ pageId: d.page_id
42
+ }));
43
+ const unmarshalAiExtractCitationSchema = z.object({
44
+ id: z.union([
45
+ z.number(),
46
+ z.bigint(),
47
+ z.string()
48
+ ]).transform((v) => BigInt(v)).optional(),
49
+ start: z.union([
50
+ z.number(),
51
+ z.bigint(),
52
+ z.string()
53
+ ]).transform((v) => BigInt(v)).optional(),
54
+ stop: z.union([
55
+ z.number(),
56
+ z.bigint(),
57
+ z.string()
58
+ ]).transform((v) => BigInt(v)).optional(),
59
+ bbox: z.array(z.lazy(() => unmarshalAiExtractBboxSchema)).optional()
60
+ }).transform((d) => ({
61
+ id: d.id,
62
+ start: d.start,
63
+ stop: d.stop,
64
+ bbox: d.bbox
65
+ }));
66
+ const unmarshalAiExtractResponseSchema = z.object({
67
+ response: jsonValueSchema.optional(),
68
+ metadata: z.lazy(() => unmarshalAiExtractResponseMetadataSchema).optional()
69
+ }).transform((d) => ({
70
+ response: d.response,
71
+ metadata: d.metadata
72
+ }));
73
+ const unmarshalAiExtractResponseMetadataSchema = z.object({
74
+ version: z.string().optional(),
75
+ mode: z.string().optional(),
76
+ chunk_type: z.string().optional(),
77
+ citations: z.array(z.lazy(() => unmarshalAiExtractCitationSchema)).optional()
78
+ }).transform((d) => ({
79
+ version: d.version,
80
+ mode: d.mode,
81
+ chunkType: d.chunk_type,
82
+ citations: d.citations
83
+ }));
84
+ const unmarshalAiParseDocumentFileMetadataSchema = z.object({
85
+ file_path: z.string().optional(),
86
+ file_name: z.string().optional(),
87
+ file_size: z.union([
88
+ z.number(),
89
+ z.bigint(),
90
+ z.string()
91
+ ]).transform((v) => BigInt(v)).optional(),
92
+ file_modification_time: z.string().optional()
93
+ }).transform((d) => ({
94
+ filePath: d.file_path,
95
+ fileName: d.file_name,
96
+ fileSize: d.file_size,
97
+ fileModificationTime: d.file_modification_time
98
+ }));
99
+ const unmarshalAiParseDocumentPageErrorSchema = z.object({
100
+ error_message: z.string().optional(),
101
+ page_id: z.union([
102
+ z.number(),
103
+ z.bigint(),
104
+ z.string()
105
+ ]).transform((v) => BigInt(v)).optional()
106
+ }).transform((d) => ({
107
+ errorMessage: d.error_message,
108
+ pageId: d.page_id
109
+ }));
110
+ const unmarshalAiParseDocumentResponseSchema = z.object({
111
+ document: jsonValueSchema.optional(),
112
+ error_status: z.array(z.lazy(() => unmarshalAiParseDocumentPageErrorSchema)).optional(),
113
+ metadata: z.lazy(() => unmarshalAiParseDocumentResponseMetadataSchema).optional()
114
+ }).transform((d) => ({
115
+ document: d.document,
116
+ errorStatus: d.error_status,
117
+ metadata: d.metadata
118
+ }));
119
+ const unmarshalAiParseDocumentResponseMetadataSchema = z.object({
120
+ id: z.string().optional(),
121
+ version: z.string().optional(),
122
+ file_metadata: z.lazy(() => unmarshalAiParseDocumentFileMetadataSchema).optional()
123
+ }).transform((d) => ({
124
+ id: d.id,
125
+ version: d.version,
126
+ fileMetadata: d.file_metadata
127
+ }));
128
+ const marshalAiClassifyOptionsSchema = z.object({
129
+ instructions: z.string().optional(),
130
+ version: z.string().optional(),
131
+ multilabel: z.boolean().optional(),
132
+ enableConfidenceScores: z.boolean().optional(),
133
+ enableRationales: z.boolean().optional()
134
+ }).transform((d) => ({
135
+ instructions: d.instructions,
136
+ version: d.version,
137
+ multilabel: d.multilabel,
138
+ enable_confidence_scores: d.enableConfidenceScores,
139
+ enable_rationales: d.enableRationales
140
+ }));
141
+ const marshalAiClassifyRequestSchema = z.object({
142
+ content: jsonValueSchema.optional(),
143
+ labels: jsonValueSchema.optional(),
144
+ options: z.lazy(() => marshalAiClassifyOptionsSchema).optional()
145
+ }).transform((d) => ({
146
+ content: d.content,
147
+ labels: d.labels,
148
+ options: d.options
149
+ }));
150
+ const marshalAiDecideOptionsSchema = z.object({ version: z.string().optional() }).transform((d) => ({ version: d.version }));
151
+ const marshalAiDecideRequestSchema = z.object({
152
+ state: jsonValueSchema.optional(),
153
+ questions: jsonValueSchema.optional(),
154
+ options: z.lazy(() => marshalAiDecideOptionsSchema).optional()
155
+ }).transform((d) => ({
156
+ state: d.state,
157
+ questions: d.questions,
158
+ options: d.options
159
+ }));
160
+ const marshalAiExtractOptionsSchema = z.object({
161
+ instructions: z.string().optional(),
162
+ version: z.string().optional(),
163
+ mode: z.string().optional(),
164
+ enableCitations: z.boolean().optional(),
165
+ enableConfidenceScores: z.boolean().optional()
166
+ }).transform((d) => ({
167
+ instructions: d.instructions,
168
+ version: d.version,
169
+ mode: d.mode,
170
+ enable_citations: d.enableCitations,
171
+ enable_confidence_scores: d.enableConfidenceScores
172
+ }));
173
+ const marshalAiExtractRequestSchema = z.object({
174
+ content: jsonValueSchema.optional(),
175
+ schema: jsonValueSchema.optional(),
176
+ options: z.lazy(() => marshalAiExtractOptionsSchema).optional()
177
+ }).transform((d) => ({
178
+ content: d.content,
179
+ schema: d.schema,
180
+ options: d.options
181
+ }));
182
+ const marshalAiParseDocumentOptionsSchema = z.object({
183
+ version: z.string().optional(),
184
+ descriptionElementTypes: z.string().optional(),
185
+ imageOutputPath: z.string().optional(),
186
+ pageRange: z.string().optional()
187
+ }).transform((d) => ({
188
+ version: d.version,
189
+ description_element_types: d.descriptionElementTypes,
190
+ image_output_path: d.imageOutputPath,
191
+ page_range: d.pageRange
192
+ }));
193
+ const marshalAiParseDocumentRequestSchema = z.object({
194
+ content: z.string().optional(),
195
+ options: z.lazy(() => marshalAiParseDocumentOptionsSchema).optional()
196
+ }).transform((d) => ({
197
+ content: d.content,
198
+ options: d.options
199
+ }));
200
+
201
+ //#endregion
202
+ export { marshalAiClassifyOptionsSchema, marshalAiClassifyRequestSchema, marshalAiDecideOptionsSchema, marshalAiDecideRequestSchema, marshalAiExtractOptionsSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentOptionsSchema, marshalAiParseDocumentRequestSchema, unmarshalAiClassifyResponseMetadataSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseMetadataSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractBboxSchema, unmarshalAiExtractCitationSchema, unmarshalAiExtractResponseMetadataSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentFileMetadataSchema, unmarshalAiParseDocumentPageErrorSchema, unmarshalAiParseDocumentResponseMetadataSchema, unmarshalAiParseDocumentResponseSchema };
203
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {JsonValue} from '@databricks/sdk-core/wkt';\nimport {z} from 'zod';\n\nconst jsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>\n z.union([\n z.null(),\n z.number(),\n z.string(),\n z.boolean(),\n z.record(z.string(), jsonValueSchema),\n z.array(jsonValueSchema),\n ])\n);\n\n/** ai_classify */\nexport interface AiClassifyOptions {\n /** Natural-language guidance that steers how the text is classified (up to 20,000 characters). */\n instructions?: string | undefined;\n /** The function version to invoke. Defaults to the latest version. Supported versions: [\"2.1\"]. */\n version?: string | undefined;\n /** When true, allows more than one label to be returned per input. */\n multilabel?: boolean | undefined;\n /** When true, includes a per-label confidence score in the response. */\n enableConfidenceScores?: boolean | undefined;\n /** When true, includes a rationale explaining each classification in the response. */\n enableRationales?: boolean | undefined;\n}\n\nexport interface AiClassifyRequest {\n /** The content to classify. It accepts a plain string or the response object of [ai_parse_document](:method:AiFunctions/AiParseDocument). */\n content?: JsonValue | undefined;\n /** The label set to classify as. Either a JSON array of label strings (e.g. [\"spam\", \"not_spam\"]), or a JSON object mapping each label to a description (e.g. {\"spam\": \"unsolicited bulk message\", \"not_spam\": \"a legitimate message\"}). Accepts 2 to 500 labels, each 1 to 100 characters. */\n labels?: JsonValue | undefined;\n /** Function options. Omitted fields fall back to their documented defaults. */\n options?: AiClassifyOptions | undefined;\n}\n\nexport interface AiClassifyResponse {\n /** The function result as a JSON value. An array of per-label objects: one element in single-label mode (the default), or multiple elements when `multilabel` is true. When `enable_confidence_scores` and `enable_rationales` are true, `confidence_score` and `rationale` are included in each response value, respectively. */\n response?: JsonValue | undefined;\n /** Additional metadata returned by AI Classify. */\n metadata?: AiClassifyResponseMetadata | undefined;\n}\n\nexport interface AiClassifyResponseMetadata {\n /** The resolved function version. */\n version?: string | undefined;\n}\n\n/** ai_decide */\nexport interface AiDecideOptions {\n /** The function API version to invoke. Defaults to \"1.0\". Supported versions: [\"1.0\"]. */\n version?: string | undefined;\n}\n\nexport interface AiDecideRequest {\n /** A string, JSON object, or array containing the content, related context, and examples needed to answer the provided questions. For example, provide a support message, a conversation, or records describing the current state of an application. All questions receive this same state. */\n state?: JsonValue | undefined;\n /**\n * A JSON object mapping question IDs to their definitions. Choose a nonempty string for each ID; its answer is returned with the same ID in `response.answers`.\n *\n * Each definition is an object with the required fields `type` and `instructions`. The `criteria` field is optional for the type `noul` but is required for the types `choice` and `score`.\n *\n * The `instructions` field describes the judgment to make and can be a string, object, or array. Use an object or array to include supporting context alongside the instructions.\n *\n * The `type` can be one of:\n *\n * - `choice`: Selects one option from a defined set. Requires `criteria` to be an object mapping 1 to 255 nonempty option names to descriptions. The criteria description can be a string, object, array, or null when the name needs no additional detail. For example:\n *\n * ```json\n * {\n * \"team\": {\n * \"type\": \"choice\",\n * \"instructions\": \"Which team should handle this ticket?\",\n * \"criteria\": {\n * \"billing\": \"Payments, charges, and refunds\",\n * \"technical_support\": null\n * }\n * }\n * }\n * ```\n *\n * - `noul`: Estimates the probability that the answer to a true-or-false question is true. `criteria` can take the fields `true` or `false`, or both, with descriptions that are strings, objects, or arrays. Omit `criteria` to use the question alone. For example, both of the following are valid:\n *\n * ```json\n * {\n * \"escalate\": {\n * \"type\": \"noul\",\n * \"instructions\": \"Does this ticket need escalation?\",\n * \"criteria\": {\n * \"true\": \"Suspected fraud or an exception to standard policy\",\n * \"false\": \"A routine issue frontline support can resolve\"\n * }\n * }\n * }\n * ```\n *\n * or\n *\n * ```json\n * {\n * \"escalate\": {\n * \"type\": \"noul\",\n * \"instructions\": \"Does this ticket need escalation?\"\n * }\n * }\n * ```\n *\n * - `score`: Rates the state on an ordered scale. Requires `criteria` to be an array of 2 to 10 level descriptions, ordered from low to high. Descriptions can be strings, objects, or arrays. Array positions define levels starting at 0. For example:\n *\n * ```json\n * {\n * \"urgency\": {\n * \"type\": \"score\",\n * \"instructions\": \"How urgent is this ticket?\",\n * \"criteria\": [\n * \"Routine: can wait a few days\",\n * \"Time-sensitive: needs attention today\",\n * \"Critical: needs immediate action\"\n * ]\n * }\n * }\n * ```\n */\n questions?: JsonValue | undefined;\n /** Function options. Omitted fields fall back to their documented defaults. */\n options?: AiDecideOptions | undefined;\n}\n\nexport interface AiDecideResponse {\n /**\n * A JSON object containing an `answers` map with one answer for each question, keyed by the same IDs as `questions`.\n *\n * Each answer has a `type` matching its question and the following fields:\n *\n * - `choice`: choice is the highest-probability option from `criteria`. `probabilities` maps every option name to its probability. `confidence` is a number from 0 to 1 indicating how well the state supports the assessment. The `probabilities` values sum to 1. For example:\n *\n * ```json\n * {\n * \"answers\": {\n * \"team\": {\n * \"type\": \"choice\",\n * \"choice\": \"billing\",\n * \"probabilities\": {\n * \"billing\": 0.85,\n * \"technical_support\": 0.15\n * },\n * \"confidence\": 0.9\n * }\n * }\n * }\n * ```\n *\n * - `noul`: `probability` is a number from 0 to 1 estimating the probability that the answer is true. For example:\n *\n * ```json\n * {\n * \"answers\": {\n * \"escalate\": {\n * \"type\": \"noul\",\n * \"probability\": 0.8\n * }\n * }\n * }\n * ```\n *\n * - `score`: score is the probability-weighted mean of the zero-based level indices. It can fall between levels, from 0 to the number of levels minus 1. `probabilities` maps each level index to its probability, and `legend` maps each index to its original description. Both maps use string keys such as \"0\", \"1\", and \"2\". `confidence` is a number from 0 to 1 indicating how well the state supports the assessment. The `probabilities` values sum to 1. For example:\n *\n * ```json\n * {\n * \"answers\": {\n * \"urgency\": {\n * \"type\": \"score\",\n * \"score\": 1.6,\n * \"probabilities\": {\n * \"0\": 0.1,\n * \"1\": 0.2,\n * \"2\": 0.7\n * },\n * \"legend\": {\n * \"0\": \"Routine: can wait a few days\",\n * \"1\": \"Time-sensitive: needs attention today\",\n * \"2\": \"Critical: needs immediate action\"\n * },\n * \"confidence\": 0.85\n * }\n * }\n * }\n * ```\n */\n response?: JsonValue | undefined;\n /** Metadata identifying the function API version used for this request. */\n metadata?: AiDecideResponseMetadata | undefined;\n}\n\nexport interface AiDecideResponseMetadata {\n /** The function API version used to evaluate the request. */\n version?: string | undefined;\n}\n\n/** A bounding box on a source page; used by bbox-input citations. */\nexport interface AiExtractBbox {\n /** Pixel coordinates on the page image as [x0, y0, x1, y1]. */\n coord?: bigint[] | undefined;\n /** 0-based page index the box is on. */\n pageId?: bigint | undefined;\n}\n\n/** A citation locating an extracted value in the source. start/stop are set for span (STRING input) citations, bbox for bbox (parsed-document input) citations. */\nexport interface AiExtractCitation {\n /** Integer matching a citation_ids entry on an extracted field. */\n id?: bigint | undefined;\n /** Inclusive 0-based character offset into the input string; set for span citations. */\n start?: bigint | undefined;\n /** Exclusive 0-based character offset into the input string; set for span citations. */\n stop?: bigint | undefined;\n /** Bounding boxes locating the citation on the source pages; set for bbox citations. */\n bbox?: AiExtractBbox[] | undefined;\n}\n\n/** ai_extract */\nexport interface AiExtractOptions {\n /** Natural-language guidance that steers how data is extracted (up to 20,000 characters). */\n instructions?: string | undefined;\n /** The function version to invoke. Defaults to the latest version. Supported versions: [\"2.1\"]. */\n version?: string | undefined;\n /** Extraction mode. Supported modes: \"precision\" — more powerful extraction for complex schemas, long documents, and reasoning-heavy extractions. Defaults to none (standard extraction). */\n mode?: string | undefined;\n /**\n * When true, includes citation metadata locating each extracted value in the source. Depending on the type of input, citations can be one of two types:\n *\n * For raw text (STRING) inputs, a citation is a span of text in the original input. Each object in `metadata.citations` has an `id` (integer matching a `citation_ids` entry on a field), a `start` (inclusive 0-based character offset into the input string), and a `stop` (exclusive 0-based character offset into the input string).\n *\n * For PDF documents and images (when using ai_extract downstream of ai_parse_document), a citation is a bounding box in the original input. Each object in `metadata.citations` has an `id` (integer matching a `citation_ids` entry on a field) and a `bbox` (array of {coord, page_id} objects, identical in shape to element.bbox in ai_parse_document output; coord is pixel coordinates on the page image as [x0, y0, x1, y1], and page_id is a 0-based page index).\n */\n enableCitations?: boolean | undefined;\n /** When true, includes a per-field confidence score in the response. */\n enableConfidenceScores?: boolean | undefined;\n}\n\nexport interface AiExtractRequest {\n /** The text to extract from. It accepts a plain string or the response object of [ai_parse_document](:method:AiFunctions/AiParseDocument). */\n content?: JsonValue | undefined;\n /** The extraction schema defining the fields to extract. Either a JSON array of field names, assumed to be strings (e.g. [\"company\", \"valuation\"]), or a JSON object mapping each field to its type/description/nullability (e.g. {\"company\": {\"type\": \"string\", \"description\": \"the company name\"}}). Accepts up to 256 fields, 12 levels of nesting, and 500 enum values. Supported field types are string, integer, number, boolean, and enum. */\n schema?: JsonValue | undefined;\n /** Function options. Omitted fields fall back to their documented defaults. */\n options?: AiExtractOptions | undefined;\n}\n\nexport interface AiExtractResponse {\n /** The function result as a JSON value. When `enable_confidence_scores` and `enable_citations` are true, `confidence` and `citation_ids` are included in each response field, respectively. */\n response?: JsonValue | undefined;\n /** Additional metadata returned by AI Extract. */\n metadata?: AiExtractResponseMetadata | undefined;\n}\n\nexport interface AiExtractResponseMetadata {\n /** The resolved function version. */\n version?: string | undefined;\n /** The resolved extraction mode; present when a non-default mode was used. */\n mode?: string | undefined;\n /** How the source was chunked for citation offsets (span for text input, bbox for parsed-document input); present when citations are enabled. */\n chunkType?: string | undefined;\n /** Citation objects locating each result in the source; present when citations are enabled. */\n citations?: AiExtractCitation[] | undefined;\n}\n\n/** Metadata about the source file; present only for file-path input. */\nexport interface AiParseDocumentFileMetadata {\n /** Unity Catalog volume path of the source file. */\n filePath?: string | undefined;\n /** Base name of the source file. */\n fileName?: string | undefined;\n /** Size of the source file in bytes. */\n fileSize?: bigint | undefined;\n /** Last-modified timestamp of the source file, as an HTTP date string. */\n fileModificationTime?: string | undefined;\n}\n\n/** ai_parse_document */\nexport interface AiParseDocumentOptions {\n /** The ai_parse_document output schema version. Supported value: \"2.0\". */\n version?: string | undefined;\n /** Element types for which an AI-generated description is produced. Use \"*\" (default) to generate descriptions for all supported element types, \"figure\" to generate them for figures only, or \"\" (empty string) to generate none. Only figure descriptions are supported for version \"2.0\", so \"*\" and \"figure\" produce the same behavior. */\n descriptionElementTypes?: string | undefined;\n /** Unity Catalog volume path where rendered page and element images are written. */\n imageOutputPath?: string | undefined;\n /** Pages to parse (1-indexed), as a comma-separated list of page numbers or ranges (e.g. \"1,3,5-10\"). */\n pageRange?: string | undefined;\n}\n\n/** A single page that failed to parse while the overall request succeeded. */\nexport interface AiParseDocumentPageError {\n /** Message describing why the page failed. */\n errorMessage?: string | undefined;\n /** 0-based index of the page that failed. */\n pageId?: bigint | undefined;\n}\n\nexport interface AiParseDocumentRequest {\n /** The document to parse, given as a Unity Catalog volume path to the source file (the REST API accepts only a UC volume path, not inline binary data). Supported formats: PDF, DOCX, DOC, PPTX, PPT, JPG, JPEG, PNG, TIFF. Accepts up to 100 pages and 100 MB per document. */\n content?: string | undefined;\n /** Function options. Omitted fields fall back to their documented defaults. */\n options?: AiParseDocumentOptions | undefined;\n}\n\nexport interface AiParseDocumentResponse {\n /** The parsed document as a JSON value, containing the extracted pages and elements. */\n document?: JsonValue | undefined;\n /** Per-page partial-failure details; present when the request succeeds (2xx) but individual pages fail. */\n errorStatus?: AiParseDocumentPageError[] | undefined;\n /** Additional metadata returned by AI Parse Document. */\n metadata?: AiParseDocumentResponseMetadata | undefined;\n}\n\nexport interface AiParseDocumentResponseMetadata {\n /** Unique identifier for the parse request. */\n id?: string | undefined;\n /** The resolved function version. */\n version?: string | undefined;\n /** Describes the source file; present only for file-path input. */\n fileMetadata?: AiParseDocumentFileMetadata | undefined;\n}\n\nexport const unmarshalAiClassifyResponseSchema: z.ZodType<AiClassifyResponse> =\n z\n .object({\n response: jsonValueSchema.optional(),\n metadata: z\n .lazy(() => unmarshalAiClassifyResponseMetadataSchema)\n .optional(),\n })\n .transform(d => ({\n response: d.response,\n metadata: d.metadata,\n }));\n\nexport const unmarshalAiClassifyResponseMetadataSchema: z.ZodType<AiClassifyResponseMetadata> =\n z\n .object({\n version: z.string().optional(),\n })\n .transform(d => ({\n version: d.version,\n }));\n\nexport const unmarshalAiDecideResponseSchema: z.ZodType<AiDecideResponse> = z\n .object({\n response: jsonValueSchema.optional(),\n metadata: z.lazy(() => unmarshalAiDecideResponseMetadataSchema).optional(),\n })\n .transform(d => ({\n response: d.response,\n metadata: d.metadata,\n }));\n\nexport const unmarshalAiDecideResponseMetadataSchema: z.ZodType<AiDecideResponseMetadata> =\n z\n .object({\n version: z.string().optional(),\n })\n .transform(d => ({\n version: d.version,\n }));\n\nexport const unmarshalAiExtractBboxSchema: z.ZodType<AiExtractBbox> = z\n .object({\n coord: z\n .array(\n z.union([z.number(), z.bigint(), z.string()]).transform(v => BigInt(v))\n )\n .optional(),\n page_id: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n })\n .transform(d => ({\n coord: d.coord,\n pageId: d.page_id,\n }));\n\nexport const unmarshalAiExtractCitationSchema: z.ZodType<AiExtractCitation> = z\n .object({\n id: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n start: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n stop: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n bbox: z.array(z.lazy(() => unmarshalAiExtractBboxSchema)).optional(),\n })\n .transform(d => ({\n id: d.id,\n start: d.start,\n stop: d.stop,\n bbox: d.bbox,\n }));\n\nexport const unmarshalAiExtractResponseSchema: z.ZodType<AiExtractResponse> = z\n .object({\n response: jsonValueSchema.optional(),\n metadata: z.lazy(() => unmarshalAiExtractResponseMetadataSchema).optional(),\n })\n .transform(d => ({\n response: d.response,\n metadata: d.metadata,\n }));\n\nexport const unmarshalAiExtractResponseMetadataSchema: z.ZodType<AiExtractResponseMetadata> =\n z\n .object({\n version: z.string().optional(),\n mode: z.string().optional(),\n chunk_type: z.string().optional(),\n citations: z\n .array(z.lazy(() => unmarshalAiExtractCitationSchema))\n .optional(),\n })\n .transform(d => ({\n version: d.version,\n mode: d.mode,\n chunkType: d.chunk_type,\n citations: d.citations,\n }));\n\nexport const unmarshalAiParseDocumentFileMetadataSchema: z.ZodType<AiParseDocumentFileMetadata> =\n z\n .object({\n file_path: z.string().optional(),\n file_name: z.string().optional(),\n file_size: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n file_modification_time: z.string().optional(),\n })\n .transform(d => ({\n filePath: d.file_path,\n fileName: d.file_name,\n fileSize: d.file_size,\n fileModificationTime: d.file_modification_time,\n }));\n\nexport const unmarshalAiParseDocumentPageErrorSchema: z.ZodType<AiParseDocumentPageError> =\n z\n .object({\n error_message: z.string().optional(),\n page_id: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n })\n .transform(d => ({\n errorMessage: d.error_message,\n pageId: d.page_id,\n }));\n\nexport const unmarshalAiParseDocumentResponseSchema: z.ZodType<AiParseDocumentResponse> =\n z\n .object({\n document: jsonValueSchema.optional(),\n error_status: z\n .array(z.lazy(() => unmarshalAiParseDocumentPageErrorSchema))\n .optional(),\n metadata: z\n .lazy(() => unmarshalAiParseDocumentResponseMetadataSchema)\n .optional(),\n })\n .transform(d => ({\n document: d.document,\n errorStatus: d.error_status,\n metadata: d.metadata,\n }));\n\nexport const unmarshalAiParseDocumentResponseMetadataSchema: z.ZodType<AiParseDocumentResponseMetadata> =\n z\n .object({\n id: z.string().optional(),\n version: z.string().optional(),\n file_metadata: z\n .lazy(() => unmarshalAiParseDocumentFileMetadataSchema)\n .optional(),\n })\n .transform(d => ({\n id: d.id,\n version: d.version,\n fileMetadata: d.file_metadata,\n }));\n\nexport const marshalAiClassifyOptionsSchema: z.ZodType = z\n .object({\n instructions: z.string().optional(),\n version: z.string().optional(),\n multilabel: z.boolean().optional(),\n enableConfidenceScores: z.boolean().optional(),\n enableRationales: z.boolean().optional(),\n })\n .transform(d => ({\n instructions: d.instructions,\n version: d.version,\n multilabel: d.multilabel,\n enable_confidence_scores: d.enableConfidenceScores,\n enable_rationales: d.enableRationales,\n }));\n\nexport const marshalAiClassifyRequestSchema: z.ZodType = z\n .object({\n content: jsonValueSchema.optional(),\n labels: jsonValueSchema.optional(),\n options: z.lazy(() => marshalAiClassifyOptionsSchema).optional(),\n })\n .transform(d => ({\n content: d.content,\n labels: d.labels,\n options: d.options,\n }));\n\nexport const marshalAiDecideOptionsSchema: z.ZodType = z\n .object({\n version: z.string().optional(),\n })\n .transform(d => ({\n version: d.version,\n }));\n\nexport const marshalAiDecideRequestSchema: z.ZodType = z\n .object({\n state: jsonValueSchema.optional(),\n questions: jsonValueSchema.optional(),\n options: z.lazy(() => marshalAiDecideOptionsSchema).optional(),\n })\n .transform(d => ({\n state: d.state,\n questions: d.questions,\n options: d.options,\n }));\n\nexport const marshalAiExtractOptionsSchema: z.ZodType = z\n .object({\n instructions: z.string().optional(),\n version: z.string().optional(),\n mode: z.string().optional(),\n enableCitations: z.boolean().optional(),\n enableConfidenceScores: z.boolean().optional(),\n })\n .transform(d => ({\n instructions: d.instructions,\n version: d.version,\n mode: d.mode,\n enable_citations: d.enableCitations,\n enable_confidence_scores: d.enableConfidenceScores,\n }));\n\nexport const marshalAiExtractRequestSchema: z.ZodType = z\n .object({\n content: jsonValueSchema.optional(),\n schema: jsonValueSchema.optional(),\n options: z.lazy(() => marshalAiExtractOptionsSchema).optional(),\n })\n .transform(d => ({\n content: d.content,\n schema: d.schema,\n options: d.options,\n }));\n\nexport const marshalAiParseDocumentOptionsSchema: z.ZodType = z\n .object({\n version: z.string().optional(),\n descriptionElementTypes: z.string().optional(),\n imageOutputPath: z.string().optional(),\n pageRange: z.string().optional(),\n })\n .transform(d => ({\n version: d.version,\n description_element_types: d.descriptionElementTypes,\n image_output_path: d.imageOutputPath,\n page_range: d.pageRange,\n }));\n\nexport const marshalAiParseDocumentRequestSchema: z.ZodType = z\n .object({\n content: z.string().optional(),\n options: z.lazy(() => marshalAiParseDocumentOptionsSchema).optional(),\n })\n .transform(d => ({\n content: d.content,\n options: d.options,\n }));\n"],"mappings":";;;AAKA,MAAM,kBAAwC,EAAE,WAC9C,EAAE,MAAM;CACN,EAAE,MAAM;CACR,EAAE,QAAQ;CACV,EAAE,QAAQ;CACV,EAAE,SAAS;CACX,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB;CACrC,EAAE,MAAM,gBAAgB;CACzB,CAAC,CACH;AAwTD,MAAa,oCACX,EACG,OAAO;CACN,UAAU,gBAAgB,UAAU;CACpC,UAAU,EACP,WAAW,0CAA0C,CACrD,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,UAAU,EAAE;CACZ,UAAU,EAAE;CACb,EAAE;AAEP,MAAa,4CACX,EACG,OAAO,EACN,SAAS,EAAE,QAAQ,CAAC,UAAU,EAC/B,CAAC,CACD,WAAU,OAAM,EACf,SAAS,EAAE,SACZ,EAAE;AAEP,MAAa,kCAA+D,EACzE,OAAO;CACN,UAAU,gBAAgB,UAAU;CACpC,UAAU,EAAE,WAAW,wCAAwC,CAAC,UAAU;CAC3E,CAAC,CACD,WAAU,OAAM;CACf,UAAU,EAAE;CACZ,UAAU,EAAE;CACb,EAAE;AAEL,MAAa,0CACX,EACG,OAAO,EACN,SAAS,EAAE,QAAQ,CAAC,UAAU,EAC/B,CAAC,CACD,WAAU,OAAM,EACf,SAAS,EAAE,SACZ,EAAE;AAEP,MAAa,+BAAyD,EACnE,OAAO;CACN,OAAO,EACJ,MACC,EAAE,MAAM;EAAC,EAAE,QAAQ;EAAE,EAAE,QAAQ;EAAE,EAAE,Q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E,SAAS,CAAC,UAAU;CAC/C,CAAC,CACD,WAAU,OAAM;CACf,cAAc,EAAE;CAChB,SAAS,EAAE;CACX,MAAM,EAAE;CACR,kBAAkB,EAAE;CACpB,0BAA0B,EAAE;CAC7B,EAAE;AAEL,MAAa,gCAA2C,EACrD,OAAO;CACN,SAAS,gBAAgB,UAAU;CACnC,QAAQ,gBAAgB,UAAU;CAClC,SAAS,EAAE,WAAW,8BAA8B,CAAC,UAAU;CAChE,CAAC,CACD,WAAU,OAAM;CACf,SAAS,EAAE;CACX,QAAQ,EAAE;CACV,SAAS,EAAE;CACZ,EAAE;AAEL,MAAa,sCAAiD,EAC3D,OAAO;CACN,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,yBAAyB,EAAE,QAAQ,CAAC,UAAU;CAC9C,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,WAAW,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC,CACD,WAAU,OAAM;CACf,SAAS,EAAE;CACX,2BAA2B,EAAE;CAC7B,mBAAmB,EAAE;CACrB,YAAY,EAAE;CACf,EAAE;AAEL,MAAa,sCAAiD,EAC3D,OAAO;CACN,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,SAAS,EAAE,WAAW,oCAAoC,CAAC,UAAU;CACtE,CAAC,CACD,WAAU,OAAM;CACf,SAAS,EAAE;CACX,SAAS,EAAE;CACZ,EAAE"}
@@ -0,0 +1,37 @@
1
+ import { HttpClient } from "@databricks/sdk-core/http";
2
+ import { ClientOptions } from "@databricks/sdk-options/client";
3
+
4
+ //#region src/v1/transport.d.ts
5
+ /**
6
+ * The configuration a client needs to issue requests, resolved from
7
+ * {@link ClientOptions} and a configuration profile.
8
+ */
9
+ interface ResolvedClientConfig {
10
+ /** Host with any trailing slash removed. */
11
+ host: string;
12
+ /**
13
+ * Default account ID for account-level paths that contain an account_id
14
+ * segment. A request's own accountId still wins.
15
+ */
16
+ accountId?: string;
17
+ /**
18
+ * Workspace ID used to route workspace-level calls on unified hosts (SPOG).
19
+ */
20
+ workspaceId?: string;
21
+ /** HTTP client with authentication, and any configured timeout, applied. */
22
+ httpClient: HttpClient;
23
+ }
24
+ /**
25
+ * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
26
+ *
27
+ * A configuration profile is always resolved from the config file and
28
+ * environment variables (per options.profileOptions); it supplies host,
29
+ * accountId, workspaceId, and credentials wherever the caller did not set them
30
+ * explicitly. Explicit options always take precedence.
31
+ *
32
+ * @throws if host is neither provided nor present in the resolved profile.
33
+ */
34
+ declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
35
+ //#endregion
36
+ export { ResolvedClientConfig, resolveClientConfig };
37
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;AAkBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAaxB;;EAhBE,WAAA;EAiBS;EAdT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;iBAaQ,mBAAA,CACpB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,oBAAA"}