@databricks/sdk-modelservingquery 0.0.0-dev → 0.1.0-dev.2

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/LICENSE ADDED
@@ -0,0 +1,203 @@
1
+ Copyright 2026 Databricks, Inc. All rights reserved.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright [yyyy] [name of copyright owner]
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
@@ -0,0 +1,14 @@
1
+ import type { CallOptions } from '@databricks/sdk-options/call';
2
+ import type { ClientOptions } from '@databricks/sdk-options/client';
3
+ import type { QueryEndpointInputRequest, QueryEndpointResponse } from './model';
4
+ export declare class ModelServingQueryClient {
5
+ private readonly host;
6
+ private readonly workspaceId;
7
+ private readonly httpClient;
8
+ private readonly logger;
9
+ private readonly userAgent;
10
+ constructor(options: ClientOptions);
11
+ /** Query a serving endpoint */
12
+ query(req: QueryEndpointInputRequest, options?: CallOptions): Promise<QueryEndpointResponse>;
13
+ }
14
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAWlE,OAAO,KAAK,EAAC,yBAAyB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAY9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAI9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAIhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,aAAa;IAelC,+BAA+B;IACzB,KAAK,CACT,GAAG,EAAE,yBAAyB,EAC9B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,qBAAqB,CAAC;CAwBlC"}
@@ -0,0 +1,66 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+ import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
3
+ import { createDefault } from '@databricks/sdk-core/clientinfo';
4
+ import { NoOpLogger } from '@databricks/sdk-core/logger';
5
+ import { newHttpClient } from './transport';
6
+ import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
7
+ import pkgJson from '../../package.json' with { type: 'json' };
8
+ import { marshalQueryEndpointInputRequestSchema, unmarshalQueryEndpointResponseSchema, } from './model';
9
+ // Package identity segment for this client to be used in the User-Agent header.
10
+ const PACKAGE_SEGMENT = {
11
+ key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
12
+ value: pkgJson.version,
13
+ };
14
+ export class ModelServingQueryClient {
15
+ host;
16
+ // Workspace ID used to route workspace-level calls on unified hosts (SPOG).
17
+ // When set, workspace-level methods send X-Databricks-Org-Id on every
18
+ // request.
19
+ workspaceId;
20
+ httpClient;
21
+ logger;
22
+ // User-Agent header value. Composed once at construction from
23
+ // createDefault() merged with this package's identity and the active
24
+ // credential's name.
25
+ userAgent;
26
+ constructor(options) {
27
+ if (options.host === undefined) {
28
+ throw new Error('Host is required.');
29
+ }
30
+ this.host = options.host.replace(/\/$/, '');
31
+ this.workspaceId = options.workspaceId;
32
+ this.logger = options.logger ?? new NoOpLogger();
33
+ const info = createDefault()
34
+ .with(PACKAGE_SEGMENT)
35
+ .with({ key: 'sdk-js-auth', value: AUTH_VERSION })
36
+ .with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
37
+ this.userAgent = info.toString();
38
+ this.httpClient = newHttpClient(options);
39
+ }
40
+ /** Query a serving endpoint */
41
+ async query(req, options) {
42
+ const url = `${this.host}/api/serving-endpoints/${req.name ?? ''}/invocations`;
43
+ const body = marshalRequest(req, marshalQueryEndpointInputRequestSchema);
44
+ let resp;
45
+ const call = async (callSignal) => {
46
+ const headers = new Headers({ 'Content-Type': 'application/json' });
47
+ if (this.workspaceId !== undefined) {
48
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
49
+ }
50
+ headers.set('User-Agent', this.userAgent);
51
+ const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
52
+ const respBody = await executeHttpCall({
53
+ request: httpReq,
54
+ httpClient: this.httpClient,
55
+ logger: this.logger,
56
+ });
57
+ resp = parseResponse(respBody, unmarshalQueryEndpointResponseSchema);
58
+ };
59
+ await executeCall(call, options);
60
+ if (resp === undefined) {
61
+ throw new Error('operation completed without a result.');
62
+ }
63
+ return resp;
64
+ }
65
+ }
66
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,OAAO,MAAM,oBAAoB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAE7D,OAAO,EACL,sCAAsC,EACtC,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,gFAAgF;AAChF,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAC1D,KAAK,EAAE,OAAO,CAAC,OAAO;CACvB,CAAC;AAEF,MAAM,OAAO,uBAAuB;IACj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KAAK,EAAE,UAAwB,EAAiB,EAAE;YAC7D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAC,cAAc,EAAE,kBAAkB,EAAC,CAAC,CAAC;YAClE,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACvD,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;YACzE,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC;gBACrC,OAAO,EAAE,OAAO;gBAChB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,oCAAoC,CAAC,CAAC;QACvE,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { ModelServingQueryClient } from './client';
2
+ export { ChatMessageRole, EmbeddingsV1ResponseEmbeddingElementObject, QueryEndpointResponseObject, } from './model';
3
+ export type { ChatMessage, DataframeSplitInput, EmbeddingsV1ResponseEmbeddingElement, ExternalModelUsageElement, QueryEndpointInputRequest, QueryEndpointInputRequest_ExtraParamsEntry, QueryEndpointInputRequest_UsageContextEntry, QueryEndpointResponse, V1ResponseChoiceElement, } from './model';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;AAEjD,OAAO,EACL,eAAe,EACf,0CAA0C,EAC1C,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,oCAAoC,EACpC,yBAAyB,EACzB,yBAAyB,EACzB,0CAA0C,EAC1C,2CAA2C,EAC3C,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+ export { ModelServingQueryClient } from './client';
3
+ export { ChatMessageRole, EmbeddingsV1ResponseEmbeddingElementObject, QueryEndpointResponseObject, } from './model';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;AAEjD,OAAO,EACL,eAAe,EACf,0CAA0C,EAC1C,2BAA2B,GAC5B,MAAM,SAAS,CAAC"}
@@ -0,0 +1,178 @@
1
+ import type { JsonValue } from '@databricks/sdk-core/wkt';
2
+ import { z } from 'zod';
3
+ /** The role of the message. One of [system, user, assistant]. */
4
+ export declare enum ChatMessageRole {
5
+ CHAT_MESSAGE_ROLE_UNSPECIFIED = "CHAT_MESSAGE_ROLE_UNSPECIFIED",
6
+ SYSTEM = "system",
7
+ USER = "user",
8
+ ASSISTANT = "assistant"
9
+ }
10
+ /** This will always be 'embedding'. */
11
+ export declare enum EmbeddingsV1ResponseEmbeddingElementObject {
12
+ EMBEDDINGS_V1_RESPONSE_EMBEDDING_ELEMENT_OBJECT_UNSPECIFIED = "EMBEDDINGS_V1_RESPONSE_EMBEDDING_ELEMENT_OBJECT_UNSPECIFIED",
13
+ EMBEDDING = "embedding"
14
+ }
15
+ /**
16
+ * The type of object returned by the __external/foundation model__ serving endpoint, one of
17
+ * [text_completion, chat.completion, list (of embeddings)].
18
+ */
19
+ export declare enum QueryEndpointResponseObject {
20
+ QUERY_ENDPOINT_RESPONSE_OBJECT_UNSPECIFIED = "QUERY_ENDPOINT_RESPONSE_OBJECT_UNSPECIFIED",
21
+ TEXT_COMPLETION = "text_completion",
22
+ CHAT_COMPLETION = "chat.completion",
23
+ LIST = "list"
24
+ }
25
+ export interface ChatMessage {
26
+ /** The role of the message. One of [system, user, assistant]. */
27
+ role?: ChatMessageRole | undefined;
28
+ /** The content of the message. */
29
+ content?: string | undefined;
30
+ }
31
+ export interface DataframeSplitInput {
32
+ /** Index array for the dataframe */
33
+ index?: number[] | undefined;
34
+ /** Columns array for the dataframe */
35
+ columns?: JsonValue[] | undefined;
36
+ /** Data array for the dataframe */
37
+ data?: JsonValue[] | undefined;
38
+ }
39
+ export interface EmbeddingsV1ResponseEmbeddingElement {
40
+ /** The embedding vector */
41
+ embedding?: number[] | undefined;
42
+ /** The index of the embedding in the response. */
43
+ index?: number | undefined;
44
+ /** This will always be 'embedding'. */
45
+ object?: EmbeddingsV1ResponseEmbeddingElementObject | undefined;
46
+ }
47
+ export interface ExternalModelUsageElement {
48
+ /** The number of tokens in the prompt. */
49
+ promptTokens?: number | undefined;
50
+ /** The number of tokens in the chat/completions response. */
51
+ completionTokens?: number | undefined;
52
+ /** The total number of tokens in the prompt and response. */
53
+ totalTokens?: number | undefined;
54
+ }
55
+ export interface QueryEndpointInputRequest {
56
+ /** The name of the serving endpoint. This field is required and is provided via the path parameter. */
57
+ name?: string | undefined;
58
+ /**
59
+ * The prompt string (or array of strings) field used ONLY for __completions external & foundation model__
60
+ * serving endpoints and should only be used with other completions query fields.
61
+ */
62
+ prompt?: JsonValue | undefined;
63
+ /**
64
+ * The input string (or array of strings) field used ONLY for __embeddings external & foundation model__
65
+ * serving endpoints and is the only field (along with extra_params if needed) used by embeddings queries.
66
+ */
67
+ input?: JsonValue | undefined;
68
+ /**
69
+ * The messages field used ONLY for __chat external & foundation model__ serving endpoints.
70
+ * This is an array of ChatMessage objects and should only be used with other chat query fields.
71
+ */
72
+ messages?: ChatMessage[] | undefined;
73
+ /**
74
+ * The temperature field used ONLY for __completions__ and __chat external & foundation model__ serving
75
+ * endpoints. This is a float between 0.0 and 2.0 with a default of 1.0 and should only be used with other
76
+ * chat/completions query fields.
77
+ */
78
+ temperature?: number | undefined;
79
+ /**
80
+ * The stop sequences field used ONLY for __completions__ and __chat external & foundation model__ serving
81
+ * endpoints. This is a list of strings and should only be used with other chat/completions query fields.
82
+ */
83
+ stop?: string[] | undefined;
84
+ /**
85
+ * The max tokens field used ONLY for __completions__ and __chat external & foundation model__ serving
86
+ * endpoints. This is an integer and should only be used with other chat/completions query fields.
87
+ */
88
+ maxTokens?: number | undefined;
89
+ /**
90
+ * The n (number of candidates) field used ONLY for __completions__ and __chat external & foundation model__
91
+ * serving endpoints. This is an integer between 1 and 5 with a default of 1 and should only be used with
92
+ * other chat/completions query fields.
93
+ */
94
+ n?: number | undefined;
95
+ /**
96
+ * The stream field used ONLY for __completions__ and __chat external & foundation model__ serving endpoints.
97
+ * This is a boolean defaulting to false and should only be used with other chat/completions query fields.
98
+ */
99
+ stream?: boolean | undefined;
100
+ /**
101
+ * The extra parameters field used ONLY for __completions, chat,__ and __embeddings external & foundation
102
+ * model__ serving endpoints. This is a map of strings and should only be used with other external/foundation
103
+ * model query fields.
104
+ */
105
+ extraParams?: Record<string, string> | undefined;
106
+ /** Pandas Dataframe input in the records orientation. */
107
+ dataframeRecords?: JsonValue[] | undefined;
108
+ /** Pandas Dataframe input in the split orientation. */
109
+ dataframeSplit?: DataframeSplitInput | undefined;
110
+ /** Tensor-based input in row format. */
111
+ instances?: JsonValue[] | undefined;
112
+ /** Tensor-based input in columnar format. */
113
+ inputs?: JsonValue | undefined;
114
+ /** Optional user-provided request identifier that will be recorded in the inference table and the usage tracking table. */
115
+ clientRequestId?: string | undefined;
116
+ /** Optional user-provided context that will be recorded in the usage tracking table. */
117
+ usageContext?: Record<string, string> | undefined;
118
+ }
119
+ export interface QueryEndpointInputRequest_ExtraParamsEntry {
120
+ key?: string | undefined;
121
+ value?: string | undefined;
122
+ }
123
+ export interface QueryEndpointInputRequest_UsageContextEntry {
124
+ key?: string | undefined;
125
+ value?: string | undefined;
126
+ }
127
+ export interface QueryEndpointResponse {
128
+ /** The list of choices returned by the __chat or completions external/foundation model__ serving endpoint. */
129
+ choices?: V1ResponseChoiceElement[] | undefined;
130
+ /** The list of the embeddings returned by the __embeddings external/foundation model__ serving endpoint. */
131
+ data?: EmbeddingsV1ResponseEmbeddingElement[] | undefined;
132
+ /**
133
+ * The name of the __external/foundation model__ used for querying. This is the name of the model that was
134
+ * specified in the endpoint config.
135
+ */
136
+ model?: string | undefined;
137
+ /**
138
+ * The usage object that may be returned by the __external/foundation model__ serving endpoint. This
139
+ * contains information about the number of tokens used in the prompt and response.
140
+ */
141
+ usage?: ExternalModelUsageElement | undefined;
142
+ /** The ID of the query that may be returned by a __completions or chat external/foundation model__ serving endpoint. */
143
+ id?: string | undefined;
144
+ /** The timestamp in seconds when the query was created in Unix time returned by a __completions or chat external/foundation model__ serving endpoint. */
145
+ created?: bigint | undefined;
146
+ /**
147
+ * The type of object returned by the __external/foundation model__ serving endpoint, one of
148
+ * [text_completion, chat.completion, list (of embeddings)].
149
+ */
150
+ object?: QueryEndpointResponseObject | undefined;
151
+ /** The predictions returned by the serving endpoint. */
152
+ predictions?: JsonValue[] | undefined;
153
+ /** The outputs of the feature serving endpoint. */
154
+ outputs?: JsonValue[] | undefined;
155
+ /** The name of the served model that served the request. This is useful when there are multiple models behind the same endpoint with traffic split. */
156
+ servedModelName?: string | undefined;
157
+ }
158
+ export interface V1ResponseChoiceElement {
159
+ /** The text response from the __completions__ endpoint. */
160
+ text?: string | undefined;
161
+ /** The message response from the __chat__ endpoint. */
162
+ message?: ChatMessage | undefined;
163
+ /** The index of the choice in the __chat or completions__ response. */
164
+ index?: number | undefined;
165
+ /** The finish reason returned by the endpoint. */
166
+ finishReason?: string | undefined;
167
+ /** The logprobs returned only by the __completions__ endpoint. */
168
+ logprobs?: number | undefined;
169
+ }
170
+ export declare const unmarshalChatMessageSchema: z.ZodType<ChatMessage>;
171
+ export declare const unmarshalEmbeddingsV1ResponseEmbeddingElementSchema: z.ZodType<EmbeddingsV1ResponseEmbeddingElement>;
172
+ export declare const unmarshalExternalModelUsageElementSchema: z.ZodType<ExternalModelUsageElement>;
173
+ export declare const unmarshalQueryEndpointResponseSchema: z.ZodType<QueryEndpointResponse>;
174
+ export declare const unmarshalV1ResponseChoiceElementSchema: z.ZodType<V1ResponseChoiceElement>;
175
+ export declare const marshalChatMessageSchema: z.ZodType;
176
+ export declare const marshalDataframeSplitInputSchema: z.ZodType;
177
+ export declare const marshalQueryEndpointInputRequestSchema: z.ZodType;
178
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAatB,iEAAiE;AACjE,oBAAY,eAAe;IACzB,6BAA6B,kCAAkC;IAC/D,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED,uCAAuC;AACvC,oBAAY,0CAA0C;IACpD,2DAA2D,gEAAgE;IAC3H,SAAS,cAAc;CACxB;AAED;;;GAGG;AACH,oBAAY,2BAA2B;IACrC,0CAA0C,+CAA+C;IACzF,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,IAAI,SAAS;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,IAAI,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC,kCAAkC;IAClC,OAAO,CAAC,EAA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