@databricks/sdk-aifunctions 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "@databricks/sdk-aifunctions";
3
- var version = "0.6.0";
3
+ var version = "0.6.1";
4
4
 
5
5
  //#endregion
6
6
  export { name, version };
@@ -1,4 +1,4 @@
1
- import { AiClassifyRequest, AiClassifyResponse, AiDecideRequest, AiDecideResponse, AiExtractRequest, AiExtractResponse, AiParseDocumentRequest, AiParseDocumentResponse } from "./model.js";
1
+ import { AiClassifyRequest, AiClassifyResponse, AiDecideRequest, AiDecideResponse, AiExtractRequest, AiExtractResponse, AiParseDocumentRequest, AiParseDocumentResponse, Batch, CancelBatchRequest, CancelBatchResponse, CreateBatchRequest, GetBatchRequest, ListBatchesRequest, ListBatchesResponse } from "./model.js";
2
2
  import { CallOptions } from "@databricks/sdk-options/call";
3
3
  import { ClientOptions } from "@databricks/sdk-options/client";
4
4
 
@@ -10,6 +10,15 @@ declare class AiFunctionsClient {
10
10
  private config;
11
11
  constructor(options: ClientOptions);
12
12
  private resolveConfig;
13
+ /** Cancel a batch. Cancellation is asynchronous: requests in flight drain first, so read the batch to observe the `CANCELLING` and `CANCELLED` statuses. */
14
+ cancelBatch(req: CancelBatchRequest, options?: CallOptions): Promise<CancelBatchResponse>;
15
+ /** Run an AI function over every request in a file on a Unity Catalog volume. The batch runs asynchronously; read it to follow its progress. */
16
+ createBatch(req: CreateBatchRequest, options?: CallOptions): Promise<Batch>;
17
+ /** Read one batch, with its status and progress. */
18
+ getBatch(req: GetBatchRequest, options?: CallOptions): Promise<Batch>;
19
+ /** List the batches the caller created in this workspace. */
20
+ listBatches(req: ListBatchesRequest, options?: CallOptions): Promise<ListBatchesResponse>;
21
+ listBatchesIter(req: ListBatchesRequest, options?: CallOptions): AsyncGenerator<Batch>;
13
22
  /** Classifies content according to a set of provided labels. For REST API requests, the default rate limit is 1,200 requests per minute per workspace. Contact your <Databricks> account team to request a higher limit. */
14
23
  aiClassify(req: AiClassifyRequest, options?: CallOptions): Promise<AiClassifyResponse>;
15
24
  /** Turn text and structured data into decisions your application can use. Define questions and criteria to choose an option, estimate a probability, or assign a score given a provided state. */
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cA6Ca,iBAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAQI;EAFN,UAAA,CACJ,GAAA,EAAK,iBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kBAAA;EAAR;EA2BG,QAAA,CACJ,GAAA,EAAK,eAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,gBAAA;EADC;EA4BN,SAAA,CACJ,GAAA,EAAK,gBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,iBAAA;EA9BR;EAyDG,eAAA,CACJ,GAAA,EAAK,sBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,uBAAA;AAAA"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cAyDa,iBAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAQI;EAFN,WAAA,CACJ,GAAA,EAAK,kBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,mBAAA;EAAR;EA2BG,WAAA,CACJ,GAAA,EAAK,kBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,KAAA;EADC;EA4BN,QAAA,CAAS,GAAA,EAAK,eAAA,EAAiB,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,KAAA;EA3BlE;EAqDG,WAAA,CACJ,GAAA,EAAK,kBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,mBAAA;EAkCJ,eAAA,CACL,GAAA,EAAK,kBAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,KAAA;EAlEmD;EAiF/D,UAAA,CACJ,GAAA,EAAK,iBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,kBAAA;EAzDJ;EAoFD,QAAA,CACJ,GAAA,EAAK,eAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,gBAAA;EArFA;EAgHL,SAAA,CACJ,GAAA,EAAK,gBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,iBAAA;EAhFJ;EA2GD,eAAA,CACJ,GAAA,EAAK,sBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,uBAAA;AAAA"}
package/dist/v1/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { resolveClientConfig } from "./transport.js";
2
2
  import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
3
3
  import { name, version } from "../package.js";
4
- import { marshalAiClassifyRequestSchema, marshalAiDecideRequestSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentRequestSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentResponseSchema } from "./model.js";
4
+ import { marshalAiClassifyRequestSchema, marshalAiDecideRequestSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentRequestSchema, marshalBatchSchema, marshalCancelBatchRequestSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentResponseSchema, unmarshalBatchSchema, unmarshalCancelBatchResponseSchema, unmarshalListBatchesResponseSchema } from "./model.js";
5
5
  import { VERSION } from "@databricks/sdk-auth";
6
6
  import { createDefault } from "@databricks/sdk-core/clientinfo";
7
7
  import { NoOpLogger } from "@databricks/sdk-core/logger";
@@ -31,6 +31,98 @@ var AiFunctionsClient = class {
31
31
  this.config ??= resolveClientConfig(this.options);
32
32
  return this.config;
33
33
  }
34
+ /** Cancel a batch. Cancellation is asynchronous: requests in flight drain first, so read the batch to observe the `CANCELLING` and `CANCELLED` statuses. */
35
+ async cancelBatch(req, options) {
36
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
37
+ const url = `${host}/api/2.0/ai-functions/batches/${req.name ?? ""}/cancel`;
38
+ const body = marshalRequest(req, marshalCancelBatchRequestSchema);
39
+ let resp;
40
+ const call = async (callSignal) => {
41
+ const headers = new Headers({ "Content-Type": "application/json" });
42
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
43
+ headers.set("User-Agent", this.userAgent);
44
+ resp = parseResponse(await executeHttpCall({
45
+ request: buildHttpRequest("POST", url, headers, callSignal, body),
46
+ httpClient,
47
+ logger: this.logger
48
+ }), unmarshalCancelBatchResponseSchema);
49
+ };
50
+ await executeCall(call, options);
51
+ if (resp === void 0) throw new Error("operation completed without a result.");
52
+ return resp;
53
+ }
54
+ /** Run an AI function over every request in a file on a Unity Catalog volume. The batch runs asynchronously; read it to follow its progress. */
55
+ async createBatch(req, options) {
56
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
57
+ const url = `${host}/api/2.0/ai-functions/batches`;
58
+ const body = marshalRequest(req.batch, marshalBatchSchema);
59
+ let resp;
60
+ const call = async (callSignal) => {
61
+ const headers = new Headers({ "Content-Type": "application/json" });
62
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
63
+ headers.set("User-Agent", this.userAgent);
64
+ resp = parseResponse(await executeHttpCall({
65
+ request: buildHttpRequest("POST", url, headers, callSignal, body),
66
+ httpClient,
67
+ logger: this.logger
68
+ }), unmarshalBatchSchema);
69
+ };
70
+ await executeCall(call, options);
71
+ if (resp === void 0) throw new Error("operation completed without a result.");
72
+ return resp;
73
+ }
74
+ /** Read one batch, with its status and progress. */
75
+ async getBatch(req, options) {
76
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
77
+ const url = `${host}/api/2.0/ai-functions/batches/${req.name ?? ""}`;
78
+ let resp;
79
+ const call = async (callSignal) => {
80
+ const headers = new Headers();
81
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
82
+ headers.set("User-Agent", this.userAgent);
83
+ resp = parseResponse(await executeHttpCall({
84
+ request: buildHttpRequest("GET", url, headers, callSignal),
85
+ httpClient,
86
+ logger: this.logger
87
+ }), unmarshalBatchSchema);
88
+ };
89
+ await executeCall(call, options);
90
+ if (resp === void 0) throw new Error("operation completed without a result.");
91
+ return resp;
92
+ }
93
+ /** List the batches the caller created in this workspace. */
94
+ async listBatches(req, options) {
95
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
96
+ const url = `${host}/api/2.0/ai-functions/batches`;
97
+ const params = new URLSearchParams();
98
+ if (req.pageSize !== void 0) params.append("page_size", String(req.pageSize));
99
+ if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
100
+ const query = params.toString();
101
+ const fullUrl = query !== "" ? `${url}?${query}` : url;
102
+ let resp;
103
+ const call = async (callSignal) => {
104
+ const headers = new Headers();
105
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
106
+ headers.set("User-Agent", this.userAgent);
107
+ resp = parseResponse(await executeHttpCall({
108
+ request: buildHttpRequest("GET", fullUrl, headers, callSignal),
109
+ httpClient,
110
+ logger: this.logger
111
+ }), unmarshalListBatchesResponseSchema);
112
+ };
113
+ await executeCall(call, options);
114
+ if (resp === void 0) throw new Error("operation completed without a result.");
115
+ return resp;
116
+ }
117
+ async *listBatchesIter(req, options) {
118
+ const pageReq = { ...req };
119
+ for (;;) {
120
+ const resp = await this.listBatches(pageReq, options);
121
+ for (const item of resp.batches ?? []) yield item;
122
+ if (resp.nextPageToken === void 0 || resp.nextPageToken === "") return;
123
+ pageReq.pageToken = resp.nextPageToken;
124
+ }
125
+ }
34
126
  /** Classifies content according to a set of provided labels. For REST API requests, the default rate limit is 1,200 requests per minute per workspace. Contact your <Databricks> account team to request a higher limit. */
35
127
  async aiClassify(req, options) {
36
128
  const { host, workspaceId, httpClient } = await this.resolveConfig();
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n AiClassifyRequest,\n AiClassifyResponse,\n AiDecideRequest,\n AiDecideResponse,\n AiExtractRequest,\n AiExtractResponse,\n AiParseDocumentRequest,\n AiParseDocumentResponse,\n} from './model';\nimport {\n marshalAiClassifyRequestSchema,\n marshalAiDecideRequestSchema,\n marshalAiExtractRequestSchema,\n marshalAiParseDocumentRequestSchema,\n unmarshalAiClassifyResponseSchema,\n unmarshalAiDecideResponseSchema,\n unmarshalAiExtractResponseSchema,\n unmarshalAiParseDocumentResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class AiFunctionsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /** Classifies content according to a set of provided labels. For REST API requests, the default rate limit is 1,200 requests per minute per workspace. Contact your <Databricks> account team to request a higher limit. */\n async aiClassify(\n req: AiClassifyRequest,\n options?: CallOptions\n ): Promise<AiClassifyResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-classify`;\n const body = marshalRequest(req, marshalAiClassifyRequestSchema);\n let resp: AiClassifyResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiClassifyResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Turn text and structured data into decisions your application can use. Define questions and criteria to choose an option, estimate a probability, or assign a score given a provided state. */\n async aiDecide(\n req: AiDecideRequest,\n options?: CallOptions\n ): Promise<AiDecideResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-decide`;\n const body = marshalRequest(req, marshalAiDecideRequestSchema);\n let resp: AiDecideResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiDecideResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Extracts structured data from text and documents according to a provided schema. For REST API requests, the default rate limit is 120 requests per minute per workspace. Contact your <Databricks> account team to request a higher limit. */\n async aiExtract(\n req: AiExtractRequest,\n options?: CallOptions\n ): Promise<AiExtractResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-extract`;\n const body = marshalRequest(req, marshalAiExtractRequestSchema);\n let resp: AiExtractResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiExtractResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Parse structured content from unstructured documents. */\n async aiParseDocument(\n req: AiParseDocumentRequest,\n options?: CallOptions\n ): Promise<AiParseDocumentResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-parse-document`;\n const body = marshalRequest(req, marshalAiParseDocumentRequestSchema);\n let resp: AiParseDocumentResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiParseDocumentResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AAwCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,oBAAb,MAA+B;CAC7B,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ,aAAa,MAAM,IAAI;GAAU,CAAC,CACjD,UAAU;;CAGlC,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,QAAQ;AACjD,SAAO,KAAK;;;CAId,MAAM,WACJ,KACA,SAC6B;EAC7B,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,MAAM,OAAO,eAAe,KAAK,+BAA+B;EAChE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,c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Fc,iBAAiB,QAAQ,KAAK,SAAS,YAAY,KAAK;IAGtE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,iCAAiC;;AAElE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,gBACJ,KACA,SACkC;EAClC,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,MAAM,OAAO,eAAe,KAAK,oCAAoC;EACrE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,QAAQ,KAAK,SAAS,YAAY,KAAK;IAGtE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,uCAAuC;;AAExE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
1
+ {"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n AiClassifyRequest,\n AiClassifyResponse,\n AiDecideRequest,\n AiDecideResponse,\n AiExtractRequest,\n AiExtractResponse,\n AiParseDocumentRequest,\n AiParseDocumentResponse,\n Batch,\n CancelBatchRequest,\n CancelBatchResponse,\n CreateBatchRequest,\n GetBatchRequest,\n ListBatchesRequest,\n ListBatchesResponse,\n} from './model';\nimport {\n marshalAiClassifyRequestSchema,\n marshalAiDecideRequestSchema,\n marshalAiExtractRequestSchema,\n marshalAiParseDocumentRequestSchema,\n marshalBatchSchema,\n marshalCancelBatchRequestSchema,\n unmarshalAiClassifyResponseSchema,\n unmarshalAiDecideResponseSchema,\n unmarshalAiExtractResponseSchema,\n unmarshalAiParseDocumentResponseSchema,\n unmarshalBatchSchema,\n unmarshalCancelBatchResponseSchema,\n unmarshalListBatchesResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class AiFunctionsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /** Cancel a batch. Cancellation is asynchronous: requests in flight drain first, so read the batch to observe the `CANCELLING` and `CANCELLED` statuses. */\n async cancelBatch(\n req: CancelBatchRequest,\n options?: CallOptions\n ): Promise<CancelBatchResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/batches/${req.name ?? ''}/cancel`;\n const body = marshalRequest(req, marshalCancelBatchRequestSchema);\n let resp: CancelBatchResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalCancelBatchResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Run an AI function over every request in a file on a Unity Catalog volume. The batch runs asynchronously; read it to follow its progress. */\n async createBatch(\n req: CreateBatchRequest,\n options?: CallOptions\n ): Promise<Batch> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/batches`;\n const body = marshalRequest(req.batch, marshalBatchSchema);\n let resp: Batch | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalBatchSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Read one batch, with its status and progress. */\n async getBatch(req: GetBatchRequest, options?: CallOptions): Promise<Batch> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/batches/${req.name ?? ''}`;\n let resp: Batch | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalBatchSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** List the batches the caller created in this workspace. */\n async listBatches(\n req: ListBatchesRequest,\n options?: CallOptions\n ): Promise<ListBatchesResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/batches`;\n const params = new URLSearchParams();\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListBatchesResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalListBatchesResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listBatchesIter(\n req: ListBatchesRequest,\n options?: CallOptions\n ): AsyncGenerator<Batch> {\n const pageReq: ListBatchesRequest = {...req};\n for (;;) {\n const resp = await this.listBatches(pageReq, options);\n for (const item of resp.batches ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Classifies content according to a set of provided labels. For REST API requests, the default rate limit is 1,200 requests per minute per workspace. Contact your <Databricks> account team to request a higher limit. */\n async aiClassify(\n req: AiClassifyRequest,\n options?: CallOptions\n ): Promise<AiClassifyResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-classify`;\n const body = marshalRequest(req, marshalAiClassifyRequestSchema);\n let resp: AiClassifyResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiClassifyResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Turn text and structured data into decisions your application can use. Define questions and criteria to choose an option, estimate a probability, or assign a score given a provided state. */\n async aiDecide(\n req: AiDecideRequest,\n options?: CallOptions\n ): Promise<AiDecideResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-decide`;\n const body = marshalRequest(req, marshalAiDecideRequestSchema);\n let resp: AiDecideResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiDecideResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Extracts structured data from text and documents according to a provided schema. For REST API requests, the default rate limit is 120 requests per minute per workspace. Contact your <Databricks> account team to request a higher limit. */\n async aiExtract(\n req: AiExtractRequest,\n options?: CallOptions\n ): Promise<AiExtractResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-extract`;\n const body = marshalRequest(req, marshalAiExtractRequestSchema);\n let resp: AiExtractResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiExtractResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Parse structured content from unstructured documents. */\n async aiParseDocument(\n req: AiParseDocumentRequest,\n options?: CallOptions\n ): Promise<AiParseDocumentResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/ai-functions/ai-parse-document`;\n const body = marshalRequest(req, marshalAiParseDocumentRequestSchema);\n let resp: AiParseDocumentResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAiParseDocumentResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n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AAQ,KAAK;IACd,CAAC,EAC6B,iCAAiC;;AAElE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,gBACJ,KACA,SACkC;EAClC,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,MAAM,OAAO,eAAe,KAAK,oCAAoC;EACrE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,QAAQ,KAAK,SAAS,YAAY,KAAK;IAGtE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,uCAAuC;;AAExE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
@@ -1,3 +1,3 @@
1
- import { AiClassifyOptions, AiClassifyRequest, AiClassifyResponse, AiClassifyResponseMetadata, AiDecideOptions, AiDecideRequest, AiDecideResponse, AiDecideResponseMetadata, AiExtractBbox, AiExtractCitation, AiExtractOptions, AiExtractRequest, AiExtractResponse, AiExtractResponseMetadata, AiParseDocumentFileMetadata, AiParseDocumentOptions, AiParseDocumentPageError, AiParseDocumentRequest, AiParseDocumentResponse, AiParseDocumentResponseMetadata } from "./model.js";
1
+ import { AiClassifyOptions, AiClassifyRequest, AiClassifyResponse, AiClassifyResponseMetadata, AiDecideOptions, AiDecideRequest, AiDecideResponse, AiDecideResponseMetadata, AiExtractBbox, AiExtractCitation, AiExtractOptions, AiExtractRequest, AiExtractResponse, AiExtractResponseMetadata, AiParseDocumentFileMetadata, AiParseDocumentOptions, AiParseDocumentPageError, AiParseDocumentRequest, AiParseDocumentResponse, AiParseDocumentResponseMetadata, Batch, BatchRequestCounts, BatchStatus, CancelBatchRequest, CancelBatchResponse, CreateBatchRequest, GetBatchRequest, ListBatchesRequest, ListBatchesResponse } from "./model.js";
2
2
  import { AiFunctionsClient } from "./client.js";
3
- export { type AiClassifyOptions, type AiClassifyRequest, type AiClassifyResponse, type AiClassifyResponseMetadata, type AiDecideOptions, type AiDecideRequest, type AiDecideResponse, type AiDecideResponseMetadata, type AiExtractBbox, type AiExtractCitation, type AiExtractOptions, type AiExtractRequest, type AiExtractResponse, type AiExtractResponseMetadata, AiFunctionsClient, type AiParseDocumentFileMetadata, type AiParseDocumentOptions, type AiParseDocumentPageError, type AiParseDocumentRequest, type AiParseDocumentResponse, type AiParseDocumentResponseMetadata };
3
+ export { type AiClassifyOptions, type AiClassifyRequest, type AiClassifyResponse, type AiClassifyResponseMetadata, type AiDecideOptions, type AiDecideRequest, type AiDecideResponse, type AiDecideResponseMetadata, type AiExtractBbox, type AiExtractCitation, type AiExtractOptions, type AiExtractRequest, type AiExtractResponse, type AiExtractResponseMetadata, AiFunctionsClient, type AiParseDocumentFileMetadata, type AiParseDocumentOptions, type AiParseDocumentPageError, type AiParseDocumentRequest, type AiParseDocumentResponse, type AiParseDocumentResponseMetadata, type Batch, type BatchRequestCounts, BatchStatus, type CancelBatchRequest, type CancelBatchResponse, type CreateBatchRequest, type GetBatchRequest, type ListBatchesRequest, type ListBatchesResponse };
package/dist/v1/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { BatchStatus } from "./model.js";
1
2
  import { AiFunctionsClient } from "./client.js";
2
3
 
3
- export { AiFunctionsClient };
4
+ export { AiFunctionsClient, BatchStatus };
@@ -1,7 +1,21 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
1
2
  import { z } from "zod";
2
- import { JsonValue } from "@databricks/sdk-core/wkt";
3
+ import { JsonObject, JsonValue } from "@databricks/sdk-core/wkt";
3
4
 
4
5
  //#region src/v1/model.d.ts
6
+ /** The status of a batch. */
7
+ declare const BatchStatus: {
8
+ readonly BATCH_STATUS_UNSPECIFIED: "BATCH_STATUS_UNSPECIFIED"; /** Accepted, not started yet. */
9
+ readonly PENDING: "PENDING"; /** Requests are being processed. */
10
+ readonly IN_PROGRESS: "IN_PROGRESS"; /** Every request is processed and the output file is being written. */
11
+ readonly FINALIZING: "FINALIZING"; /** The output is written and available. */
12
+ readonly COMPLETED: "COMPLETED"; /** The completion window elapsed. The output holds the requests that finished in time. */
13
+ readonly EXPIRED: "EXPIRED"; /** Cancellation was accepted and requests in flight are draining. */
14
+ readonly CANCELLING: "CANCELLING"; /** Cancellation finished. No output file is written. */
15
+ readonly CANCELLED: "CANCELLED"; /** The batch failed. */
16
+ readonly FAILED: "FAILED";
17
+ };
18
+ type BatchStatus = (typeof BatchStatus)[keyof typeof BatchStatus] | (string & {});
5
19
  /** ai_classify */
6
20
  interface AiClassifyOptions {
7
21
  /** Natural-language guidance that steers how the text is classified (up to 20,000 characters). */
@@ -292,6 +306,68 @@ interface AiParseDocumentResponseMetadata {
292
306
  /** Describes the source file; present only for file-path input. */
293
307
  fileMetadata?: AiParseDocumentFileMetadata | undefined;
294
308
  }
309
+ /** An asynchronous run of one AI function over a file of requests. */
310
+ interface Batch {
311
+ /** ID of the batch, in the form `batch_<id>`. The service assigns it. */
312
+ name?: string | undefined;
313
+ /** The AI function to run for every request, for example `ai_extract`. */
314
+ endpoint?: string | undefined;
315
+ /** Path of the JSONL input file on a Unity Catalog volume. Each line is one request. */
316
+ inputRef?: string | undefined;
317
+ /** Function options applied to every request in the batch, for example the extraction schema. */
318
+ params?: JsonObject | undefined;
319
+ /**
320
+ * Path on a Unity Catalog volume to write the JSONL output to. When it is omitted, the output
321
+ * stays on Databricks-managed storage and a finished batch returns a short-lived download URL
322
+ * in this field instead.
323
+ */
324
+ outputRef?: string | undefined;
325
+ /** Output only. Status of the batch. */
326
+ status?: BatchStatus | undefined;
327
+ /** Output only. Time the batch was created. */
328
+ createTime?: Temporal.Instant | undefined;
329
+ /** Output only. Request counts. Returned when one batch is read, not when batches are listed. */
330
+ requestCounts?: BatchRequestCounts | undefined;
331
+ /**
332
+ * Output only. Percentage of the requests that finished, from 0 to 100. Returned when one batch
333
+ * is read, not when batches are listed.
334
+ */
335
+ percentComplete?: number | undefined;
336
+ }
337
+ /** Counts of the requests in a batch. */
338
+ interface BatchRequestCounts {
339
+ /** Output only. Number of requests in the input file. */
340
+ total?: bigint | undefined;
341
+ /** Output only. Number of requests that finished successfully. */
342
+ succeeded?: bigint | undefined;
343
+ /** Output only. Number of requests that failed and will not be retried. */
344
+ failed?: bigint | undefined;
345
+ }
346
+ interface CancelBatchRequest {
347
+ /** ID of the batch, in the form `batch_<id>`. */
348
+ name?: string | undefined;
349
+ }
350
+ interface CancelBatchResponse {}
351
+ interface CreateBatchRequest {
352
+ /** The batch to create. */
353
+ batch?: Batch | undefined;
354
+ }
355
+ interface GetBatchRequest {
356
+ /** ID of the batch, in the form `batch_<id>`. */
357
+ name?: string | undefined;
358
+ }
359
+ interface ListBatchesRequest {
360
+ /** Maximum number of batches to return in one page. */
361
+ pageSize?: number | undefined;
362
+ /** Page token from an earlier response. Omit it to read the first page. */
363
+ pageToken?: string | undefined;
364
+ }
365
+ interface ListBatchesResponse {
366
+ /** The batches in this page. */
367
+ batches?: Batch[] | undefined;
368
+ /** Token that reads the next page. It is empty on the last page. */
369
+ nextPageToken?: string | undefined;
370
+ }
295
371
  declare const unmarshalAiClassifyResponseSchema: z.ZodType<AiClassifyResponse>;
296
372
  declare const unmarshalAiClassifyResponseMetadataSchema: z.ZodType<AiClassifyResponseMetadata>;
297
373
  declare const unmarshalAiDecideResponseSchema: z.ZodType<AiDecideResponse>;
@@ -304,6 +380,10 @@ declare const unmarshalAiParseDocumentFileMetadataSchema: z.ZodType<AiParseDocum
304
380
  declare const unmarshalAiParseDocumentPageErrorSchema: z.ZodType<AiParseDocumentPageError>;
305
381
  declare const unmarshalAiParseDocumentResponseSchema: z.ZodType<AiParseDocumentResponse>;
306
382
  declare const unmarshalAiParseDocumentResponseMetadataSchema: z.ZodType<AiParseDocumentResponseMetadata>;
383
+ declare const unmarshalBatchSchema: z.ZodType<Batch>;
384
+ declare const unmarshalBatchRequestCountsSchema: z.ZodType<BatchRequestCounts>;
385
+ declare const unmarshalCancelBatchResponseSchema: z.ZodType<CancelBatchResponse>;
386
+ declare const unmarshalListBatchesResponseSchema: z.ZodType<ListBatchesResponse>;
307
387
  declare const marshalAiClassifyOptionsSchema: z.ZodType;
308
388
  declare const marshalAiClassifyRequestSchema: z.ZodType;
309
389
  declare const marshalAiDecideOptionsSchema: z.ZodType;
@@ -312,6 +392,9 @@ declare const marshalAiExtractOptionsSchema: z.ZodType;
312
392
  declare const marshalAiExtractRequestSchema: z.ZodType;
313
393
  declare const marshalAiParseDocumentOptionsSchema: z.ZodType;
314
394
  declare const marshalAiParseDocumentRequestSchema: z.ZodType;
395
+ declare const marshalBatchSchema: z.ZodType;
396
+ declare const marshalBatchRequestCountsSchema: z.ZodType;
397
+ declare const marshalCancelBatchRequestSchema: z.ZodType;
315
398
  //#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 };
399
+ export { AiClassifyOptions, AiClassifyRequest, AiClassifyResponse, AiClassifyResponseMetadata, AiDecideOptions, AiDecideRequest, AiDecideResponse, AiDecideResponseMetadata, AiExtractBbox, AiExtractCitation, AiExtractOptions, AiExtractRequest, AiExtractResponse, AiExtractResponseMetadata, AiParseDocumentFileMetadata, AiParseDocumentOptions, AiParseDocumentPageError, AiParseDocumentRequest, AiParseDocumentResponse, AiParseDocumentResponseMetadata, Batch, BatchRequestCounts, BatchStatus, CancelBatchRequest, CancelBatchResponse, CreateBatchRequest, GetBatchRequest, ListBatchesRequest, ListBatchesResponse, marshalAiClassifyOptionsSchema, marshalAiClassifyRequestSchema, marshalAiDecideOptionsSchema, marshalAiDecideRequestSchema, marshalAiExtractOptionsSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentOptionsSchema, marshalAiParseDocumentRequestSchema, marshalBatchRequestCountsSchema, marshalBatchSchema, marshalCancelBatchRequestSchema, unmarshalAiClassifyResponseMetadataSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseMetadataSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractBboxSchema, unmarshalAiExtractCitationSchema, unmarshalAiExtractResponseMetadataSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentFileMetadataSchema, unmarshalAiParseDocumentPageErrorSchema, unmarshalAiParseDocumentResponseMetadataSchema, unmarshalAiParseDocumentResponseSchema, unmarshalBatchRequestCountsSchema, unmarshalBatchSchema, unmarshalCancelBatchResponseSchema, unmarshalListBatchesResponseSchema };
317
400
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1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+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;AAAA,cAUvC,kBAAA,EAAoB,CAAA,CAAE,OAAA;AAAA,cA2BtB,+BAAA,EAAiC,CAAA,CAAE,OAAA;AAAA,cAYnC,+BAAA,EAAiC,CAAA,CAAE,OAAA"}
package/dist/v1/model.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
1
2
  import { z } from "zod";
2
3
 
3
4
  //#region src/v1/model.ts
@@ -9,6 +10,19 @@ const jsonValueSchema = z.lazy(() => z.union([
9
10
  z.record(z.string(), jsonValueSchema),
10
11
  z.array(jsonValueSchema)
11
12
  ]));
13
+ const jsonObjectSchema = z.record(z.string(), jsonValueSchema);
14
+ /** The status of a batch. */
15
+ const BatchStatus = {
16
+ BATCH_STATUS_UNSPECIFIED: "BATCH_STATUS_UNSPECIFIED",
17
+ PENDING: "PENDING",
18
+ IN_PROGRESS: "IN_PROGRESS",
19
+ FINALIZING: "FINALIZING",
20
+ COMPLETED: "COMPLETED",
21
+ EXPIRED: "EXPIRED",
22
+ CANCELLING: "CANCELLING",
23
+ CANCELLED: "CANCELLED",
24
+ FAILED: "FAILED"
25
+ };
12
26
  const unmarshalAiClassifyResponseSchema = z.object({
13
27
  response: jsonValueSchema.optional(),
14
28
  metadata: z.lazy(() => unmarshalAiClassifyResponseMetadataSchema).optional()
@@ -125,6 +139,56 @@ const unmarshalAiParseDocumentResponseMetadataSchema = z.object({
125
139
  version: d.version,
126
140
  fileMetadata: d.file_metadata
127
141
  }));
142
+ const unmarshalBatchSchema = z.object({
143
+ name: z.string().optional(),
144
+ endpoint: z.string().optional(),
145
+ input_ref: z.string().optional(),
146
+ params: jsonObjectSchema.optional(),
147
+ output_ref: z.string().optional(),
148
+ status: z.string().optional(),
149
+ create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
150
+ request_counts: z.lazy(() => unmarshalBatchRequestCountsSchema).optional(),
151
+ percent_complete: z.number().optional()
152
+ }).transform((d) => ({
153
+ name: d.name,
154
+ endpoint: d.endpoint,
155
+ inputRef: d.input_ref,
156
+ params: d.params,
157
+ outputRef: d.output_ref,
158
+ status: d.status,
159
+ createTime: d.create_time,
160
+ requestCounts: d.request_counts,
161
+ percentComplete: d.percent_complete
162
+ }));
163
+ const unmarshalBatchRequestCountsSchema = z.object({
164
+ total: z.union([
165
+ z.number(),
166
+ z.bigint(),
167
+ z.string()
168
+ ]).transform((v) => BigInt(v)).optional(),
169
+ succeeded: z.union([
170
+ z.number(),
171
+ z.bigint(),
172
+ z.string()
173
+ ]).transform((v) => BigInt(v)).optional(),
174
+ failed: z.union([
175
+ z.number(),
176
+ z.bigint(),
177
+ z.string()
178
+ ]).transform((v) => BigInt(v)).optional()
179
+ }).transform((d) => ({
180
+ total: d.total,
181
+ succeeded: d.succeeded,
182
+ failed: d.failed
183
+ }));
184
+ const unmarshalCancelBatchResponseSchema = z.object({});
185
+ const unmarshalListBatchesResponseSchema = z.object({
186
+ batches: z.array(z.lazy(() => unmarshalBatchSchema)).optional(),
187
+ next_page_token: z.string().optional()
188
+ }).transform((d) => ({
189
+ batches: d.batches,
190
+ nextPageToken: d.next_page_token
191
+ }));
128
192
  const marshalAiClassifyOptionsSchema = z.object({
129
193
  instructions: z.string().optional(),
130
194
  version: z.string().optional(),
@@ -197,7 +261,38 @@ const marshalAiParseDocumentRequestSchema = z.object({
197
261
  content: d.content,
198
262
  options: d.options
199
263
  }));
264
+ const marshalBatchSchema = z.object({
265
+ name: z.string().optional(),
266
+ endpoint: z.string().optional(),
267
+ inputRef: z.string().optional(),
268
+ params: jsonObjectSchema.optional(),
269
+ outputRef: z.string().optional(),
270
+ status: z.string().optional(),
271
+ createTime: z.any().transform((d) => d.toString()).optional(),
272
+ requestCounts: z.lazy(() => marshalBatchRequestCountsSchema).optional(),
273
+ percentComplete: z.number().optional()
274
+ }).transform((d) => ({
275
+ name: d.name,
276
+ endpoint: d.endpoint,
277
+ input_ref: d.inputRef,
278
+ params: d.params,
279
+ output_ref: d.outputRef,
280
+ status: d.status,
281
+ create_time: d.createTime,
282
+ request_counts: d.requestCounts,
283
+ percent_complete: d.percentComplete
284
+ }));
285
+ const marshalBatchRequestCountsSchema = z.object({
286
+ total: z.bigint().optional(),
287
+ succeeded: z.bigint().optional(),
288
+ failed: z.bigint().optional()
289
+ }).transform((d) => ({
290
+ total: d.total,
291
+ succeeded: d.succeeded,
292
+ failed: d.failed
293
+ }));
294
+ const marshalCancelBatchRequestSchema = z.object({ name: z.string().optional() }).transform((d) => ({ name: d.name }));
200
295
 
201
296
  //#endregion
202
- export { marshalAiClassifyOptionsSchema, marshalAiClassifyRequestSchema, marshalAiDecideOptionsSchema, marshalAiDecideRequestSchema, marshalAiExtractOptionsSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentOptionsSchema, marshalAiParseDocumentRequestSchema, unmarshalAiClassifyResponseMetadataSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseMetadataSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractBboxSchema, unmarshalAiExtractCitationSchema, unmarshalAiExtractResponseMetadataSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentFileMetadataSchema, unmarshalAiParseDocumentPageErrorSchema, unmarshalAiParseDocumentResponseMetadataSchema, unmarshalAiParseDocumentResponseSchema };
297
+ export { BatchStatus, marshalAiClassifyOptionsSchema, marshalAiClassifyRequestSchema, marshalAiDecideOptionsSchema, marshalAiDecideRequestSchema, marshalAiExtractOptionsSchema, marshalAiExtractRequestSchema, marshalAiParseDocumentOptionsSchema, marshalAiParseDocumentRequestSchema, marshalBatchRequestCountsSchema, marshalBatchSchema, marshalCancelBatchRequestSchema, unmarshalAiClassifyResponseMetadataSchema, unmarshalAiClassifyResponseSchema, unmarshalAiDecideResponseMetadataSchema, unmarshalAiDecideResponseSchema, unmarshalAiExtractBboxSchema, unmarshalAiExtractCitationSchema, unmarshalAiExtractResponseMetadataSchema, unmarshalAiExtractResponseSchema, unmarshalAiParseDocumentFileMetadataSchema, unmarshalAiParseDocumentPageErrorSchema, unmarshalAiParseDocumentResponseMetadataSchema, unmarshalAiParseDocumentResponseSchema, unmarshalBatchRequestCountsSchema, unmarshalBatchSchema, unmarshalCancelBatchResponseSchema, unmarshalListBatchesResponseSchema };
203
298
  //# sourceMappingURL=model.js.map
@@ -1 +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. Each ID must contain non-whitespace text; 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. The instructions or at least one criteria description must contain non-whitespace text, a nonempty object, or a nonempty array. 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 must contain non-whitespace text, a nonempty object, or a nonempty array. 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. The REST API accepts a Unity Catalog volume path to the source file or a base64 data URL containing the file bytes (for example, data:application/pdf;base64,<encoded-file-bytes> or data:image/jpeg;base64,<encoded-file-bytes>). 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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AU;CACnC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,iBAAiB,EAAE,SAAS,CAAC,UAAU;CACvC,wBAAwB,EAAE,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"}
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 {Temporal} from '@js-temporal/polyfill';\nimport type {JsonValue, JsonObject} 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);\nconst jsonObjectSchema: z.ZodType<JsonObject> = z.record(\n z.string(),\n jsonValueSchema\n);\n\n/** The status of a batch. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const BatchStatus = {\n BATCH_STATUS_UNSPECIFIED: 'BATCH_STATUS_UNSPECIFIED',\n /** Accepted, not started yet. */\n PENDING: 'PENDING',\n /** Requests are being processed. */\n IN_PROGRESS: 'IN_PROGRESS',\n /** Every request is processed and the output file is being written. */\n FINALIZING: 'FINALIZING',\n /** The output is written and available. */\n COMPLETED: 'COMPLETED',\n /** The completion window elapsed. The output holds the requests that finished in time. */\n EXPIRED: 'EXPIRED',\n /** Cancellation was accepted and requests in flight are draining. */\n CANCELLING: 'CANCELLING',\n /** Cancellation finished. No output file is written. */\n CANCELLED: 'CANCELLED',\n /** The batch failed. */\n FAILED: 'FAILED',\n} as const;\nexport type BatchStatus =\n | (typeof BatchStatus)[keyof typeof BatchStatus]\n | (string & {});\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. Each ID must contain non-whitespace text; 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. The instructions or at least one criteria description must contain non-whitespace text, a nonempty object, or a nonempty array. 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 must contain non-whitespace text, a nonempty object, or a nonempty array. 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. The REST API accepts a Unity Catalog volume path to the source file or a base64 data URL containing the file bytes (for example, data:application/pdf;base64,<encoded-file-bytes> or data:image/jpeg;base64,<encoded-file-bytes>). 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\n/** An asynchronous run of one AI function over a file of requests. */\nexport interface Batch {\n /** ID of the batch, in the form `batch_<id>`. The service assigns it. */\n name?: string | undefined;\n /** The AI function to run for every request, for example `ai_extract`. */\n endpoint?: string | undefined;\n /** Path of the JSONL input file on a Unity Catalog volume. Each line is one request. */\n inputRef?: string | undefined;\n /** Function options applied to every request in the batch, for example the extraction schema. */\n params?: JsonObject | undefined;\n /**\n * Path on a Unity Catalog volume to write the JSONL output to. When it is omitted, the output\n * stays on Databricks-managed storage and a finished batch returns a short-lived download URL\n * in this field instead.\n */\n outputRef?: string | undefined;\n /** Output only. Status of the batch. */\n status?: BatchStatus | undefined;\n /** Output only. Time the batch was created. */\n createTime?: Temporal.Instant | undefined;\n /** Output only. Request counts. Returned when one batch is read, not when batches are listed. */\n requestCounts?: BatchRequestCounts | undefined;\n /**\n * Output only. Percentage of the requests that finished, from 0 to 100. Returned when one batch\n * is read, not when batches are listed.\n */\n percentComplete?: number | undefined;\n}\n\n/** Counts of the requests in a batch. */\nexport interface BatchRequestCounts {\n /** Output only. Number of requests in the input file. */\n total?: bigint | undefined;\n /** Output only. Number of requests that finished successfully. */\n succeeded?: bigint | undefined;\n /** Output only. Number of requests that failed and will not be retried. */\n failed?: bigint | undefined;\n}\n\nexport interface CancelBatchRequest {\n /** ID of the batch, in the form `batch_<id>`. */\n name?: string | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CancelBatchResponse {}\n\nexport interface CreateBatchRequest {\n /** The batch to create. */\n batch?: Batch | undefined;\n}\n\nexport interface GetBatchRequest {\n /** ID of the batch, in the form `batch_<id>`. */\n name?: string | undefined;\n}\n\nexport interface ListBatchesRequest {\n /** Maximum number of batches to return in one page. */\n pageSize?: number | undefined;\n /** Page token from an earlier response. Omit it to read the first page. */\n pageToken?: string | undefined;\n}\n\nexport interface ListBatchesResponse {\n /** The batches in this page. */\n batches?: Batch[] | undefined;\n /** Token that reads the next page. It is empty on the last page. */\n nextPageToken?: string | 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 unmarshalBatchSchema: z.ZodType<Batch> = z\n .object({\n name: z.string().optional(),\n endpoint: z.string().optional(),\n input_ref: z.string().optional(),\n params: jsonObjectSchema.optional(),\n output_ref: z.string().optional(),\n status: z.string().optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n request_counts: z.lazy(() => unmarshalBatchRequestCountsSchema).optional(),\n percent_complete: z.number().optional(),\n })\n .transform(d => ({\n name: d.name,\n endpoint: d.endpoint,\n inputRef: d.input_ref,\n params: d.params,\n outputRef: d.output_ref,\n status: d.status,\n createTime: d.create_time,\n requestCounts: d.request_counts,\n percentComplete: d.percent_complete,\n }));\n\nexport const unmarshalBatchRequestCountsSchema: z.ZodType<BatchRequestCounts> =\n z\n .object({\n total: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n succeeded: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n failed: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n })\n .transform(d => ({\n total: d.total,\n succeeded: d.succeeded,\n failed: d.failed,\n }));\n\nexport const unmarshalCancelBatchResponseSchema: z.ZodType<CancelBatchResponse> =\n z.object({});\n\nexport const unmarshalListBatchesResponseSchema: z.ZodType<ListBatchesResponse> =\n z\n .object({\n batches: z.array(z.lazy(() => unmarshalBatchSchema)).optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n batches: d.batches,\n nextPageToken: d.next_page_token,\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\nexport const marshalBatchSchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n endpoint: z.string().optional(),\n inputRef: z.string().optional(),\n params: jsonObjectSchema.optional(),\n outputRef: z.string().optional(),\n status: z.string().optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n requestCounts: z.lazy(() => marshalBatchRequestCountsSchema).optional(),\n percentComplete: z.number().optional(),\n })\n .transform(d => ({\n name: d.name,\n endpoint: d.endpoint,\n input_ref: d.inputRef,\n params: d.params,\n output_ref: d.outputRef,\n status: d.status,\n create_time: d.createTime,\n request_counts: d.requestCounts,\n percent_complete: d.percentComplete,\n }));\n\nexport const marshalBatchRequestCountsSchema: z.ZodType = z\n .object({\n total: z.bigint().optional(),\n succeeded: z.bigint().optional(),\n failed: z.bigint().optional(),\n })\n .transform(d => ({\n total: d.total,\n succeeded: d.succeeded,\n failed: d.failed,\n }));\n\nexport const marshalCancelBatchRequestSchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n })\n .transform(d => ({\n name: d.name,\n }));\n"],"mappings":";;;;AAMA,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;AACD,MAAM,mBAA0C,EAAE,OAChD,EAAE,QAAQ,EACV,gBACD;;AAID,MAAa,cAAc;CACzB,0BAA0B;CAE1B,SAAS;CAET,aAAa;CAEb,YA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AA6C,EACvD,OAAO;CACN,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC9B,CAAC,CACD,WAAU,OAAM;CACf,OAAO,EAAE;CACT,WAAW,EAAE;CACb,QAAQ,EAAE;CACX,EAAE;AAEL,MAAa,kCAA6C,EACvD,OAAO,EACN,MAAM,EAAE,QAAQ,CAAC,UAAU,EAC5B,CAAC,CACD,WAAU,OAAM,EACf,MAAM,EAAE,MACT,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databricks/sdk-aifunctions",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {