@databricks/sdk-modelserving 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 +203 -0
- package/dist/v1/client.d.ts +101 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +708 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +4 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +4 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +1087 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +1424 -0
- package/dist/v1/model.js.map +1 -0
- package/dist/v1/transport.d.ts +5 -0
- package/dist/v1/transport.d.ts.map +1 -0
- package/dist/v1/transport.js +57 -0
- package/dist/v1/transport.js.map +1 -0
- package/dist/v1/utils.d.ts +40 -0
- package/dist/v1/utils.d.ts.map +1 -0
- package/dist/v1/utils.js +160 -0
- package/dist/v1/utils.js.map +1 -0
- package/package.json +38 -4
- package/src/v1/client.ts +955 -0
- package/src/v1/index.ts +92 -0
- package/src/v1/model.ts +2589 -0
- package/src/v1/transport.ts +73 -0
- package/src/v1/utils.ts +215 -0
- package/README.md +0 -1
- package/index.js +0 -1
package/src/v1/model.ts
ADDED
|
@@ -0,0 +1,2589 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import {z} from 'zod';
|
|
4
|
+
|
|
5
|
+
export enum Behavior {
|
|
6
|
+
BEHAVIOR_UNSPECIFIED = 'BEHAVIOR_UNSPECIFIED',
|
|
7
|
+
NONE = 'NONE',
|
|
8
|
+
BLOCK = 'BLOCK',
|
|
9
|
+
MASK = 'MASK',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum ServedModelDeploymentState {
|
|
13
|
+
DEPLOYMENT_UNKNOWN = 'DEPLOYMENT_UNKNOWN',
|
|
14
|
+
DEPLOYMENT_CREATING = 'DEPLOYMENT_CREATING',
|
|
15
|
+
DEPLOYMENT_RECOVERING = 'DEPLOYMENT_RECOVERING',
|
|
16
|
+
DEPLOYMENT_READY = 'DEPLOYMENT_READY',
|
|
17
|
+
DEPLOYMENT_FAILED = 'DEPLOYMENT_FAILED',
|
|
18
|
+
DEPLOYMENT_ABORTED = 'DEPLOYMENT_ABORTED',
|
|
19
|
+
DEPLOYMENT_STOPPED = 'DEPLOYMENT_STOPPED',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum ServingEndpointDetailedPermissionLevel {
|
|
23
|
+
CAN_MANAGE = 'CAN_MANAGE',
|
|
24
|
+
CAN_QUERY = 'CAN_QUERY',
|
|
25
|
+
CAN_VIEW = 'CAN_VIEW',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
|
|
29
|
+
export enum ExternalFunctionRequest_HttpMethod {
|
|
30
|
+
HTTP_METHOD_UNSPECIFIED = 'HTTP_METHOD_UNSPECIFIED',
|
|
31
|
+
GET = 'GET',
|
|
32
|
+
POST = 'POST',
|
|
33
|
+
PUT = 'PUT',
|
|
34
|
+
DELETE = 'DELETE',
|
|
35
|
+
PATCH = 'PATCH',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
|
|
39
|
+
export enum InferenceEndpointState_ConfigUpdateState {
|
|
40
|
+
CONFIG_UPDATE_STATE_UNSPECIFIED = 'CONFIG_UPDATE_STATE_UNSPECIFIED',
|
|
41
|
+
NOT_UPDATING = 'NOT_UPDATING',
|
|
42
|
+
IN_PROGRESS = 'IN_PROGRESS',
|
|
43
|
+
UPDATE_FAILED = 'UPDATE_FAILED',
|
|
44
|
+
UPDATE_CANCELED = 'UPDATE_CANCELED',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
|
|
48
|
+
export enum InferenceEndpointState_ReadyState {
|
|
49
|
+
READY_STATE_UNSPECIFIED = 'READY_STATE_UNSPECIFIED',
|
|
50
|
+
READY = 'READY',
|
|
51
|
+
NOT_READY = 'NOT_READY',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface Ai21LabsConfig {
|
|
55
|
+
/**
|
|
56
|
+
* The <Databricks> secret key reference for an AI21 Labs API key. If you
|
|
57
|
+
* prefer to paste your API key directly, see `ai21labs_api_key_plaintext`.
|
|
58
|
+
* You must provide an API key using one of the following fields:
|
|
59
|
+
* `ai21labs_api_key` or `ai21labs_api_key_plaintext`.
|
|
60
|
+
*/
|
|
61
|
+
ai21labsApiKey?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* An AI21 Labs API key provided as a plaintext string. If you prefer to
|
|
64
|
+
* reference your key using Databricks Secrets, see `ai21labs_api_key`. You
|
|
65
|
+
* must provide an API key using one of the following fields:
|
|
66
|
+
* `ai21labs_api_key` or `ai21labs_api_key_plaintext`.
|
|
67
|
+
*/
|
|
68
|
+
ai21labsApiKeyPlaintext?: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface AiGatewayConfig {
|
|
72
|
+
/**
|
|
73
|
+
* Configuration to enable usage tracking using system tables.
|
|
74
|
+
* These tables allow you to monitor operational usage on endpoints and their associated costs.
|
|
75
|
+
*/
|
|
76
|
+
usageTrackingConfig?: UsageTrackingConfig | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Configuration for payload logging using inference tables.
|
|
79
|
+
* Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality.
|
|
80
|
+
*/
|
|
81
|
+
inferenceTableConfig?: InferenceTableConfig | undefined;
|
|
82
|
+
/** Configuration for rate limits which can be set to limit endpoint traffic. */
|
|
83
|
+
rateLimits?: AiGatewayRateLimit[] | undefined;
|
|
84
|
+
/** Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. */
|
|
85
|
+
guardrails?: AiGuardrails | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served
|
|
88
|
+
* entity fails with certain error codes, to increase availability.
|
|
89
|
+
*/
|
|
90
|
+
fallbackConfig?: FallbackConfig | undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface AiGatewayRateLimit {
|
|
94
|
+
/** Used to specify how many calls are allowed for a key within the renewal_period. */
|
|
95
|
+
calls?: bigint | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Key field for a rate limit. Currently, 'user', 'user_group, 'service_principal', and 'endpoint' are supported,
|
|
98
|
+
* with 'endpoint' being the default if not specified.
|
|
99
|
+
*/
|
|
100
|
+
key?: string | undefined;
|
|
101
|
+
/** Renewal period field for a rate limit. Currently, only 'minute' is supported. */
|
|
102
|
+
renewalPeriod?: string | undefined;
|
|
103
|
+
/** Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID. */
|
|
104
|
+
principal?: string | undefined;
|
|
105
|
+
/** Used to specify how many tokens are allowed for a key within the renewal_period. */
|
|
106
|
+
tokens?: bigint | undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface AiGuardrailParameters {
|
|
110
|
+
/** Indicates whether the safety filter is enabled. */
|
|
111
|
+
safety?: boolean | undefined;
|
|
112
|
+
/** Configuration for guardrail PII filter. */
|
|
113
|
+
pii?: PiiSettings | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* The list of allowed topics.
|
|
116
|
+
* Given a chat request, this guardrail flags the request if its topic is not in the allowed topics.
|
|
117
|
+
*/
|
|
118
|
+
validTopics?: string[] | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* List of invalid keywords.
|
|
121
|
+
* AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content.
|
|
122
|
+
*/
|
|
123
|
+
invalidKeywords?: string[] | undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface AiGuardrails {
|
|
127
|
+
/** Configuration for input guardrail filters. */
|
|
128
|
+
input?: AiGuardrailParameters | undefined;
|
|
129
|
+
/** Configuration for output guardrail filters. */
|
|
130
|
+
output?: AiGuardrailParameters | undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface AmazonBedrockConfig {
|
|
134
|
+
/** The AWS region to use. Bedrock has to be enabled there. */
|
|
135
|
+
awsRegion?: string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* The <Databricks> secret key reference for an AWS access key ID with
|
|
138
|
+
* permissions to interact with Bedrock services. If you prefer to paste
|
|
139
|
+
* your API key directly, see `aws_access_key_id_plaintext`. You must provide an API
|
|
140
|
+
* key using one of the following fields: `aws_access_key_id` or
|
|
141
|
+
* `aws_access_key_id_plaintext`.
|
|
142
|
+
*/
|
|
143
|
+
awsAccessKeyId?: string | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* The <Databricks> secret key reference for an AWS secret access key paired
|
|
146
|
+
* with the access key ID, with permissions to interact with Bedrock
|
|
147
|
+
* services. If you prefer to paste your API key directly, see
|
|
148
|
+
* `aws_secret_access_key_plaintext`. You must provide an API key using one
|
|
149
|
+
* of the following fields: `aws_secret_access_key` or
|
|
150
|
+
* `aws_secret_access_key_plaintext`.
|
|
151
|
+
*/
|
|
152
|
+
awsSecretAccessKey?: string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* The underlying provider in Amazon Bedrock. Supported values (case
|
|
155
|
+
* insensitive) include: Anthropic, Cohere, AI21Labs, Amazon.
|
|
156
|
+
*/
|
|
157
|
+
bedrockProvider?: string | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* An AWS access key ID with permissions to interact with Bedrock services
|
|
160
|
+
* provided as a plaintext string. If you prefer to reference your key using
|
|
161
|
+
* Databricks Secrets, see `aws_access_key_id`. You must provide an API key
|
|
162
|
+
* using one of the following fields: `aws_access_key_id` or
|
|
163
|
+
* `aws_access_key_id_plaintext`.
|
|
164
|
+
*/
|
|
165
|
+
awsAccessKeyIdPlaintext?: string | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* An AWS secret access key paired with the access key ID, with permissions
|
|
168
|
+
* to interact with Bedrock services provided as a plaintext string. If you
|
|
169
|
+
* prefer to reference your key using Databricks Secrets, see
|
|
170
|
+
* `aws_secret_access_key`. You must provide an API key using one of the
|
|
171
|
+
* following fields: `aws_secret_access_key` or
|
|
172
|
+
* `aws_secret_access_key_plaintext`.
|
|
173
|
+
*/
|
|
174
|
+
awsSecretAccessKeyPlaintext?: string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* ARN of the instance profile that the external model will use to access AWS resources.
|
|
177
|
+
* You must authenticate using an instance profile or access keys.
|
|
178
|
+
* If you prefer to authenticate using access keys, see `aws_access_key_id`,
|
|
179
|
+
* `aws_access_key_id_plaintext`, `aws_secret_access_key` and `aws_secret_access_key_plaintext`.
|
|
180
|
+
*/
|
|
181
|
+
instanceProfileArn?: string | undefined;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface AnthropicConfig {
|
|
185
|
+
/**
|
|
186
|
+
* The <Databricks> secret key reference for an Anthropic API key. If you
|
|
187
|
+
* prefer to paste your API key directly, see `anthropic_api_key_plaintext`.
|
|
188
|
+
* You must provide an API key using one of the following fields:
|
|
189
|
+
* `anthropic_api_key` or `anthropic_api_key_plaintext`.
|
|
190
|
+
*/
|
|
191
|
+
anthropicApiKey?: string | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* The Anthropic API key provided as a plaintext string. If you prefer to
|
|
194
|
+
* reference your key using Databricks Secrets, see `anthropic_api_key`. You
|
|
195
|
+
* must provide an API key using one of the following fields:
|
|
196
|
+
* `anthropic_api_key` or `anthropic_api_key_plaintext`.
|
|
197
|
+
*/
|
|
198
|
+
anthropicApiKeyPlaintext?: string | undefined;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface ApiKeyAuth {
|
|
202
|
+
/** The name of the API key parameter used for authentication. */
|
|
203
|
+
key?: string | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* The <Databricks> secret key reference for an API Key.
|
|
206
|
+
* If you prefer to paste your token directly, see `value_plaintext`.
|
|
207
|
+
*/
|
|
208
|
+
value?: string | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* The API Key provided as a plaintext string. If you prefer to reference your
|
|
211
|
+
* token using Databricks Secrets, see `value`.
|
|
212
|
+
*/
|
|
213
|
+
valuePlaintext?: string | undefined;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Deprecated: legacy inference table configuration. Please use AI Gateway inference tables instead.
|
|
218
|
+
* See https://docs.databricks.com/aws/en/ai-gateway/inference-tables.
|
|
219
|
+
*/
|
|
220
|
+
export interface AutoCaptureConfig {
|
|
221
|
+
/** The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if the inference table is already enabled. */
|
|
222
|
+
catalogName?: string | undefined;
|
|
223
|
+
/** The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if the inference table is already enabled. */
|
|
224
|
+
schemaName?: string | undefined;
|
|
225
|
+
/** The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if the inference table is already enabled. */
|
|
226
|
+
tableNamePrefix?: string | undefined;
|
|
227
|
+
state?: AutoCaptureState | undefined;
|
|
228
|
+
/** Indicates whether the inference table is enabled. */
|
|
229
|
+
enabled?: boolean | undefined;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface AutoCaptureState {
|
|
233
|
+
payloadTable?: PayloadTable | undefined;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface BearerTokenAuth {
|
|
237
|
+
/**
|
|
238
|
+
* The <Databricks> secret key reference for a token.
|
|
239
|
+
* If you prefer to paste your token directly, see `token_plaintext`.
|
|
240
|
+
*/
|
|
241
|
+
token?: string | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* The token provided as a plaintext string. If you prefer to reference your
|
|
244
|
+
* token using Databricks Secrets, see `token`.
|
|
245
|
+
*/
|
|
246
|
+
tokenPlaintext?: string | undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface CohereConfig {
|
|
250
|
+
/**
|
|
251
|
+
* The <Databricks> secret key reference for a Cohere API key. If you prefer
|
|
252
|
+
* to paste your API key directly, see `cohere_api_key_plaintext`. You must
|
|
253
|
+
* provide an API key using one of the following fields: `cohere_api_key` or
|
|
254
|
+
* `cohere_api_key_plaintext`.
|
|
255
|
+
*/
|
|
256
|
+
cohereApiKey?: string | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* The Cohere API key provided as a plaintext string. If you prefer to
|
|
259
|
+
* reference your key using Databricks Secrets, see `cohere_api_key`. You
|
|
260
|
+
* must provide an API key using one of the following fields:
|
|
261
|
+
* `cohere_api_key` or `cohere_api_key_plaintext`.
|
|
262
|
+
*/
|
|
263
|
+
cohereApiKeyPlaintext?: string | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* This is an optional field to provide a customized base URL for the Cohere
|
|
266
|
+
* API. If left unspecified, the standard Cohere base URL is used.
|
|
267
|
+
*/
|
|
268
|
+
cohereApiBase?: string | undefined;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface CreateInferenceEndpointRequest {
|
|
272
|
+
/**
|
|
273
|
+
* The name of the serving endpoint. This field is required and must be unique across a <Workspace>.
|
|
274
|
+
* An endpoint name can consist of alphanumeric characters, dashes, and underscores.
|
|
275
|
+
*/
|
|
276
|
+
name?: string | undefined;
|
|
277
|
+
/** The core config of the serving endpoint. */
|
|
278
|
+
config?: EndpointCoreConfig | undefined;
|
|
279
|
+
/** Tags to be attached to the serving endpoint and automatically propagated to billing logs. */
|
|
280
|
+
tags?: EndpointTag[] | undefined;
|
|
281
|
+
/** Enable route optimization for the serving endpoint. */
|
|
282
|
+
routeOptimized?: boolean | undefined;
|
|
283
|
+
/** Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. */
|
|
284
|
+
rateLimits?: RateLimit[] | undefined;
|
|
285
|
+
/** The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. */
|
|
286
|
+
aiGateway?: AiGatewayConfig | undefined;
|
|
287
|
+
/** The budget policy to be applied to the serving endpoint. */
|
|
288
|
+
budgetPolicyId?: string | undefined;
|
|
289
|
+
/** Email notification settings. */
|
|
290
|
+
emailNotifications?: EmailNotifications | undefined;
|
|
291
|
+
description?: string | undefined;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface CreatePtEndpointRequest {
|
|
295
|
+
/**
|
|
296
|
+
* The name of the serving endpoint. This field is required and must be unique across a <Workspace>.
|
|
297
|
+
* An endpoint name can consist of alphanumeric characters, dashes, and underscores.
|
|
298
|
+
*/
|
|
299
|
+
name?: string | undefined;
|
|
300
|
+
/** The core config of the serving endpoint. */
|
|
301
|
+
config?: PtEndpointCoreConfig | undefined;
|
|
302
|
+
/** Tags to be attached to the serving endpoint and automatically propagated to billing logs. */
|
|
303
|
+
tags?: EndpointTag[] | undefined;
|
|
304
|
+
/** The AI Gateway configuration for the serving endpoint. */
|
|
305
|
+
aiGateway?: AiGatewayConfig | undefined;
|
|
306
|
+
/** The budget policy associated with the endpoint. */
|
|
307
|
+
budgetPolicyId?: string | undefined;
|
|
308
|
+
/** Email notification settings. */
|
|
309
|
+
emailNotifications?: EmailNotifications | undefined;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** Configs needed to create a custom provider model route. */
|
|
313
|
+
export interface CustomProviderConfig {
|
|
314
|
+
/** This is a field to provide the URL of the custom provider API. */
|
|
315
|
+
customProviderUrl?: string | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* This is a field to provide bearer token authentication for the custom provider API.
|
|
318
|
+
* You can only specify one authentication method.
|
|
319
|
+
*/
|
|
320
|
+
bearerTokenAuth?: BearerTokenAuth | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* This is a field to provide API key authentication for the custom provider API.
|
|
323
|
+
* You can only specify one authentication method.
|
|
324
|
+
*/
|
|
325
|
+
apiKeyAuth?: ApiKeyAuth | undefined;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/** Details necessary to query this object's API through the DataPlane APIs. */
|
|
329
|
+
export interface DataPlaneInfo {
|
|
330
|
+
/** The URL of the endpoint for this operation in the dataplane. */
|
|
331
|
+
endpointUrl?: string | undefined;
|
|
332
|
+
/** Authorization details as a string. */
|
|
333
|
+
authorizationDetails?: string | undefined;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface DatabricksModelServingConfig {
|
|
337
|
+
/**
|
|
338
|
+
* The <Databricks> secret key reference for a Databricks API token that
|
|
339
|
+
* corresponds to a user or service principal with Can Query access to the
|
|
340
|
+
* model serving endpoint pointed to by this external model. If you prefer
|
|
341
|
+
* to paste your API key directly, see `databricks_api_token_plaintext`. You
|
|
342
|
+
* must provide an API key using one of the following fields:
|
|
343
|
+
* `databricks_api_token` or `databricks_api_token_plaintext`.
|
|
344
|
+
*/
|
|
345
|
+
databricksApiToken?: string | undefined;
|
|
346
|
+
/**
|
|
347
|
+
* The URL of the <Databricks> workspace containing the model serving endpoint
|
|
348
|
+
* pointed to by this external model.
|
|
349
|
+
*/
|
|
350
|
+
databricksWorkspaceUrl?: string | undefined;
|
|
351
|
+
/**
|
|
352
|
+
* The Databricks API token that corresponds to a user or service principal
|
|
353
|
+
* with Can Query access to the model serving endpoint pointed to by this
|
|
354
|
+
* external model provided as a plaintext string. If you prefer to reference
|
|
355
|
+
* your key using Databricks Secrets, see `databricks_api_token`. You must
|
|
356
|
+
* provide an API key using one of the following fields:
|
|
357
|
+
* `databricks_api_token` or `databricks_api_token_plaintext`.
|
|
358
|
+
*/
|
|
359
|
+
databricksApiTokenPlaintext?: string | undefined;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface DeleteInferenceEndpointRequest {
|
|
363
|
+
name?: string | undefined;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
367
|
+
export interface DeleteInferenceEndpointRequest_Response {}
|
|
368
|
+
|
|
369
|
+
export interface EmailNotifications {
|
|
370
|
+
/** A list of email addresses to be notified when an endpoint successfully updates its configuration or state. */
|
|
371
|
+
onUpdateSuccess?: string[] | undefined;
|
|
372
|
+
/** A list of email addresses to be notified when an endpoint fails to update its configuration or state. */
|
|
373
|
+
onUpdateFailure?: string[] | undefined;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export interface EndpointCoreConfig {
|
|
377
|
+
/** The list of served entities under the serving endpoint config. */
|
|
378
|
+
servedEntities?: ServedModel[] | undefined;
|
|
379
|
+
/** (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. */
|
|
380
|
+
servedModels?: ServedModel[] | undefined;
|
|
381
|
+
/** The traffic configuration associated with the serving endpoint config. */
|
|
382
|
+
trafficConfig?: TrafficConfig | undefined;
|
|
383
|
+
/**
|
|
384
|
+
* Configuration for legacy Inference Tables which automatically log requests and responses to Unity
|
|
385
|
+
* Catalog.
|
|
386
|
+
* Deprecated: please use AI Gateway inference tables instead. See
|
|
387
|
+
* https://docs.databricks.com/aws/en/ai-gateway/inference-tables.
|
|
388
|
+
*/
|
|
389
|
+
autoCaptureConfig?: AutoCaptureConfig | undefined;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface EndpointCoreConfigOutput {
|
|
393
|
+
/** The config version that the serving endpoint is currently serving. */
|
|
394
|
+
configVersion?: bigint | undefined;
|
|
395
|
+
/** The list of served entities under the serving endpoint config. */
|
|
396
|
+
servedEntities?: ServedModel[] | undefined;
|
|
397
|
+
/** (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. */
|
|
398
|
+
servedModels?: ServedModel[] | undefined;
|
|
399
|
+
/** The traffic configuration associated with the serving endpoint config. */
|
|
400
|
+
trafficConfig?: TrafficConfig | undefined;
|
|
401
|
+
/**
|
|
402
|
+
* Configuration for legacy Inference Tables which automatically log requests and responses to Unity
|
|
403
|
+
* Catalog.
|
|
404
|
+
* Deprecated: please use AI Gateway inference tables instead. See
|
|
405
|
+
* https://docs.databricks.com/aws/en/ai-gateway/inference-tables.
|
|
406
|
+
*/
|
|
407
|
+
autoCaptureConfig?: AutoCaptureConfig | undefined;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export interface EndpointCoreConfigSummary {
|
|
411
|
+
/** The list of served entities under the serving endpoint config. */
|
|
412
|
+
servedEntities?: ServedModelLite[] | undefined;
|
|
413
|
+
/** (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. */
|
|
414
|
+
servedModels?: ServedModelLite[] | undefined;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface EndpointTag {
|
|
418
|
+
/** Key field for a serving endpoint tag. */
|
|
419
|
+
key?: string | undefined;
|
|
420
|
+
/** Optional value field for a serving endpoint tag. */
|
|
421
|
+
value?: string | undefined;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* *
|
|
426
|
+
* Proto version of com.databricks.rpc.HttpOverRpcResponse.
|
|
427
|
+
*
|
|
428
|
+
* This message can be specially handled in UnaryRpcService with JettyRPC when the advanced feature
|
|
429
|
+
* CustomHandlingForHttpOverRpcProtoResponse is enabled - bypass the RPC serializer and populate
|
|
430
|
+
* HTTP status, response headers and response body from the proto message directly.
|
|
431
|
+
*
|
|
432
|
+
* Don't add/modify the fields before being aware of the implications.
|
|
433
|
+
*/
|
|
434
|
+
export interface ExportMetricsResponse {
|
|
435
|
+
contents?: ReadableStream | undefined;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** Simple Proto message for testing */
|
|
439
|
+
export interface ExternalFunctionRequest {
|
|
440
|
+
/** The connection name to use. This is required to identify the external connection. */
|
|
441
|
+
connectionName?: string | undefined;
|
|
442
|
+
/** The HTTP method to use (e.g., 'GET', 'POST'). */
|
|
443
|
+
method?: ExternalFunctionRequest_HttpMethod | undefined;
|
|
444
|
+
/** The relative path for the API endpoint. This is required. */
|
|
445
|
+
path?: string | undefined;
|
|
446
|
+
/** The JSON payload to send in the request body. */
|
|
447
|
+
json?: string | undefined;
|
|
448
|
+
/** Additional headers for the request. If not provided, only auth headers from connections would be passed. */
|
|
449
|
+
headers?: string | undefined;
|
|
450
|
+
/** Query parameters for the request. */
|
|
451
|
+
params?: string | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* Optional subdomain to prepend to the connection URL's host. If provided, this will be
|
|
454
|
+
* added as a prefix to the connection URL's host. For example, if the connection URL is
|
|
455
|
+
* `https://api.example.com/v1` and `sub_domain` is `"custom"`, the resulting URL will be
|
|
456
|
+
* `https://custom.api.example.com/v1`.
|
|
457
|
+
*/
|
|
458
|
+
subDomain?: string | undefined;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export interface ExternalFunctionResponse {
|
|
462
|
+
contents?: ReadableStream | undefined;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export interface ExternalModel {
|
|
466
|
+
/** The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', 'palm', and 'custom'. */
|
|
467
|
+
provider?: string | undefined;
|
|
468
|
+
/** The name of the external model. */
|
|
469
|
+
name?: string | undefined;
|
|
470
|
+
/** The task type of the external model. */
|
|
471
|
+
task?: string | undefined;
|
|
472
|
+
/** external model config. The config corresponding to the provider will be used. */
|
|
473
|
+
config?:
|
|
474
|
+
| {
|
|
475
|
+
$case: 'ai21labsConfig';
|
|
476
|
+
/** AI21Labs Config. Only required if the provider is 'ai21labs'. */
|
|
477
|
+
ai21labsConfig: Ai21LabsConfig;
|
|
478
|
+
}
|
|
479
|
+
| {
|
|
480
|
+
$case: 'anthropicConfig';
|
|
481
|
+
/** Anthropic Config. Only required if the provider is 'anthropic'. */
|
|
482
|
+
anthropicConfig: AnthropicConfig;
|
|
483
|
+
}
|
|
484
|
+
| {
|
|
485
|
+
$case: 'amazonBedrockConfig';
|
|
486
|
+
/** Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. */
|
|
487
|
+
amazonBedrockConfig: AmazonBedrockConfig;
|
|
488
|
+
}
|
|
489
|
+
| {
|
|
490
|
+
$case: 'cohereConfig';
|
|
491
|
+
/** Cohere Config. Only required if the provider is 'cohere'. */
|
|
492
|
+
cohereConfig: CohereConfig;
|
|
493
|
+
}
|
|
494
|
+
| {
|
|
495
|
+
$case: 'googleCloudVertexAiConfig';
|
|
496
|
+
/** Google Cloud Vertex AI Config. Only required if the provider is 'google-cloud-vertex-ai'. */
|
|
497
|
+
googleCloudVertexAiConfig: GoogleCloudVertexAiConfig;
|
|
498
|
+
}
|
|
499
|
+
| {
|
|
500
|
+
$case: 'databricksModelServingConfig';
|
|
501
|
+
/** Databricks Model Serving Config. Only required if the provider is 'databricks-model-serving'. */
|
|
502
|
+
databricksModelServingConfig: DatabricksModelServingConfig;
|
|
503
|
+
}
|
|
504
|
+
| {
|
|
505
|
+
$case: 'openaiConfig';
|
|
506
|
+
/** OpenAI Config. Only required if the provider is 'openai'. */
|
|
507
|
+
openaiConfig: OpenAiConfig;
|
|
508
|
+
}
|
|
509
|
+
| {
|
|
510
|
+
$case: 'palmConfig';
|
|
511
|
+
/** PaLM Config. Only required if the provider is 'palm'. */
|
|
512
|
+
palmConfig: PaLmConfig;
|
|
513
|
+
}
|
|
514
|
+
| {
|
|
515
|
+
$case: 'customProviderConfig';
|
|
516
|
+
/** Custom Provider Config. Only required if the provider is 'custom'. */
|
|
517
|
+
customProviderConfig: CustomProviderConfig;
|
|
518
|
+
}
|
|
519
|
+
| undefined;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export interface FallbackConfig {
|
|
523
|
+
/**
|
|
524
|
+
* Whether to enable traffic fallback. When a served entity in the serving endpoint returns specific error
|
|
525
|
+
* codes (e.g. 500), the request will automatically be round-robin attempted with other served entities in the same
|
|
526
|
+
* endpoint, following the order of served entity list, until a successful response is returned.
|
|
527
|
+
* If all attempts fail, return the last response with the error code.
|
|
528
|
+
*/
|
|
529
|
+
enabled?: boolean | undefined;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/** All fields are not sensitive as they are hard-coded in the system and made available to customers. */
|
|
533
|
+
export interface FoundationModel {
|
|
534
|
+
name?: string | undefined;
|
|
535
|
+
displayName?: string | undefined;
|
|
536
|
+
docs?: string | undefined;
|
|
537
|
+
description?: string | undefined;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export interface GetExportEndpointMetricsRequest {
|
|
541
|
+
/** The name of the serving endpoint to retrieve metrics for. This field is required. */
|
|
542
|
+
name?: string | undefined;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface GetInferenceEndpointRequest {
|
|
546
|
+
/** The name of the serving endpoint. This field is required. */
|
|
547
|
+
name?: string | undefined;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export interface GetInferenceEndpointSchemaRequest {
|
|
551
|
+
/** The name of the serving endpoint that the served model belongs to. This field is required. */
|
|
552
|
+
name?: string | undefined;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/** The top level proto message that represents an OpenAPI 3.0 document. */
|
|
556
|
+
export interface GetOpenApiResponse {
|
|
557
|
+
contents?: ReadableStream | undefined;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export interface GetServedModelBuildLogsRequest {
|
|
561
|
+
/** The name of the serving endpoint that the served model belongs to. This field is required. */
|
|
562
|
+
name?: string | undefined;
|
|
563
|
+
/** The name of the served model that build logs will be retrieved for. This field is required. */
|
|
564
|
+
servedModelName?: string | undefined;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
568
|
+
export interface GetServedModelBuildLogsRequest_Response {
|
|
569
|
+
/** The logs associated with building the served entity's environment. */
|
|
570
|
+
logs?: string | undefined;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export interface GetServedModelLogsRequest {
|
|
574
|
+
/** The name of the serving endpoint that the served model belongs to. This field is required. */
|
|
575
|
+
name?: string | undefined;
|
|
576
|
+
/** The name of the served model that logs will be retrieved for. This field is required. */
|
|
577
|
+
servedModelName?: string | undefined;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
581
|
+
export interface GetServedModelLogsRequest_Response {
|
|
582
|
+
/** The most recent log lines of the model server processing invocation requests. */
|
|
583
|
+
logs?: string | undefined;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export interface GoogleCloudVertexAiConfig {
|
|
587
|
+
/**
|
|
588
|
+
* The <Databricks> secret key reference for a private key for the service
|
|
589
|
+
* account which has access to the Google Cloud Vertex AI Service. See [Best
|
|
590
|
+
* practices for managing service account keys]. If you prefer to paste your
|
|
591
|
+
* API key directly, see `private_key_plaintext`. You must provide an API
|
|
592
|
+
* key using one of the following fields: `private_key` or
|
|
593
|
+
* `private_key_plaintext`
|
|
594
|
+
*
|
|
595
|
+
* [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
|
|
596
|
+
*/
|
|
597
|
+
privateKey?: string | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* This is the Google Cloud project id that the service account is
|
|
600
|
+
* associated with.
|
|
601
|
+
*/
|
|
602
|
+
projectId?: string | undefined;
|
|
603
|
+
/**
|
|
604
|
+
* This is the region for the Google Cloud Vertex AI Service. See [supported
|
|
605
|
+
* regions] for more details. Some models are only available in specific
|
|
606
|
+
* regions.
|
|
607
|
+
*
|
|
608
|
+
* [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations
|
|
609
|
+
*/
|
|
610
|
+
region?: string | undefined;
|
|
611
|
+
/**
|
|
612
|
+
* The private key for the service account which has access to the Google
|
|
613
|
+
* Cloud Vertex AI Service provided as a plaintext secret. See [Best
|
|
614
|
+
* practices for managing service account keys]. If you prefer to reference
|
|
615
|
+
* your key using Databricks Secrets, see `private_key`. You must provide an
|
|
616
|
+
* API key using one of the following fields: `private_key` or
|
|
617
|
+
* `private_key_plaintext`.
|
|
618
|
+
*
|
|
619
|
+
* [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
|
|
620
|
+
*/
|
|
621
|
+
privateKeyPlaintext?: string | undefined;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export interface InferenceEndpoint {
|
|
625
|
+
/** The name of the serving endpoint. */
|
|
626
|
+
name?: string | undefined;
|
|
627
|
+
/** The email of the user who created the serving endpoint. */
|
|
628
|
+
creator?: string | undefined;
|
|
629
|
+
/** The timestamp when the endpoint was created in Unix time. */
|
|
630
|
+
creationTimestamp?: bigint | undefined;
|
|
631
|
+
/** The timestamp when the endpoint was last updated by a user in Unix time. */
|
|
632
|
+
lastUpdatedTimestamp?: bigint | undefined;
|
|
633
|
+
/** Information corresponding to the state of the serving endpoint. */
|
|
634
|
+
state?: InferenceEndpointState | undefined;
|
|
635
|
+
/** The config that is currently being served by the endpoint. */
|
|
636
|
+
config?: EndpointCoreConfigSummary | undefined;
|
|
637
|
+
/** Tags attached to the serving endpoint. */
|
|
638
|
+
tags?: EndpointTag[] | undefined;
|
|
639
|
+
/** System-generated ID of the endpoint, included to be used by the Permissions API. */
|
|
640
|
+
id?: string | undefined;
|
|
641
|
+
/** The task type of the serving endpoint. */
|
|
642
|
+
task?: string | undefined;
|
|
643
|
+
/** The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. */
|
|
644
|
+
aiGateway?: AiGatewayConfig | undefined;
|
|
645
|
+
/** The budget policy associated with the endpoint. */
|
|
646
|
+
budgetPolicyId?: string | undefined;
|
|
647
|
+
/** Description of the endpoint */
|
|
648
|
+
description?: string | undefined;
|
|
649
|
+
/** The usage policy associated with serving endpoint. */
|
|
650
|
+
usagePolicyId?: string | undefined;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export interface InferenceEndpointDetailed {
|
|
654
|
+
/** The name of the serving endpoint. */
|
|
655
|
+
name?: string | undefined;
|
|
656
|
+
/** The email of the user who created the serving endpoint. */
|
|
657
|
+
creator?: string | undefined;
|
|
658
|
+
/** The timestamp when the endpoint was created in Unix time. */
|
|
659
|
+
creationTimestamp?: bigint | undefined;
|
|
660
|
+
/** The timestamp when the endpoint was last updated by a user in Unix time. */
|
|
661
|
+
lastUpdatedTimestamp?: bigint | undefined;
|
|
662
|
+
/** Information corresponding to the state of the serving endpoint. */
|
|
663
|
+
state?: InferenceEndpointState | undefined;
|
|
664
|
+
/** The config that is currently being served by the endpoint. */
|
|
665
|
+
config?: EndpointCoreConfigOutput | undefined;
|
|
666
|
+
/** The config that the endpoint is attempting to update to. */
|
|
667
|
+
pendingConfig?: PendingConfig | undefined;
|
|
668
|
+
/** System-generated ID of the endpoint. This is used to refer to the endpoint in the Permissions API */
|
|
669
|
+
id?: string | undefined;
|
|
670
|
+
/** The permission level of the principal making the request. */
|
|
671
|
+
permissionLevel?: ServingEndpointDetailedPermissionLevel | undefined;
|
|
672
|
+
/** Tags attached to the serving endpoint. */
|
|
673
|
+
tags?: EndpointTag[] | undefined;
|
|
674
|
+
/** The task type of the serving endpoint. */
|
|
675
|
+
task?: string | undefined;
|
|
676
|
+
/** Boolean representing if route optimization has been enabled for the endpoint */
|
|
677
|
+
routeOptimized?: boolean | undefined;
|
|
678
|
+
/** Endpoint invocation url if route optimization is enabled for endpoint */
|
|
679
|
+
endpointUrl?: string | undefined;
|
|
680
|
+
/** Information required to query DataPlane APIs. */
|
|
681
|
+
dataPlaneInfo?: ModelDataPlaneInfo | undefined;
|
|
682
|
+
/** The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. */
|
|
683
|
+
aiGateway?: AiGatewayConfig | undefined;
|
|
684
|
+
/** The budget policy associated with the endpoint. */
|
|
685
|
+
budgetPolicyId?: string | undefined;
|
|
686
|
+
/** Email notification settings. */
|
|
687
|
+
emailNotifications?: EmailNotifications | undefined;
|
|
688
|
+
/** Description of the serving model */
|
|
689
|
+
description?: string | undefined;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
export interface InferenceEndpointState {
|
|
693
|
+
/**
|
|
694
|
+
* The state of an endpoint, indicating whether or not the endpoint is queryable. An endpoint is READY if all of
|
|
695
|
+
* the served entities in its active configuration are ready. If any of the actively served entities are in a
|
|
696
|
+
* non-ready state, the endpoint state will be NOT_READY.
|
|
697
|
+
*/
|
|
698
|
+
ready?: InferenceEndpointState_ReadyState | undefined;
|
|
699
|
+
/**
|
|
700
|
+
* The state of an endpoint's config update. This informs the user if the pending_config is in progress, if the
|
|
701
|
+
* update failed, or if there is no update in progress. Note that if the endpoint's config_update state value is
|
|
702
|
+
* IN_PROGRESS, another update can not be made until the update completes or fails.
|
|
703
|
+
*/
|
|
704
|
+
configUpdate?: InferenceEndpointState_ConfigUpdateState | undefined;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export interface InferenceTableConfig {
|
|
708
|
+
/**
|
|
709
|
+
* The name of the catalog in Unity Catalog. Required when enabling inference tables.
|
|
710
|
+
* NOTE: On update, you have to disable inference table first in order to change the catalog name.
|
|
711
|
+
*/
|
|
712
|
+
catalogName?: string | undefined;
|
|
713
|
+
/**
|
|
714
|
+
* The name of the schema in Unity Catalog. Required when enabling inference tables.
|
|
715
|
+
* NOTE: On update, you have to disable inference table first in order to change the schema name.
|
|
716
|
+
*/
|
|
717
|
+
schemaName?: string | undefined;
|
|
718
|
+
/**
|
|
719
|
+
* The prefix of the table in Unity Catalog.
|
|
720
|
+
* NOTE: On update, you have to disable inference table first in order to change the prefix name.
|
|
721
|
+
*/
|
|
722
|
+
tableNamePrefix?: string | undefined;
|
|
723
|
+
/** Indicates whether the inference table is enabled. */
|
|
724
|
+
enabled?: boolean | undefined;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
728
|
+
export interface ListInferenceEndpointsRequest {}
|
|
729
|
+
|
|
730
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
731
|
+
export interface ListInferenceEndpointsRequest_Response {
|
|
732
|
+
/** The list of endpoints. */
|
|
733
|
+
endpoints?: InferenceEndpoint[] | undefined;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/** A representation of all DataPlaneInfo for operations that can be done on a model through Data Plane APIs. */
|
|
737
|
+
export interface ModelDataPlaneInfo {
|
|
738
|
+
/** Information required to query DataPlane API 'query' endpoint. */
|
|
739
|
+
queryInfo?: DataPlaneInfo | undefined;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/** Configs needed to create an OpenAI model route. */
|
|
743
|
+
export interface OpenAiConfig {
|
|
744
|
+
/**
|
|
745
|
+
* The <Databricks> secret key reference for an OpenAI API key using the
|
|
746
|
+
* OpenAI or Azure service. If you prefer to paste your API key directly,
|
|
747
|
+
* see `openai_api_key_plaintext`. You must provide an API key using one of
|
|
748
|
+
* the following fields: `openai_api_key` or `openai_api_key_plaintext`.
|
|
749
|
+
*/
|
|
750
|
+
openaiApiKey?: string | undefined;
|
|
751
|
+
/**
|
|
752
|
+
* This is an optional field to specify the type of OpenAI API to use. For
|
|
753
|
+
* Azure OpenAI, this field is required, and adjust this parameter to
|
|
754
|
+
* represent the preferred security access validation protocol. For access
|
|
755
|
+
* token validation, use azure. For authentication using Azure Active
|
|
756
|
+
* Directory (Azure AD) use, azuread.
|
|
757
|
+
*/
|
|
758
|
+
openaiApiType?: string | undefined;
|
|
759
|
+
/**
|
|
760
|
+
* This is a field to provide a customized base URl for the OpenAI API. For
|
|
761
|
+
* Azure OpenAI, this field is required, and is the base URL for the Azure
|
|
762
|
+
* OpenAI API service provided by Azure. For other OpenAI API types, this
|
|
763
|
+
* field is optional, and if left unspecified, the standard OpenAI base URL
|
|
764
|
+
* is used.
|
|
765
|
+
*/
|
|
766
|
+
openaiApiBase?: string | undefined;
|
|
767
|
+
/**
|
|
768
|
+
* This is an optional field to specify the OpenAI API version. For Azure
|
|
769
|
+
* OpenAI, this field is required, and is the version of the Azure OpenAI
|
|
770
|
+
* service to utilize, specified by a date.
|
|
771
|
+
*/
|
|
772
|
+
openaiApiVersion?: string | undefined;
|
|
773
|
+
/**
|
|
774
|
+
* This field is only required for Azure OpenAI and is the name of the
|
|
775
|
+
* deployment resource for the Azure OpenAI service.
|
|
776
|
+
*/
|
|
777
|
+
openaiDeploymentName?: string | undefined;
|
|
778
|
+
/**
|
|
779
|
+
* This is an optional field to specify the organization in OpenAI or Azure
|
|
780
|
+
* OpenAI.
|
|
781
|
+
*/
|
|
782
|
+
openaiOrganization?: string | undefined;
|
|
783
|
+
/**
|
|
784
|
+
* This field is only required for Azure AD OpenAI and is the Microsoft
|
|
785
|
+
* Entra Tenant ID.
|
|
786
|
+
*/
|
|
787
|
+
microsoftEntraTenantId?: string | undefined;
|
|
788
|
+
/**
|
|
789
|
+
* This field is only required for Azure AD OpenAI and is the Microsoft
|
|
790
|
+
* Entra Client ID.
|
|
791
|
+
*/
|
|
792
|
+
microsoftEntraClientId?: string | undefined;
|
|
793
|
+
/**
|
|
794
|
+
* The <Databricks> secret key reference for a client secret used for
|
|
795
|
+
* Microsoft Entra ID authentication. If you prefer to paste your client
|
|
796
|
+
* secret directly, see `microsoft_entra_client_secret_plaintext`. You must
|
|
797
|
+
* provide an API key using one of the following fields:
|
|
798
|
+
* `microsoft_entra_client_secret` or
|
|
799
|
+
* `microsoft_entra_client_secret_plaintext`.
|
|
800
|
+
*/
|
|
801
|
+
microsoftEntraClientSecret?: string | undefined;
|
|
802
|
+
/**
|
|
803
|
+
* The OpenAI API key using the OpenAI or Azure service provided as a
|
|
804
|
+
* plaintext string. If you prefer to reference your key using Databricks
|
|
805
|
+
* Secrets, see `openai_api_key`. You must provide an API key using one of
|
|
806
|
+
* the following fields: `openai_api_key` or `openai_api_key_plaintext`.
|
|
807
|
+
*/
|
|
808
|
+
openaiApiKeyPlaintext?: string | undefined;
|
|
809
|
+
/**
|
|
810
|
+
* The client secret used for Microsoft Entra ID authentication provided as
|
|
811
|
+
* a plaintext string. If you prefer to reference your key using Databricks
|
|
812
|
+
* Secrets, see `microsoft_entra_client_secret`. You must provide an API key
|
|
813
|
+
* using one of the following fields: `microsoft_entra_client_secret` or
|
|
814
|
+
* `microsoft_entra_client_secret_plaintext`.
|
|
815
|
+
*/
|
|
816
|
+
microsoftEntraClientSecretPlaintext?: string | undefined;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
export interface PaLmConfig {
|
|
820
|
+
/**
|
|
821
|
+
* The <Databricks> secret key reference for a PaLM API key. If you prefer to
|
|
822
|
+
* paste your API key directly, see `palm_api_key_plaintext`. You must
|
|
823
|
+
* provide an API key using one of the following fields: `palm_api_key` or
|
|
824
|
+
* `palm_api_key_plaintext`.
|
|
825
|
+
*/
|
|
826
|
+
palmApiKey?: string | undefined;
|
|
827
|
+
/**
|
|
828
|
+
* The PaLM API key provided as a plaintext string. If you prefer to
|
|
829
|
+
* reference your key using Databricks Secrets, see `palm_api_key`. You must
|
|
830
|
+
* provide an API key using one of the following fields: `palm_api_key` or
|
|
831
|
+
* `palm_api_key_plaintext`.
|
|
832
|
+
*/
|
|
833
|
+
palmApiKeyPlaintext?: string | undefined;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
export interface PatchInferenceEndpointTagsRequest {
|
|
837
|
+
/** The name of the serving endpoint who's tags to patch. This field is required. */
|
|
838
|
+
name?: string | undefined;
|
|
839
|
+
/** List of endpoint tags to add */
|
|
840
|
+
addTags?: EndpointTag[] | undefined;
|
|
841
|
+
/** List of tag keys to delete */
|
|
842
|
+
deleteTags?: string[] | undefined;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
846
|
+
export interface PatchInferenceEndpointTagsRequest_Response {
|
|
847
|
+
tags?: EndpointTag[] | undefined;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export interface PayloadTable {
|
|
851
|
+
name?: string | undefined;
|
|
852
|
+
status?: string | undefined;
|
|
853
|
+
statusMessage?: string | undefined;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export interface PendingConfig {
|
|
857
|
+
/** The list of served entities belonging to the last issued update to the serving endpoint. */
|
|
858
|
+
servedEntities?: ServedModel[] | undefined;
|
|
859
|
+
/** (Deprecated, use served_entities instead) The list of served models belonging to the last issued update to the serving endpoint. */
|
|
860
|
+
servedModels?: ServedModel[] | undefined;
|
|
861
|
+
/** The traffic config defining how invocations to the serving endpoint should be routed. */
|
|
862
|
+
trafficConfig?: TrafficConfig | undefined;
|
|
863
|
+
/** The config version that the serving endpoint is currently serving. */
|
|
864
|
+
configVersion?: number | undefined;
|
|
865
|
+
/** The timestamp when the update to the pending config started. */
|
|
866
|
+
startTime?: bigint | undefined;
|
|
867
|
+
/**
|
|
868
|
+
* Configuration for legacy Inference Tables which automatically log requests and responses to Unity
|
|
869
|
+
* Catalog.
|
|
870
|
+
* Deprecated: please use AI Gateway inference tables instead. See
|
|
871
|
+
* https://docs.databricks.com/aws/en/ai-gateway/inference-tables.
|
|
872
|
+
*/
|
|
873
|
+
autoCaptureConfig?: AutoCaptureConfig | undefined;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export interface PiiSettings {
|
|
877
|
+
/** Configuration for input guardrail filters. */
|
|
878
|
+
behavior?: Behavior | undefined;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export interface PtEndpointCoreConfig {
|
|
882
|
+
/** The list of served entities under the serving endpoint config. */
|
|
883
|
+
servedEntities?: PtServedModel[] | undefined;
|
|
884
|
+
trafficConfig?: TrafficConfig | undefined;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export interface PtServedModel {
|
|
888
|
+
/** The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. */
|
|
889
|
+
name?: string | undefined;
|
|
890
|
+
/** The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**. */
|
|
891
|
+
entityName?: string | undefined;
|
|
892
|
+
entityVersion?: string | undefined;
|
|
893
|
+
/** The number of model units to be provisioned. */
|
|
894
|
+
provisionedModelUnits?: bigint | undefined;
|
|
895
|
+
/**
|
|
896
|
+
* Whether burst scaling is enabled. When enabled (default), the endpoint can automatically
|
|
897
|
+
* scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint
|
|
898
|
+
* maintains fixed capacity at provisioned_model_units.
|
|
899
|
+
*/
|
|
900
|
+
burstScalingEnabled?: boolean | undefined;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
export interface PutInferenceEndpointAiGatewayRequest {
|
|
904
|
+
/** The name of the serving endpoint whose AI Gateway is being updated. This field is required. */
|
|
905
|
+
name?: string | undefined;
|
|
906
|
+
/**
|
|
907
|
+
* Configuration to enable usage tracking using system tables.
|
|
908
|
+
* These tables allow you to monitor operational usage on endpoints and their associated costs.
|
|
909
|
+
*/
|
|
910
|
+
usageTrackingConfig?: UsageTrackingConfig | undefined;
|
|
911
|
+
/**
|
|
912
|
+
* Configuration for payload logging using inference tables.
|
|
913
|
+
* Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality.
|
|
914
|
+
*/
|
|
915
|
+
inferenceTableConfig?: InferenceTableConfig | undefined;
|
|
916
|
+
/** Configuration for rate limits which can be set to limit endpoint traffic. */
|
|
917
|
+
rateLimits?: AiGatewayRateLimit[] | undefined;
|
|
918
|
+
/** Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. */
|
|
919
|
+
guardrails?: AiGuardrails | undefined;
|
|
920
|
+
/**
|
|
921
|
+
* Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served
|
|
922
|
+
* entity fails with certain error codes, to increase availability.
|
|
923
|
+
*/
|
|
924
|
+
fallbackConfig?: FallbackConfig | undefined;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
928
|
+
export interface PutInferenceEndpointAiGatewayRequest_Response {
|
|
929
|
+
/**
|
|
930
|
+
* Configuration to enable usage tracking using system tables.
|
|
931
|
+
* These tables allow you to monitor operational usage on endpoints and their associated costs.
|
|
932
|
+
*/
|
|
933
|
+
usageTrackingConfig?: UsageTrackingConfig | undefined;
|
|
934
|
+
/**
|
|
935
|
+
* Configuration for payload logging using inference tables.
|
|
936
|
+
* Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality.
|
|
937
|
+
*/
|
|
938
|
+
inferenceTableConfig?: InferenceTableConfig | undefined;
|
|
939
|
+
/** Configuration for rate limits which can be set to limit endpoint traffic. */
|
|
940
|
+
rateLimits?: AiGatewayRateLimit[] | undefined;
|
|
941
|
+
/** Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. */
|
|
942
|
+
guardrails?: AiGuardrails | undefined;
|
|
943
|
+
/**
|
|
944
|
+
* Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served
|
|
945
|
+
* entity fails with certain error codes, to increase availability.
|
|
946
|
+
*/
|
|
947
|
+
fallbackConfig?: FallbackConfig | undefined;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export interface PutInferenceEndpointConfigRequest {
|
|
951
|
+
/** The name of the serving endpoint to update. This field is required. */
|
|
952
|
+
name?: string | undefined;
|
|
953
|
+
/** The list of served entities under the serving endpoint config. */
|
|
954
|
+
servedEntities?: ServedModel[] | undefined;
|
|
955
|
+
/** (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. */
|
|
956
|
+
servedModels?: ServedModel[] | undefined;
|
|
957
|
+
/** The traffic configuration associated with the serving endpoint config. */
|
|
958
|
+
trafficConfig?: TrafficConfig | undefined;
|
|
959
|
+
/**
|
|
960
|
+
* Configuration for legacy Inference Tables which automatically log requests and responses to Unity
|
|
961
|
+
* Catalog.
|
|
962
|
+
* Deprecated: please use AI Gateway inference tables instead. See
|
|
963
|
+
* https://docs.databricks.com/aws/en/ai-gateway/inference-tables.
|
|
964
|
+
*/
|
|
965
|
+
autoCaptureConfig?: AutoCaptureConfig | undefined;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export interface PutInferenceEndpointRateLimitsRequest {
|
|
969
|
+
/** The name of the serving endpoint whose rate limits are being updated. This field is required. */
|
|
970
|
+
name?: string | undefined;
|
|
971
|
+
/** The list of endpoint rate limits. */
|
|
972
|
+
rateLimits?: RateLimit[] | undefined;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
976
|
+
export interface PutInferenceEndpointRateLimitsRequest_Response {
|
|
977
|
+
/** The list of endpoint rate limits. */
|
|
978
|
+
rateLimits?: RateLimit[] | undefined;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
export interface PutPtEndpointConfigRequest {
|
|
982
|
+
/** The name of the pt endpoint to update. This field is required. */
|
|
983
|
+
name?: string | undefined;
|
|
984
|
+
config?: PtEndpointCoreConfig | undefined;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
export interface RateLimit {
|
|
988
|
+
/** Used to specify how many calls are allowed for a key within the renewal_period. */
|
|
989
|
+
calls?: bigint | undefined;
|
|
990
|
+
/** Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified. */
|
|
991
|
+
key?: string | undefined;
|
|
992
|
+
/** Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported. */
|
|
993
|
+
renewalPeriod?: string | undefined;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export interface Route {
|
|
997
|
+
/** The name of the served model this route configures traffic for. */
|
|
998
|
+
servedModelName?: string | undefined;
|
|
999
|
+
/** The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive. */
|
|
1000
|
+
trafficPercentage?: number | undefined;
|
|
1001
|
+
servedEntityName?: string | undefined;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
export interface ServedModel {
|
|
1005
|
+
/** The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. */
|
|
1006
|
+
name?: string | undefined;
|
|
1007
|
+
/** The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with the latter set being used for custom model serving for a <Databricks> registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same. */
|
|
1008
|
+
externalModel?: ExternalModel | undefined;
|
|
1009
|
+
/** The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**. */
|
|
1010
|
+
entityName?: string | undefined;
|
|
1011
|
+
entityVersion?: string | undefined;
|
|
1012
|
+
/** The minimum tokens per second that the endpoint can scale down to. */
|
|
1013
|
+
minProvisionedThroughput?: number | undefined;
|
|
1014
|
+
/** The maximum tokens per second that the endpoint can scale up to. */
|
|
1015
|
+
maxProvisionedThroughput?: number | undefined;
|
|
1016
|
+
/** The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified. */
|
|
1017
|
+
minProvisionedConcurrency?: number | undefined;
|
|
1018
|
+
/** The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified. */
|
|
1019
|
+
maxProvisionedConcurrency?: number | undefined;
|
|
1020
|
+
/** The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified. */
|
|
1021
|
+
workloadSize?: string | undefined;
|
|
1022
|
+
/** The number of model units provisioned. */
|
|
1023
|
+
provisionedModelUnits?: bigint | undefined;
|
|
1024
|
+
/**
|
|
1025
|
+
* Whether burst scaling is enabled. When enabled (default), the endpoint can automatically
|
|
1026
|
+
* scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint
|
|
1027
|
+
* maintains fixed capacity at provisioned_model_units.
|
|
1028
|
+
*/
|
|
1029
|
+
burstScalingEnabled?: boolean | undefined;
|
|
1030
|
+
/** Whether the compute resources for the served entity should scale down to zero. */
|
|
1031
|
+
scaleToZeroEnabled?: boolean | undefined;
|
|
1032
|
+
modelName?: string | undefined;
|
|
1033
|
+
modelVersion?: string | undefined;
|
|
1034
|
+
/** An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to <Databricks> secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}` */
|
|
1035
|
+
environmentVars?: Record<string, string> | undefined;
|
|
1036
|
+
/** ARN of the instance profile that the served entity uses to access AWS resources. */
|
|
1037
|
+
instanceProfileArn?: string | undefined;
|
|
1038
|
+
foundationModel?: FoundationModel | undefined;
|
|
1039
|
+
state?: ServedModelState | undefined;
|
|
1040
|
+
creator?: string | undefined;
|
|
1041
|
+
creationTimestamp?: bigint | undefined;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1045
|
+
export interface ServedModel_EnvironmentVarsEntry {
|
|
1046
|
+
/** Name of the environment variable (e.g., OPENAI_API_KEY). */
|
|
1047
|
+
key?: string | undefined;
|
|
1048
|
+
/**
|
|
1049
|
+
* Value of the environment variable. To set secret environment variable that loads and uses
|
|
1050
|
+
* databricks secret, the value format must be "{{secrets/secret_scope/secret_key}}".
|
|
1051
|
+
* The secret_scope must be replaced with the scope of the secret and secret_key
|
|
1052
|
+
* must be replaced with the key of the secret.
|
|
1053
|
+
*/
|
|
1054
|
+
value?: string | undefined;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
export interface ServedModelLite {
|
|
1058
|
+
name?: string | undefined;
|
|
1059
|
+
/** Only one of model_name and entity_name should be populated */
|
|
1060
|
+
modelName?: string | undefined;
|
|
1061
|
+
entityName?: string | undefined;
|
|
1062
|
+
/** Only one of model_version and entity_version should be populated */
|
|
1063
|
+
modelVersion?: string | undefined;
|
|
1064
|
+
entityVersion?: string | undefined;
|
|
1065
|
+
externalModel?: ExternalModel | undefined;
|
|
1066
|
+
foundationModel?: FoundationModel | undefined;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
export interface ServedModelState {
|
|
1070
|
+
deployment?: ServedModelDeploymentState | undefined;
|
|
1071
|
+
deploymentStateMessage?: string | undefined;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
export interface TrafficConfig {
|
|
1075
|
+
/** The list of routes that define traffic to each served entity. */
|
|
1076
|
+
routes?: Route[] | undefined;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
export interface UpdateInferenceEndpointNotificationsRequest {
|
|
1080
|
+
/** The name of the serving endpoint whose notifications are being updated. This field is required. */
|
|
1081
|
+
name?: string | undefined;
|
|
1082
|
+
/** The email notification settings to update. Specify email addresses to notify when endpoint state changes occur. */
|
|
1083
|
+
emailNotifications?: EmailNotifications | undefined;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1087
|
+
export interface UpdateInferenceEndpointNotificationsRequest_Response {
|
|
1088
|
+
name?: string | undefined;
|
|
1089
|
+
emailNotifications?: EmailNotifications | undefined;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
export interface UsageTrackingConfig {
|
|
1093
|
+
/** Whether to enable usage tracking. */
|
|
1094
|
+
enabled?: boolean | undefined;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
export const unmarshalAi21LabsConfigSchema: z.ZodType<Ai21LabsConfig> = z
|
|
1098
|
+
.object({
|
|
1099
|
+
ai21labs_api_key: z.string().optional(),
|
|
1100
|
+
ai21labs_api_key_plaintext: z.string().optional(),
|
|
1101
|
+
})
|
|
1102
|
+
.transform(d => ({
|
|
1103
|
+
ai21labsApiKey: d.ai21labs_api_key,
|
|
1104
|
+
ai21labsApiKeyPlaintext: d.ai21labs_api_key_plaintext,
|
|
1105
|
+
}));
|
|
1106
|
+
|
|
1107
|
+
export const unmarshalAiGatewayConfigSchema: z.ZodType<AiGatewayConfig> = z
|
|
1108
|
+
.object({
|
|
1109
|
+
usage_tracking_config: z
|
|
1110
|
+
.lazy(() => unmarshalUsageTrackingConfigSchema)
|
|
1111
|
+
.optional(),
|
|
1112
|
+
inference_table_config: z
|
|
1113
|
+
.lazy(() => unmarshalInferenceTableConfigSchema)
|
|
1114
|
+
.optional(),
|
|
1115
|
+
rate_limits: z
|
|
1116
|
+
.array(z.lazy(() => unmarshalAiGatewayRateLimitSchema))
|
|
1117
|
+
.optional(),
|
|
1118
|
+
guardrails: z.lazy(() => unmarshalAiGuardrailsSchema).optional(),
|
|
1119
|
+
fallback_config: z.lazy(() => unmarshalFallbackConfigSchema).optional(),
|
|
1120
|
+
})
|
|
1121
|
+
.transform(d => ({
|
|
1122
|
+
usageTrackingConfig: d.usage_tracking_config,
|
|
1123
|
+
inferenceTableConfig: d.inference_table_config,
|
|
1124
|
+
rateLimits: d.rate_limits,
|
|
1125
|
+
guardrails: d.guardrails,
|
|
1126
|
+
fallbackConfig: d.fallback_config,
|
|
1127
|
+
}));
|
|
1128
|
+
|
|
1129
|
+
export const unmarshalAiGatewayRateLimitSchema: z.ZodType<AiGatewayRateLimit> =
|
|
1130
|
+
z
|
|
1131
|
+
.object({
|
|
1132
|
+
calls: z
|
|
1133
|
+
.union([z.number(), z.bigint()])
|
|
1134
|
+
.transform(v => BigInt(v))
|
|
1135
|
+
.optional(),
|
|
1136
|
+
key: z.string().optional(),
|
|
1137
|
+
renewal_period: z.string().optional(),
|
|
1138
|
+
principal: z.string().optional(),
|
|
1139
|
+
tokens: z
|
|
1140
|
+
.union([z.number(), z.bigint()])
|
|
1141
|
+
.transform(v => BigInt(v))
|
|
1142
|
+
.optional(),
|
|
1143
|
+
})
|
|
1144
|
+
.transform(d => ({
|
|
1145
|
+
calls: d.calls,
|
|
1146
|
+
key: d.key,
|
|
1147
|
+
renewalPeriod: d.renewal_period,
|
|
1148
|
+
principal: d.principal,
|
|
1149
|
+
tokens: d.tokens,
|
|
1150
|
+
}));
|
|
1151
|
+
|
|
1152
|
+
export const unmarshalAiGuardrailParametersSchema: z.ZodType<AiGuardrailParameters> =
|
|
1153
|
+
z
|
|
1154
|
+
.object({
|
|
1155
|
+
safety: z.boolean().optional(),
|
|
1156
|
+
pii: z.lazy(() => unmarshalPiiSettingsSchema).optional(),
|
|
1157
|
+
valid_topics: z.array(z.string()).optional(),
|
|
1158
|
+
invalid_keywords: z.array(z.string()).optional(),
|
|
1159
|
+
})
|
|
1160
|
+
.transform(d => ({
|
|
1161
|
+
safety: d.safety,
|
|
1162
|
+
pii: d.pii,
|
|
1163
|
+
validTopics: d.valid_topics,
|
|
1164
|
+
invalidKeywords: d.invalid_keywords,
|
|
1165
|
+
}));
|
|
1166
|
+
|
|
1167
|
+
export const unmarshalAiGuardrailsSchema: z.ZodType<AiGuardrails> = z
|
|
1168
|
+
.object({
|
|
1169
|
+
input: z.lazy(() => unmarshalAiGuardrailParametersSchema).optional(),
|
|
1170
|
+
output: z.lazy(() => unmarshalAiGuardrailParametersSchema).optional(),
|
|
1171
|
+
})
|
|
1172
|
+
.transform(d => ({
|
|
1173
|
+
input: d.input,
|
|
1174
|
+
output: d.output,
|
|
1175
|
+
}));
|
|
1176
|
+
|
|
1177
|
+
export const unmarshalAmazonBedrockConfigSchema: z.ZodType<AmazonBedrockConfig> =
|
|
1178
|
+
z
|
|
1179
|
+
.object({
|
|
1180
|
+
aws_region: z.string().optional(),
|
|
1181
|
+
aws_access_key_id: z.string().optional(),
|
|
1182
|
+
aws_secret_access_key: z.string().optional(),
|
|
1183
|
+
bedrock_provider: z.string().optional(),
|
|
1184
|
+
aws_access_key_id_plaintext: z.string().optional(),
|
|
1185
|
+
aws_secret_access_key_plaintext: z.string().optional(),
|
|
1186
|
+
instance_profile_arn: z.string().optional(),
|
|
1187
|
+
})
|
|
1188
|
+
.transform(d => ({
|
|
1189
|
+
awsRegion: d.aws_region,
|
|
1190
|
+
awsAccessKeyId: d.aws_access_key_id,
|
|
1191
|
+
awsSecretAccessKey: d.aws_secret_access_key,
|
|
1192
|
+
bedrockProvider: d.bedrock_provider,
|
|
1193
|
+
awsAccessKeyIdPlaintext: d.aws_access_key_id_plaintext,
|
|
1194
|
+
awsSecretAccessKeyPlaintext: d.aws_secret_access_key_plaintext,
|
|
1195
|
+
instanceProfileArn: d.instance_profile_arn,
|
|
1196
|
+
}));
|
|
1197
|
+
|
|
1198
|
+
export const unmarshalAnthropicConfigSchema: z.ZodType<AnthropicConfig> = z
|
|
1199
|
+
.object({
|
|
1200
|
+
anthropic_api_key: z.string().optional(),
|
|
1201
|
+
anthropic_api_key_plaintext: z.string().optional(),
|
|
1202
|
+
})
|
|
1203
|
+
.transform(d => ({
|
|
1204
|
+
anthropicApiKey: d.anthropic_api_key,
|
|
1205
|
+
anthropicApiKeyPlaintext: d.anthropic_api_key_plaintext,
|
|
1206
|
+
}));
|
|
1207
|
+
|
|
1208
|
+
export const unmarshalApiKeyAuthSchema: z.ZodType<ApiKeyAuth> = z
|
|
1209
|
+
.object({
|
|
1210
|
+
key: z.string().optional(),
|
|
1211
|
+
value: z.string().optional(),
|
|
1212
|
+
value_plaintext: z.string().optional(),
|
|
1213
|
+
})
|
|
1214
|
+
.transform(d => ({
|
|
1215
|
+
key: d.key,
|
|
1216
|
+
value: d.value,
|
|
1217
|
+
valuePlaintext: d.value_plaintext,
|
|
1218
|
+
}));
|
|
1219
|
+
|
|
1220
|
+
export const unmarshalAutoCaptureConfigSchema: z.ZodType<AutoCaptureConfig> = z
|
|
1221
|
+
.object({
|
|
1222
|
+
catalog_name: z.string().optional(),
|
|
1223
|
+
schema_name: z.string().optional(),
|
|
1224
|
+
table_name_prefix: z.string().optional(),
|
|
1225
|
+
state: z.lazy(() => unmarshalAutoCaptureStateSchema).optional(),
|
|
1226
|
+
enabled: z.boolean().optional(),
|
|
1227
|
+
})
|
|
1228
|
+
.transform(d => ({
|
|
1229
|
+
catalogName: d.catalog_name,
|
|
1230
|
+
schemaName: d.schema_name,
|
|
1231
|
+
tableNamePrefix: d.table_name_prefix,
|
|
1232
|
+
state: d.state,
|
|
1233
|
+
enabled: d.enabled,
|
|
1234
|
+
}));
|
|
1235
|
+
|
|
1236
|
+
export const unmarshalAutoCaptureStateSchema: z.ZodType<AutoCaptureState> = z
|
|
1237
|
+
.object({
|
|
1238
|
+
payload_table: z.lazy(() => unmarshalPayloadTableSchema).optional(),
|
|
1239
|
+
})
|
|
1240
|
+
.transform(d => ({
|
|
1241
|
+
payloadTable: d.payload_table,
|
|
1242
|
+
}));
|
|
1243
|
+
|
|
1244
|
+
export const unmarshalBearerTokenAuthSchema: z.ZodType<BearerTokenAuth> = z
|
|
1245
|
+
.object({
|
|
1246
|
+
token: z.string().optional(),
|
|
1247
|
+
token_plaintext: z.string().optional(),
|
|
1248
|
+
})
|
|
1249
|
+
.transform(d => ({
|
|
1250
|
+
token: d.token,
|
|
1251
|
+
tokenPlaintext: d.token_plaintext,
|
|
1252
|
+
}));
|
|
1253
|
+
|
|
1254
|
+
export const unmarshalCohereConfigSchema: z.ZodType<CohereConfig> = z
|
|
1255
|
+
.object({
|
|
1256
|
+
cohere_api_key: z.string().optional(),
|
|
1257
|
+
cohere_api_key_plaintext: z.string().optional(),
|
|
1258
|
+
cohere_api_base: z.string().optional(),
|
|
1259
|
+
})
|
|
1260
|
+
.transform(d => ({
|
|
1261
|
+
cohereApiKey: d.cohere_api_key,
|
|
1262
|
+
cohereApiKeyPlaintext: d.cohere_api_key_plaintext,
|
|
1263
|
+
cohereApiBase: d.cohere_api_base,
|
|
1264
|
+
}));
|
|
1265
|
+
|
|
1266
|
+
export const unmarshalCustomProviderConfigSchema: z.ZodType<CustomProviderConfig> =
|
|
1267
|
+
z
|
|
1268
|
+
.object({
|
|
1269
|
+
custom_provider_url: z.string().optional(),
|
|
1270
|
+
bearer_token_auth: z
|
|
1271
|
+
.lazy(() => unmarshalBearerTokenAuthSchema)
|
|
1272
|
+
.optional(),
|
|
1273
|
+
api_key_auth: z.lazy(() => unmarshalApiKeyAuthSchema).optional(),
|
|
1274
|
+
})
|
|
1275
|
+
.transform(d => ({
|
|
1276
|
+
customProviderUrl: d.custom_provider_url,
|
|
1277
|
+
bearerTokenAuth: d.bearer_token_auth,
|
|
1278
|
+
apiKeyAuth: d.api_key_auth,
|
|
1279
|
+
}));
|
|
1280
|
+
|
|
1281
|
+
export const unmarshalDataPlaneInfoSchema: z.ZodType<DataPlaneInfo> = z
|
|
1282
|
+
.object({
|
|
1283
|
+
endpoint_url: z.string().optional(),
|
|
1284
|
+
authorization_details: z.string().optional(),
|
|
1285
|
+
})
|
|
1286
|
+
.transform(d => ({
|
|
1287
|
+
endpointUrl: d.endpoint_url,
|
|
1288
|
+
authorizationDetails: d.authorization_details,
|
|
1289
|
+
}));
|
|
1290
|
+
|
|
1291
|
+
export const unmarshalDatabricksModelServingConfigSchema: z.ZodType<DatabricksModelServingConfig> =
|
|
1292
|
+
z
|
|
1293
|
+
.object({
|
|
1294
|
+
databricks_api_token: z.string().optional(),
|
|
1295
|
+
databricks_workspace_url: z.string().optional(),
|
|
1296
|
+
databricks_api_token_plaintext: z.string().optional(),
|
|
1297
|
+
})
|
|
1298
|
+
.transform(d => ({
|
|
1299
|
+
databricksApiToken: d.databricks_api_token,
|
|
1300
|
+
databricksWorkspaceUrl: d.databricks_workspace_url,
|
|
1301
|
+
databricksApiTokenPlaintext: d.databricks_api_token_plaintext,
|
|
1302
|
+
}));
|
|
1303
|
+
|
|
1304
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1305
|
+
export const unmarshalDeleteInferenceEndpointRequest_ResponseSchema: z.ZodType<DeleteInferenceEndpointRequest_Response> =
|
|
1306
|
+
z.object({});
|
|
1307
|
+
|
|
1308
|
+
export const unmarshalEmailNotificationsSchema: z.ZodType<EmailNotifications> =
|
|
1309
|
+
z
|
|
1310
|
+
.object({
|
|
1311
|
+
on_update_success: z.array(z.string()).optional(),
|
|
1312
|
+
on_update_failure: z.array(z.string()).optional(),
|
|
1313
|
+
})
|
|
1314
|
+
.transform(d => ({
|
|
1315
|
+
onUpdateSuccess: d.on_update_success,
|
|
1316
|
+
onUpdateFailure: d.on_update_failure,
|
|
1317
|
+
}));
|
|
1318
|
+
|
|
1319
|
+
export const unmarshalEndpointCoreConfigOutputSchema: z.ZodType<EndpointCoreConfigOutput> =
|
|
1320
|
+
z
|
|
1321
|
+
.object({
|
|
1322
|
+
config_version: z
|
|
1323
|
+
.union([z.number(), z.bigint()])
|
|
1324
|
+
.transform(v => BigInt(v))
|
|
1325
|
+
.optional(),
|
|
1326
|
+
served_entities: z
|
|
1327
|
+
.array(z.lazy(() => unmarshalServedModelSchema))
|
|
1328
|
+
.optional(),
|
|
1329
|
+
served_models: z
|
|
1330
|
+
.array(z.lazy(() => unmarshalServedModelSchema))
|
|
1331
|
+
.optional(),
|
|
1332
|
+
traffic_config: z.lazy(() => unmarshalTrafficConfigSchema).optional(),
|
|
1333
|
+
auto_capture_config: z
|
|
1334
|
+
.lazy(() => unmarshalAutoCaptureConfigSchema)
|
|
1335
|
+
.optional(),
|
|
1336
|
+
})
|
|
1337
|
+
.transform(d => ({
|
|
1338
|
+
configVersion: d.config_version,
|
|
1339
|
+
servedEntities: d.served_entities,
|
|
1340
|
+
servedModels: d.served_models,
|
|
1341
|
+
trafficConfig: d.traffic_config,
|
|
1342
|
+
autoCaptureConfig: d.auto_capture_config,
|
|
1343
|
+
}));
|
|
1344
|
+
|
|
1345
|
+
export const unmarshalEndpointCoreConfigSummarySchema: z.ZodType<EndpointCoreConfigSummary> =
|
|
1346
|
+
z
|
|
1347
|
+
.object({
|
|
1348
|
+
served_entities: z
|
|
1349
|
+
.array(z.lazy(() => unmarshalServedModelLiteSchema))
|
|
1350
|
+
.optional(),
|
|
1351
|
+
served_models: z
|
|
1352
|
+
.array(z.lazy(() => unmarshalServedModelLiteSchema))
|
|
1353
|
+
.optional(),
|
|
1354
|
+
})
|
|
1355
|
+
.transform(d => ({
|
|
1356
|
+
servedEntities: d.served_entities,
|
|
1357
|
+
servedModels: d.served_models,
|
|
1358
|
+
}));
|
|
1359
|
+
|
|
1360
|
+
export const unmarshalEndpointTagSchema: z.ZodType<EndpointTag> = z
|
|
1361
|
+
.object({
|
|
1362
|
+
key: z.string().optional(),
|
|
1363
|
+
value: z.string().optional(),
|
|
1364
|
+
})
|
|
1365
|
+
.transform(d => ({
|
|
1366
|
+
key: d.key,
|
|
1367
|
+
value: d.value,
|
|
1368
|
+
}));
|
|
1369
|
+
|
|
1370
|
+
export const unmarshalExternalModelSchema: z.ZodType<ExternalModel> = z
|
|
1371
|
+
.object({
|
|
1372
|
+
provider: z.string().optional(),
|
|
1373
|
+
name: z.string().optional(),
|
|
1374
|
+
task: z.string().optional(),
|
|
1375
|
+
ai21labs_config: z.lazy(() => unmarshalAi21LabsConfigSchema).optional(),
|
|
1376
|
+
anthropic_config: z.lazy(() => unmarshalAnthropicConfigSchema).optional(),
|
|
1377
|
+
amazon_bedrock_config: z
|
|
1378
|
+
.lazy(() => unmarshalAmazonBedrockConfigSchema)
|
|
1379
|
+
.optional(),
|
|
1380
|
+
cohere_config: z.lazy(() => unmarshalCohereConfigSchema).optional(),
|
|
1381
|
+
google_cloud_vertex_ai_config: z
|
|
1382
|
+
.lazy(() => unmarshalGoogleCloudVertexAiConfigSchema)
|
|
1383
|
+
.optional(),
|
|
1384
|
+
databricks_model_serving_config: z
|
|
1385
|
+
.lazy(() => unmarshalDatabricksModelServingConfigSchema)
|
|
1386
|
+
.optional(),
|
|
1387
|
+
openai_config: z.lazy(() => unmarshalOpenAiConfigSchema).optional(),
|
|
1388
|
+
palm_config: z.lazy(() => unmarshalPaLmConfigSchema).optional(),
|
|
1389
|
+
custom_provider_config: z
|
|
1390
|
+
.lazy(() => unmarshalCustomProviderConfigSchema)
|
|
1391
|
+
.optional(),
|
|
1392
|
+
})
|
|
1393
|
+
.transform(d => ({
|
|
1394
|
+
provider: d.provider,
|
|
1395
|
+
name: d.name,
|
|
1396
|
+
task: d.task,
|
|
1397
|
+
config:
|
|
1398
|
+
d.ai21labs_config !== undefined
|
|
1399
|
+
? {$case: 'ai21labsConfig' as const, ai21labsConfig: d.ai21labs_config}
|
|
1400
|
+
: d.anthropic_config !== undefined
|
|
1401
|
+
? {
|
|
1402
|
+
$case: 'anthropicConfig' as const,
|
|
1403
|
+
anthropicConfig: d.anthropic_config,
|
|
1404
|
+
}
|
|
1405
|
+
: d.amazon_bedrock_config !== undefined
|
|
1406
|
+
? {
|
|
1407
|
+
$case: 'amazonBedrockConfig' as const,
|
|
1408
|
+
amazonBedrockConfig: d.amazon_bedrock_config,
|
|
1409
|
+
}
|
|
1410
|
+
: d.cohere_config !== undefined
|
|
1411
|
+
? {$case: 'cohereConfig' as const, cohereConfig: d.cohere_config}
|
|
1412
|
+
: d.google_cloud_vertex_ai_config !== undefined
|
|
1413
|
+
? {
|
|
1414
|
+
$case: 'googleCloudVertexAiConfig' as const,
|
|
1415
|
+
googleCloudVertexAiConfig: d.google_cloud_vertex_ai_config,
|
|
1416
|
+
}
|
|
1417
|
+
: d.databricks_model_serving_config !== undefined
|
|
1418
|
+
? {
|
|
1419
|
+
$case: 'databricksModelServingConfig' as const,
|
|
1420
|
+
databricksModelServingConfig:
|
|
1421
|
+
d.databricks_model_serving_config,
|
|
1422
|
+
}
|
|
1423
|
+
: d.openai_config !== undefined
|
|
1424
|
+
? {
|
|
1425
|
+
$case: 'openaiConfig' as const,
|
|
1426
|
+
openaiConfig: d.openai_config,
|
|
1427
|
+
}
|
|
1428
|
+
: d.palm_config !== undefined
|
|
1429
|
+
? {
|
|
1430
|
+
$case: 'palmConfig' as const,
|
|
1431
|
+
palmConfig: d.palm_config,
|
|
1432
|
+
}
|
|
1433
|
+
: d.custom_provider_config !== undefined
|
|
1434
|
+
? {
|
|
1435
|
+
$case: 'customProviderConfig' as const,
|
|
1436
|
+
customProviderConfig: d.custom_provider_config,
|
|
1437
|
+
}
|
|
1438
|
+
: undefined,
|
|
1439
|
+
}));
|
|
1440
|
+
|
|
1441
|
+
export const unmarshalFallbackConfigSchema: z.ZodType<FallbackConfig> = z
|
|
1442
|
+
.object({
|
|
1443
|
+
enabled: z.boolean().optional(),
|
|
1444
|
+
})
|
|
1445
|
+
.transform(d => ({
|
|
1446
|
+
enabled: d.enabled,
|
|
1447
|
+
}));
|
|
1448
|
+
|
|
1449
|
+
export const unmarshalFoundationModelSchema: z.ZodType<FoundationModel> = z
|
|
1450
|
+
.object({
|
|
1451
|
+
name: z.string().optional(),
|
|
1452
|
+
display_name: z.string().optional(),
|
|
1453
|
+
docs: z.string().optional(),
|
|
1454
|
+
description: z.string().optional(),
|
|
1455
|
+
})
|
|
1456
|
+
.transform(d => ({
|
|
1457
|
+
name: d.name,
|
|
1458
|
+
displayName: d.display_name,
|
|
1459
|
+
docs: d.docs,
|
|
1460
|
+
description: d.description,
|
|
1461
|
+
}));
|
|
1462
|
+
|
|
1463
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1464
|
+
export const unmarshalGetServedModelBuildLogsRequest_ResponseSchema: z.ZodType<GetServedModelBuildLogsRequest_Response> =
|
|
1465
|
+
z
|
|
1466
|
+
.object({
|
|
1467
|
+
logs: z.string().optional(),
|
|
1468
|
+
})
|
|
1469
|
+
.transform(d => ({
|
|
1470
|
+
logs: d.logs,
|
|
1471
|
+
}));
|
|
1472
|
+
|
|
1473
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1474
|
+
export const unmarshalGetServedModelLogsRequest_ResponseSchema: z.ZodType<GetServedModelLogsRequest_Response> =
|
|
1475
|
+
z
|
|
1476
|
+
.object({
|
|
1477
|
+
logs: z.string().optional(),
|
|
1478
|
+
})
|
|
1479
|
+
.transform(d => ({
|
|
1480
|
+
logs: d.logs,
|
|
1481
|
+
}));
|
|
1482
|
+
|
|
1483
|
+
export const unmarshalGoogleCloudVertexAiConfigSchema: z.ZodType<GoogleCloudVertexAiConfig> =
|
|
1484
|
+
z
|
|
1485
|
+
.object({
|
|
1486
|
+
private_key: z.string().optional(),
|
|
1487
|
+
project_id: z.string().optional(),
|
|
1488
|
+
region: z.string().optional(),
|
|
1489
|
+
private_key_plaintext: z.string().optional(),
|
|
1490
|
+
})
|
|
1491
|
+
.transform(d => ({
|
|
1492
|
+
privateKey: d.private_key,
|
|
1493
|
+
projectId: d.project_id,
|
|
1494
|
+
region: d.region,
|
|
1495
|
+
privateKeyPlaintext: d.private_key_plaintext,
|
|
1496
|
+
}));
|
|
1497
|
+
|
|
1498
|
+
export const unmarshalInferenceEndpointSchema: z.ZodType<InferenceEndpoint> = z
|
|
1499
|
+
.object({
|
|
1500
|
+
name: z.string().optional(),
|
|
1501
|
+
creator: z.string().optional(),
|
|
1502
|
+
creation_timestamp: z
|
|
1503
|
+
.union([z.number(), z.bigint()])
|
|
1504
|
+
.transform(v => BigInt(v))
|
|
1505
|
+
.optional(),
|
|
1506
|
+
last_updated_timestamp: z
|
|
1507
|
+
.union([z.number(), z.bigint()])
|
|
1508
|
+
.transform(v => BigInt(v))
|
|
1509
|
+
.optional(),
|
|
1510
|
+
state: z.lazy(() => unmarshalInferenceEndpointStateSchema).optional(),
|
|
1511
|
+
config: z.lazy(() => unmarshalEndpointCoreConfigSummarySchema).optional(),
|
|
1512
|
+
tags: z.array(z.lazy(() => unmarshalEndpointTagSchema)).optional(),
|
|
1513
|
+
id: z.string().optional(),
|
|
1514
|
+
task: z.string().optional(),
|
|
1515
|
+
ai_gateway: z.lazy(() => unmarshalAiGatewayConfigSchema).optional(),
|
|
1516
|
+
budget_policy_id: z.string().optional(),
|
|
1517
|
+
description: z.string().optional(),
|
|
1518
|
+
usage_policy_id: z.string().optional(),
|
|
1519
|
+
})
|
|
1520
|
+
.transform(d => ({
|
|
1521
|
+
name: d.name,
|
|
1522
|
+
creator: d.creator,
|
|
1523
|
+
creationTimestamp: d.creation_timestamp,
|
|
1524
|
+
lastUpdatedTimestamp: d.last_updated_timestamp,
|
|
1525
|
+
state: d.state,
|
|
1526
|
+
config: d.config,
|
|
1527
|
+
tags: d.tags,
|
|
1528
|
+
id: d.id,
|
|
1529
|
+
task: d.task,
|
|
1530
|
+
aiGateway: d.ai_gateway,
|
|
1531
|
+
budgetPolicyId: d.budget_policy_id,
|
|
1532
|
+
description: d.description,
|
|
1533
|
+
usagePolicyId: d.usage_policy_id,
|
|
1534
|
+
}));
|
|
1535
|
+
|
|
1536
|
+
export const unmarshalInferenceEndpointDetailedSchema: z.ZodType<InferenceEndpointDetailed> =
|
|
1537
|
+
z
|
|
1538
|
+
.object({
|
|
1539
|
+
name: z.string().optional(),
|
|
1540
|
+
creator: z.string().optional(),
|
|
1541
|
+
creation_timestamp: z
|
|
1542
|
+
.union([z.number(), z.bigint()])
|
|
1543
|
+
.transform(v => BigInt(v))
|
|
1544
|
+
.optional(),
|
|
1545
|
+
last_updated_timestamp: z
|
|
1546
|
+
.union([z.number(), z.bigint()])
|
|
1547
|
+
.transform(v => BigInt(v))
|
|
1548
|
+
.optional(),
|
|
1549
|
+
state: z.lazy(() => unmarshalInferenceEndpointStateSchema).optional(),
|
|
1550
|
+
config: z.lazy(() => unmarshalEndpointCoreConfigOutputSchema).optional(),
|
|
1551
|
+
pending_config: z.lazy(() => unmarshalPendingConfigSchema).optional(),
|
|
1552
|
+
id: z.string().optional(),
|
|
1553
|
+
permission_level: z
|
|
1554
|
+
.enum(ServingEndpointDetailedPermissionLevel)
|
|
1555
|
+
.optional(),
|
|
1556
|
+
tags: z.array(z.lazy(() => unmarshalEndpointTagSchema)).optional(),
|
|
1557
|
+
task: z.string().optional(),
|
|
1558
|
+
route_optimized: z.boolean().optional(),
|
|
1559
|
+
endpoint_url: z.string().optional(),
|
|
1560
|
+
data_plane_info: z
|
|
1561
|
+
.lazy(() => unmarshalModelDataPlaneInfoSchema)
|
|
1562
|
+
.optional(),
|
|
1563
|
+
ai_gateway: z.lazy(() => unmarshalAiGatewayConfigSchema).optional(),
|
|
1564
|
+
budget_policy_id: z.string().optional(),
|
|
1565
|
+
email_notifications: z
|
|
1566
|
+
.lazy(() => unmarshalEmailNotificationsSchema)
|
|
1567
|
+
.optional(),
|
|
1568
|
+
description: z.string().optional(),
|
|
1569
|
+
})
|
|
1570
|
+
.transform(d => ({
|
|
1571
|
+
name: d.name,
|
|
1572
|
+
creator: d.creator,
|
|
1573
|
+
creationTimestamp: d.creation_timestamp,
|
|
1574
|
+
lastUpdatedTimestamp: d.last_updated_timestamp,
|
|
1575
|
+
state: d.state,
|
|
1576
|
+
config: d.config,
|
|
1577
|
+
pendingConfig: d.pending_config,
|
|
1578
|
+
id: d.id,
|
|
1579
|
+
permissionLevel: d.permission_level,
|
|
1580
|
+
tags: d.tags,
|
|
1581
|
+
task: d.task,
|
|
1582
|
+
routeOptimized: d.route_optimized,
|
|
1583
|
+
endpointUrl: d.endpoint_url,
|
|
1584
|
+
dataPlaneInfo: d.data_plane_info,
|
|
1585
|
+
aiGateway: d.ai_gateway,
|
|
1586
|
+
budgetPolicyId: d.budget_policy_id,
|
|
1587
|
+
emailNotifications: d.email_notifications,
|
|
1588
|
+
description: d.description,
|
|
1589
|
+
}));
|
|
1590
|
+
|
|
1591
|
+
export const unmarshalInferenceEndpointStateSchema: z.ZodType<InferenceEndpointState> =
|
|
1592
|
+
z
|
|
1593
|
+
.object({
|
|
1594
|
+
ready: z.enum(InferenceEndpointState_ReadyState).optional(),
|
|
1595
|
+
config_update: z
|
|
1596
|
+
.enum(InferenceEndpointState_ConfigUpdateState)
|
|
1597
|
+
.optional(),
|
|
1598
|
+
})
|
|
1599
|
+
.transform(d => ({
|
|
1600
|
+
ready: d.ready,
|
|
1601
|
+
configUpdate: d.config_update,
|
|
1602
|
+
}));
|
|
1603
|
+
|
|
1604
|
+
export const unmarshalInferenceTableConfigSchema: z.ZodType<InferenceTableConfig> =
|
|
1605
|
+
z
|
|
1606
|
+
.object({
|
|
1607
|
+
catalog_name: z.string().optional(),
|
|
1608
|
+
schema_name: z.string().optional(),
|
|
1609
|
+
table_name_prefix: z.string().optional(),
|
|
1610
|
+
enabled: z.boolean().optional(),
|
|
1611
|
+
})
|
|
1612
|
+
.transform(d => ({
|
|
1613
|
+
catalogName: d.catalog_name,
|
|
1614
|
+
schemaName: d.schema_name,
|
|
1615
|
+
tableNamePrefix: d.table_name_prefix,
|
|
1616
|
+
enabled: d.enabled,
|
|
1617
|
+
}));
|
|
1618
|
+
|
|
1619
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1620
|
+
export const unmarshalListInferenceEndpointsRequest_ResponseSchema: z.ZodType<ListInferenceEndpointsRequest_Response> =
|
|
1621
|
+
z
|
|
1622
|
+
.object({
|
|
1623
|
+
endpoints: z
|
|
1624
|
+
.array(z.lazy(() => unmarshalInferenceEndpointSchema))
|
|
1625
|
+
.optional(),
|
|
1626
|
+
})
|
|
1627
|
+
.transform(d => ({
|
|
1628
|
+
endpoints: d.endpoints,
|
|
1629
|
+
}));
|
|
1630
|
+
|
|
1631
|
+
export const unmarshalModelDataPlaneInfoSchema: z.ZodType<ModelDataPlaneInfo> =
|
|
1632
|
+
z
|
|
1633
|
+
.object({
|
|
1634
|
+
query_info: z.lazy(() => unmarshalDataPlaneInfoSchema).optional(),
|
|
1635
|
+
})
|
|
1636
|
+
.transform(d => ({
|
|
1637
|
+
queryInfo: d.query_info,
|
|
1638
|
+
}));
|
|
1639
|
+
|
|
1640
|
+
export const unmarshalOpenAiConfigSchema: z.ZodType<OpenAiConfig> = z
|
|
1641
|
+
.object({
|
|
1642
|
+
openai_api_key: z.string().optional(),
|
|
1643
|
+
openai_api_type: z.string().optional(),
|
|
1644
|
+
openai_api_base: z.string().optional(),
|
|
1645
|
+
openai_api_version: z.string().optional(),
|
|
1646
|
+
openai_deployment_name: z.string().optional(),
|
|
1647
|
+
openai_organization: z.string().optional(),
|
|
1648
|
+
microsoft_entra_tenant_id: z.string().optional(),
|
|
1649
|
+
microsoft_entra_client_id: z.string().optional(),
|
|
1650
|
+
microsoft_entra_client_secret: z.string().optional(),
|
|
1651
|
+
openai_api_key_plaintext: z.string().optional(),
|
|
1652
|
+
microsoft_entra_client_secret_plaintext: z.string().optional(),
|
|
1653
|
+
})
|
|
1654
|
+
.transform(d => ({
|
|
1655
|
+
openaiApiKey: d.openai_api_key,
|
|
1656
|
+
openaiApiType: d.openai_api_type,
|
|
1657
|
+
openaiApiBase: d.openai_api_base,
|
|
1658
|
+
openaiApiVersion: d.openai_api_version,
|
|
1659
|
+
openaiDeploymentName: d.openai_deployment_name,
|
|
1660
|
+
openaiOrganization: d.openai_organization,
|
|
1661
|
+
microsoftEntraTenantId: d.microsoft_entra_tenant_id,
|
|
1662
|
+
microsoftEntraClientId: d.microsoft_entra_client_id,
|
|
1663
|
+
microsoftEntraClientSecret: d.microsoft_entra_client_secret,
|
|
1664
|
+
openaiApiKeyPlaintext: d.openai_api_key_plaintext,
|
|
1665
|
+
microsoftEntraClientSecretPlaintext:
|
|
1666
|
+
d.microsoft_entra_client_secret_plaintext,
|
|
1667
|
+
}));
|
|
1668
|
+
|
|
1669
|
+
export const unmarshalPaLmConfigSchema: z.ZodType<PaLmConfig> = z
|
|
1670
|
+
.object({
|
|
1671
|
+
palm_api_key: z.string().optional(),
|
|
1672
|
+
palm_api_key_plaintext: z.string().optional(),
|
|
1673
|
+
})
|
|
1674
|
+
.transform(d => ({
|
|
1675
|
+
palmApiKey: d.palm_api_key,
|
|
1676
|
+
palmApiKeyPlaintext: d.palm_api_key_plaintext,
|
|
1677
|
+
}));
|
|
1678
|
+
|
|
1679
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1680
|
+
export const unmarshalPatchInferenceEndpointTagsRequest_ResponseSchema: z.ZodType<PatchInferenceEndpointTagsRequest_Response> =
|
|
1681
|
+
z
|
|
1682
|
+
.object({
|
|
1683
|
+
tags: z.array(z.lazy(() => unmarshalEndpointTagSchema)).optional(),
|
|
1684
|
+
})
|
|
1685
|
+
.transform(d => ({
|
|
1686
|
+
tags: d.tags,
|
|
1687
|
+
}));
|
|
1688
|
+
|
|
1689
|
+
export const unmarshalPayloadTableSchema: z.ZodType<PayloadTable> = z
|
|
1690
|
+
.object({
|
|
1691
|
+
name: z.string().optional(),
|
|
1692
|
+
status: z.string().optional(),
|
|
1693
|
+
status_message: z.string().optional(),
|
|
1694
|
+
})
|
|
1695
|
+
.transform(d => ({
|
|
1696
|
+
name: d.name,
|
|
1697
|
+
status: d.status,
|
|
1698
|
+
statusMessage: d.status_message,
|
|
1699
|
+
}));
|
|
1700
|
+
|
|
1701
|
+
export const unmarshalPendingConfigSchema: z.ZodType<PendingConfig> = z
|
|
1702
|
+
.object({
|
|
1703
|
+
served_entities: z
|
|
1704
|
+
.array(z.lazy(() => unmarshalServedModelSchema))
|
|
1705
|
+
.optional(),
|
|
1706
|
+
served_models: z.array(z.lazy(() => unmarshalServedModelSchema)).optional(),
|
|
1707
|
+
traffic_config: z.lazy(() => unmarshalTrafficConfigSchema).optional(),
|
|
1708
|
+
config_version: z.number().optional(),
|
|
1709
|
+
start_time: z
|
|
1710
|
+
.union([z.number(), z.bigint()])
|
|
1711
|
+
.transform(v => BigInt(v))
|
|
1712
|
+
.optional(),
|
|
1713
|
+
auto_capture_config: z
|
|
1714
|
+
.lazy(() => unmarshalAutoCaptureConfigSchema)
|
|
1715
|
+
.optional(),
|
|
1716
|
+
})
|
|
1717
|
+
.transform(d => ({
|
|
1718
|
+
servedEntities: d.served_entities,
|
|
1719
|
+
servedModels: d.served_models,
|
|
1720
|
+
trafficConfig: d.traffic_config,
|
|
1721
|
+
configVersion: d.config_version,
|
|
1722
|
+
startTime: d.start_time,
|
|
1723
|
+
autoCaptureConfig: d.auto_capture_config,
|
|
1724
|
+
}));
|
|
1725
|
+
|
|
1726
|
+
export const unmarshalPiiSettingsSchema: z.ZodType<PiiSettings> = z
|
|
1727
|
+
.object({
|
|
1728
|
+
behavior: z.enum(Behavior).optional(),
|
|
1729
|
+
})
|
|
1730
|
+
.transform(d => ({
|
|
1731
|
+
behavior: d.behavior,
|
|
1732
|
+
}));
|
|
1733
|
+
|
|
1734
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1735
|
+
export const unmarshalPutInferenceEndpointAiGatewayRequest_ResponseSchema: z.ZodType<PutInferenceEndpointAiGatewayRequest_Response> =
|
|
1736
|
+
z
|
|
1737
|
+
.object({
|
|
1738
|
+
usage_tracking_config: z
|
|
1739
|
+
.lazy(() => unmarshalUsageTrackingConfigSchema)
|
|
1740
|
+
.optional(),
|
|
1741
|
+
inference_table_config: z
|
|
1742
|
+
.lazy(() => unmarshalInferenceTableConfigSchema)
|
|
1743
|
+
.optional(),
|
|
1744
|
+
rate_limits: z
|
|
1745
|
+
.array(z.lazy(() => unmarshalAiGatewayRateLimitSchema))
|
|
1746
|
+
.optional(),
|
|
1747
|
+
guardrails: z.lazy(() => unmarshalAiGuardrailsSchema).optional(),
|
|
1748
|
+
fallback_config: z.lazy(() => unmarshalFallbackConfigSchema).optional(),
|
|
1749
|
+
})
|
|
1750
|
+
.transform(d => ({
|
|
1751
|
+
usageTrackingConfig: d.usage_tracking_config,
|
|
1752
|
+
inferenceTableConfig: d.inference_table_config,
|
|
1753
|
+
rateLimits: d.rate_limits,
|
|
1754
|
+
guardrails: d.guardrails,
|
|
1755
|
+
fallbackConfig: d.fallback_config,
|
|
1756
|
+
}));
|
|
1757
|
+
|
|
1758
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1759
|
+
export const unmarshalPutInferenceEndpointRateLimitsRequest_ResponseSchema: z.ZodType<PutInferenceEndpointRateLimitsRequest_Response> =
|
|
1760
|
+
z
|
|
1761
|
+
.object({
|
|
1762
|
+
rate_limits: z.array(z.lazy(() => unmarshalRateLimitSchema)).optional(),
|
|
1763
|
+
})
|
|
1764
|
+
.transform(d => ({
|
|
1765
|
+
rateLimits: d.rate_limits,
|
|
1766
|
+
}));
|
|
1767
|
+
|
|
1768
|
+
export const unmarshalRateLimitSchema: z.ZodType<RateLimit> = z
|
|
1769
|
+
.object({
|
|
1770
|
+
calls: z
|
|
1771
|
+
.union([z.number(), z.bigint()])
|
|
1772
|
+
.transform(v => BigInt(v))
|
|
1773
|
+
.optional(),
|
|
1774
|
+
key: z.string().optional(),
|
|
1775
|
+
renewal_period: z.string().optional(),
|
|
1776
|
+
})
|
|
1777
|
+
.transform(d => ({
|
|
1778
|
+
calls: d.calls,
|
|
1779
|
+
key: d.key,
|
|
1780
|
+
renewalPeriod: d.renewal_period,
|
|
1781
|
+
}));
|
|
1782
|
+
|
|
1783
|
+
export const unmarshalRouteSchema: z.ZodType<Route> = z
|
|
1784
|
+
.object({
|
|
1785
|
+
served_model_name: z.string().optional(),
|
|
1786
|
+
traffic_percentage: z.number().optional(),
|
|
1787
|
+
served_entity_name: z.string().optional(),
|
|
1788
|
+
})
|
|
1789
|
+
.transform(d => ({
|
|
1790
|
+
servedModelName: d.served_model_name,
|
|
1791
|
+
trafficPercentage: d.traffic_percentage,
|
|
1792
|
+
servedEntityName: d.served_entity_name,
|
|
1793
|
+
}));
|
|
1794
|
+
|
|
1795
|
+
export const unmarshalServedModelSchema: z.ZodType<ServedModel> = z
|
|
1796
|
+
.object({
|
|
1797
|
+
name: z.string().optional(),
|
|
1798
|
+
external_model: z.lazy(() => unmarshalExternalModelSchema).optional(),
|
|
1799
|
+
entity_name: z.string().optional(),
|
|
1800
|
+
entity_version: z.string().optional(),
|
|
1801
|
+
min_provisioned_throughput: z.number().optional(),
|
|
1802
|
+
max_provisioned_throughput: z.number().optional(),
|
|
1803
|
+
min_provisioned_concurrency: z.number().optional(),
|
|
1804
|
+
max_provisioned_concurrency: z.number().optional(),
|
|
1805
|
+
workload_size: z.string().optional(),
|
|
1806
|
+
provisioned_model_units: z
|
|
1807
|
+
.union([z.number(), z.bigint()])
|
|
1808
|
+
.transform(v => BigInt(v))
|
|
1809
|
+
.optional(),
|
|
1810
|
+
burst_scaling_enabled: z.boolean().optional(),
|
|
1811
|
+
scale_to_zero_enabled: z.boolean().optional(),
|
|
1812
|
+
model_name: z.string().optional(),
|
|
1813
|
+
model_version: z.string().optional(),
|
|
1814
|
+
environment_vars: z.record(z.string(), z.string()).optional(),
|
|
1815
|
+
instance_profile_arn: z.string().optional(),
|
|
1816
|
+
foundation_model: z.lazy(() => unmarshalFoundationModelSchema).optional(),
|
|
1817
|
+
state: z.lazy(() => unmarshalServedModelStateSchema).optional(),
|
|
1818
|
+
creator: z.string().optional(),
|
|
1819
|
+
creation_timestamp: z
|
|
1820
|
+
.union([z.number(), z.bigint()])
|
|
1821
|
+
.transform(v => BigInt(v))
|
|
1822
|
+
.optional(),
|
|
1823
|
+
})
|
|
1824
|
+
.transform(d => ({
|
|
1825
|
+
name: d.name,
|
|
1826
|
+
externalModel: d.external_model,
|
|
1827
|
+
entityName: d.entity_name,
|
|
1828
|
+
entityVersion: d.entity_version,
|
|
1829
|
+
minProvisionedThroughput: d.min_provisioned_throughput,
|
|
1830
|
+
maxProvisionedThroughput: d.max_provisioned_throughput,
|
|
1831
|
+
minProvisionedConcurrency: d.min_provisioned_concurrency,
|
|
1832
|
+
maxProvisionedConcurrency: d.max_provisioned_concurrency,
|
|
1833
|
+
workloadSize: d.workload_size,
|
|
1834
|
+
provisionedModelUnits: d.provisioned_model_units,
|
|
1835
|
+
burstScalingEnabled: d.burst_scaling_enabled,
|
|
1836
|
+
scaleToZeroEnabled: d.scale_to_zero_enabled,
|
|
1837
|
+
modelName: d.model_name,
|
|
1838
|
+
modelVersion: d.model_version,
|
|
1839
|
+
environmentVars: d.environment_vars,
|
|
1840
|
+
instanceProfileArn: d.instance_profile_arn,
|
|
1841
|
+
foundationModel: d.foundation_model,
|
|
1842
|
+
state: d.state,
|
|
1843
|
+
creator: d.creator,
|
|
1844
|
+
creationTimestamp: d.creation_timestamp,
|
|
1845
|
+
}));
|
|
1846
|
+
|
|
1847
|
+
export const unmarshalServedModelLiteSchema: z.ZodType<ServedModelLite> = z
|
|
1848
|
+
.object({
|
|
1849
|
+
name: z.string().optional(),
|
|
1850
|
+
model_name: z.string().optional(),
|
|
1851
|
+
entity_name: z.string().optional(),
|
|
1852
|
+
model_version: z.string().optional(),
|
|
1853
|
+
entity_version: z.string().optional(),
|
|
1854
|
+
external_model: z.lazy(() => unmarshalExternalModelSchema).optional(),
|
|
1855
|
+
foundation_model: z.lazy(() => unmarshalFoundationModelSchema).optional(),
|
|
1856
|
+
})
|
|
1857
|
+
.transform(d => ({
|
|
1858
|
+
name: d.name,
|
|
1859
|
+
modelName: d.model_name,
|
|
1860
|
+
entityName: d.entity_name,
|
|
1861
|
+
modelVersion: d.model_version,
|
|
1862
|
+
entityVersion: d.entity_version,
|
|
1863
|
+
externalModel: d.external_model,
|
|
1864
|
+
foundationModel: d.foundation_model,
|
|
1865
|
+
}));
|
|
1866
|
+
|
|
1867
|
+
export const unmarshalServedModelStateSchema: z.ZodType<ServedModelState> = z
|
|
1868
|
+
.object({
|
|
1869
|
+
deployment: z.enum(ServedModelDeploymentState).optional(),
|
|
1870
|
+
deployment_state_message: z.string().optional(),
|
|
1871
|
+
})
|
|
1872
|
+
.transform(d => ({
|
|
1873
|
+
deployment: d.deployment,
|
|
1874
|
+
deploymentStateMessage: d.deployment_state_message,
|
|
1875
|
+
}));
|
|
1876
|
+
|
|
1877
|
+
export const unmarshalTrafficConfigSchema: z.ZodType<TrafficConfig> = z
|
|
1878
|
+
.object({
|
|
1879
|
+
routes: z.array(z.lazy(() => unmarshalRouteSchema)).optional(),
|
|
1880
|
+
})
|
|
1881
|
+
.transform(d => ({
|
|
1882
|
+
routes: d.routes,
|
|
1883
|
+
}));
|
|
1884
|
+
|
|
1885
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1886
|
+
export const unmarshalUpdateInferenceEndpointNotificationsRequest_ResponseSchema: z.ZodType<UpdateInferenceEndpointNotificationsRequest_Response> =
|
|
1887
|
+
z
|
|
1888
|
+
.object({
|
|
1889
|
+
name: z.string().optional(),
|
|
1890
|
+
email_notifications: z
|
|
1891
|
+
.lazy(() => unmarshalEmailNotificationsSchema)
|
|
1892
|
+
.optional(),
|
|
1893
|
+
})
|
|
1894
|
+
.transform(d => ({
|
|
1895
|
+
name: d.name,
|
|
1896
|
+
emailNotifications: d.email_notifications,
|
|
1897
|
+
}));
|
|
1898
|
+
|
|
1899
|
+
export const unmarshalUsageTrackingConfigSchema: z.ZodType<UsageTrackingConfig> =
|
|
1900
|
+
z
|
|
1901
|
+
.object({
|
|
1902
|
+
enabled: z.boolean().optional(),
|
|
1903
|
+
})
|
|
1904
|
+
.transform(d => ({
|
|
1905
|
+
enabled: d.enabled,
|
|
1906
|
+
}));
|
|
1907
|
+
|
|
1908
|
+
export const marshalAi21LabsConfigSchema: z.ZodType = z
|
|
1909
|
+
.object({
|
|
1910
|
+
ai21labsApiKey: z.string().optional(),
|
|
1911
|
+
ai21labsApiKeyPlaintext: z.string().optional(),
|
|
1912
|
+
})
|
|
1913
|
+
.transform(d => ({
|
|
1914
|
+
ai21labs_api_key: d.ai21labsApiKey,
|
|
1915
|
+
ai21labs_api_key_plaintext: d.ai21labsApiKeyPlaintext,
|
|
1916
|
+
}));
|
|
1917
|
+
|
|
1918
|
+
export const marshalAiGatewayConfigSchema: z.ZodType = z
|
|
1919
|
+
.object({
|
|
1920
|
+
usageTrackingConfig: z
|
|
1921
|
+
.lazy(() => marshalUsageTrackingConfigSchema)
|
|
1922
|
+
.optional(),
|
|
1923
|
+
inferenceTableConfig: z
|
|
1924
|
+
.lazy(() => marshalInferenceTableConfigSchema)
|
|
1925
|
+
.optional(),
|
|
1926
|
+
rateLimits: z
|
|
1927
|
+
.array(z.lazy(() => marshalAiGatewayRateLimitSchema))
|
|
1928
|
+
.optional(),
|
|
1929
|
+
guardrails: z.lazy(() => marshalAiGuardrailsSchema).optional(),
|
|
1930
|
+
fallbackConfig: z.lazy(() => marshalFallbackConfigSchema).optional(),
|
|
1931
|
+
})
|
|
1932
|
+
.transform(d => ({
|
|
1933
|
+
usage_tracking_config: d.usageTrackingConfig,
|
|
1934
|
+
inference_table_config: d.inferenceTableConfig,
|
|
1935
|
+
rate_limits: d.rateLimits,
|
|
1936
|
+
guardrails: d.guardrails,
|
|
1937
|
+
fallback_config: d.fallbackConfig,
|
|
1938
|
+
}));
|
|
1939
|
+
|
|
1940
|
+
export const marshalAiGatewayRateLimitSchema: z.ZodType = z
|
|
1941
|
+
.object({
|
|
1942
|
+
calls: z.bigint().optional(),
|
|
1943
|
+
key: z.string().optional(),
|
|
1944
|
+
renewalPeriod: z.string().optional(),
|
|
1945
|
+
principal: z.string().optional(),
|
|
1946
|
+
tokens: z.bigint().optional(),
|
|
1947
|
+
})
|
|
1948
|
+
.transform(d => ({
|
|
1949
|
+
calls: d.calls,
|
|
1950
|
+
key: d.key,
|
|
1951
|
+
renewal_period: d.renewalPeriod,
|
|
1952
|
+
principal: d.principal,
|
|
1953
|
+
tokens: d.tokens,
|
|
1954
|
+
}));
|
|
1955
|
+
|
|
1956
|
+
export const marshalAiGuardrailParametersSchema: z.ZodType = z
|
|
1957
|
+
.object({
|
|
1958
|
+
safety: z.boolean().optional(),
|
|
1959
|
+
pii: z.lazy(() => marshalPiiSettingsSchema).optional(),
|
|
1960
|
+
validTopics: z.array(z.string()).optional(),
|
|
1961
|
+
invalidKeywords: z.array(z.string()).optional(),
|
|
1962
|
+
})
|
|
1963
|
+
.transform(d => ({
|
|
1964
|
+
safety: d.safety,
|
|
1965
|
+
pii: d.pii,
|
|
1966
|
+
valid_topics: d.validTopics,
|
|
1967
|
+
invalid_keywords: d.invalidKeywords,
|
|
1968
|
+
}));
|
|
1969
|
+
|
|
1970
|
+
export const marshalAiGuardrailsSchema: z.ZodType = z
|
|
1971
|
+
.object({
|
|
1972
|
+
input: z.lazy(() => marshalAiGuardrailParametersSchema).optional(),
|
|
1973
|
+
output: z.lazy(() => marshalAiGuardrailParametersSchema).optional(),
|
|
1974
|
+
})
|
|
1975
|
+
.transform(d => ({
|
|
1976
|
+
input: d.input,
|
|
1977
|
+
output: d.output,
|
|
1978
|
+
}));
|
|
1979
|
+
|
|
1980
|
+
export const marshalAmazonBedrockConfigSchema: z.ZodType = z
|
|
1981
|
+
.object({
|
|
1982
|
+
awsRegion: z.string().optional(),
|
|
1983
|
+
awsAccessKeyId: z.string().optional(),
|
|
1984
|
+
awsSecretAccessKey: z.string().optional(),
|
|
1985
|
+
bedrockProvider: z.string().optional(),
|
|
1986
|
+
awsAccessKeyIdPlaintext: z.string().optional(),
|
|
1987
|
+
awsSecretAccessKeyPlaintext: z.string().optional(),
|
|
1988
|
+
instanceProfileArn: z.string().optional(),
|
|
1989
|
+
})
|
|
1990
|
+
.transform(d => ({
|
|
1991
|
+
aws_region: d.awsRegion,
|
|
1992
|
+
aws_access_key_id: d.awsAccessKeyId,
|
|
1993
|
+
aws_secret_access_key: d.awsSecretAccessKey,
|
|
1994
|
+
bedrock_provider: d.bedrockProvider,
|
|
1995
|
+
aws_access_key_id_plaintext: d.awsAccessKeyIdPlaintext,
|
|
1996
|
+
aws_secret_access_key_plaintext: d.awsSecretAccessKeyPlaintext,
|
|
1997
|
+
instance_profile_arn: d.instanceProfileArn,
|
|
1998
|
+
}));
|
|
1999
|
+
|
|
2000
|
+
export const marshalAnthropicConfigSchema: z.ZodType = z
|
|
2001
|
+
.object({
|
|
2002
|
+
anthropicApiKey: z.string().optional(),
|
|
2003
|
+
anthropicApiKeyPlaintext: z.string().optional(),
|
|
2004
|
+
})
|
|
2005
|
+
.transform(d => ({
|
|
2006
|
+
anthropic_api_key: d.anthropicApiKey,
|
|
2007
|
+
anthropic_api_key_plaintext: d.anthropicApiKeyPlaintext,
|
|
2008
|
+
}));
|
|
2009
|
+
|
|
2010
|
+
export const marshalApiKeyAuthSchema: z.ZodType = z
|
|
2011
|
+
.object({
|
|
2012
|
+
key: z.string().optional(),
|
|
2013
|
+
value: z.string().optional(),
|
|
2014
|
+
valuePlaintext: z.string().optional(),
|
|
2015
|
+
})
|
|
2016
|
+
.transform(d => ({
|
|
2017
|
+
key: d.key,
|
|
2018
|
+
value: d.value,
|
|
2019
|
+
value_plaintext: d.valuePlaintext,
|
|
2020
|
+
}));
|
|
2021
|
+
|
|
2022
|
+
export const marshalAutoCaptureConfigSchema: z.ZodType = z
|
|
2023
|
+
.object({
|
|
2024
|
+
catalogName: z.string().optional(),
|
|
2025
|
+
schemaName: z.string().optional(),
|
|
2026
|
+
tableNamePrefix: z.string().optional(),
|
|
2027
|
+
state: z.lazy(() => marshalAutoCaptureStateSchema).optional(),
|
|
2028
|
+
enabled: z.boolean().optional(),
|
|
2029
|
+
})
|
|
2030
|
+
.transform(d => ({
|
|
2031
|
+
catalog_name: d.catalogName,
|
|
2032
|
+
schema_name: d.schemaName,
|
|
2033
|
+
table_name_prefix: d.tableNamePrefix,
|
|
2034
|
+
state: d.state,
|
|
2035
|
+
enabled: d.enabled,
|
|
2036
|
+
}));
|
|
2037
|
+
|
|
2038
|
+
export const marshalAutoCaptureStateSchema: z.ZodType = z
|
|
2039
|
+
.object({
|
|
2040
|
+
payloadTable: z.lazy(() => marshalPayloadTableSchema).optional(),
|
|
2041
|
+
})
|
|
2042
|
+
.transform(d => ({
|
|
2043
|
+
payload_table: d.payloadTable,
|
|
2044
|
+
}));
|
|
2045
|
+
|
|
2046
|
+
export const marshalBearerTokenAuthSchema: z.ZodType = z
|
|
2047
|
+
.object({
|
|
2048
|
+
token: z.string().optional(),
|
|
2049
|
+
tokenPlaintext: z.string().optional(),
|
|
2050
|
+
})
|
|
2051
|
+
.transform(d => ({
|
|
2052
|
+
token: d.token,
|
|
2053
|
+
token_plaintext: d.tokenPlaintext,
|
|
2054
|
+
}));
|
|
2055
|
+
|
|
2056
|
+
export const marshalCohereConfigSchema: z.ZodType = z
|
|
2057
|
+
.object({
|
|
2058
|
+
cohereApiKey: z.string().optional(),
|
|
2059
|
+
cohereApiKeyPlaintext: z.string().optional(),
|
|
2060
|
+
cohereApiBase: z.string().optional(),
|
|
2061
|
+
})
|
|
2062
|
+
.transform(d => ({
|
|
2063
|
+
cohere_api_key: d.cohereApiKey,
|
|
2064
|
+
cohere_api_key_plaintext: d.cohereApiKeyPlaintext,
|
|
2065
|
+
cohere_api_base: d.cohereApiBase,
|
|
2066
|
+
}));
|
|
2067
|
+
|
|
2068
|
+
export const marshalCreateInferenceEndpointRequestSchema: z.ZodType = z
|
|
2069
|
+
.object({
|
|
2070
|
+
name: z.string().optional(),
|
|
2071
|
+
config: z.lazy(() => marshalEndpointCoreConfigSchema).optional(),
|
|
2072
|
+
tags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(),
|
|
2073
|
+
routeOptimized: z.boolean().optional(),
|
|
2074
|
+
rateLimits: z.array(z.lazy(() => marshalRateLimitSchema)).optional(),
|
|
2075
|
+
aiGateway: z.lazy(() => marshalAiGatewayConfigSchema).optional(),
|
|
2076
|
+
budgetPolicyId: z.string().optional(),
|
|
2077
|
+
emailNotifications: z
|
|
2078
|
+
.lazy(() => marshalEmailNotificationsSchema)
|
|
2079
|
+
.optional(),
|
|
2080
|
+
description: z.string().optional(),
|
|
2081
|
+
})
|
|
2082
|
+
.transform(d => ({
|
|
2083
|
+
name: d.name,
|
|
2084
|
+
config: d.config,
|
|
2085
|
+
tags: d.tags,
|
|
2086
|
+
route_optimized: d.routeOptimized,
|
|
2087
|
+
rate_limits: d.rateLimits,
|
|
2088
|
+
ai_gateway: d.aiGateway,
|
|
2089
|
+
budget_policy_id: d.budgetPolicyId,
|
|
2090
|
+
email_notifications: d.emailNotifications,
|
|
2091
|
+
description: d.description,
|
|
2092
|
+
}));
|
|
2093
|
+
|
|
2094
|
+
export const marshalCreatePtEndpointRequestSchema: z.ZodType = z
|
|
2095
|
+
.object({
|
|
2096
|
+
name: z.string().optional(),
|
|
2097
|
+
config: z.lazy(() => marshalPtEndpointCoreConfigSchema).optional(),
|
|
2098
|
+
tags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(),
|
|
2099
|
+
aiGateway: z.lazy(() => marshalAiGatewayConfigSchema).optional(),
|
|
2100
|
+
budgetPolicyId: z.string().optional(),
|
|
2101
|
+
emailNotifications: z
|
|
2102
|
+
.lazy(() => marshalEmailNotificationsSchema)
|
|
2103
|
+
.optional(),
|
|
2104
|
+
})
|
|
2105
|
+
.transform(d => ({
|
|
2106
|
+
name: d.name,
|
|
2107
|
+
config: d.config,
|
|
2108
|
+
tags: d.tags,
|
|
2109
|
+
ai_gateway: d.aiGateway,
|
|
2110
|
+
budget_policy_id: d.budgetPolicyId,
|
|
2111
|
+
email_notifications: d.emailNotifications,
|
|
2112
|
+
}));
|
|
2113
|
+
|
|
2114
|
+
export const marshalCustomProviderConfigSchema: z.ZodType = z
|
|
2115
|
+
.object({
|
|
2116
|
+
customProviderUrl: z.string().optional(),
|
|
2117
|
+
bearerTokenAuth: z.lazy(() => marshalBearerTokenAuthSchema).optional(),
|
|
2118
|
+
apiKeyAuth: z.lazy(() => marshalApiKeyAuthSchema).optional(),
|
|
2119
|
+
})
|
|
2120
|
+
.transform(d => ({
|
|
2121
|
+
custom_provider_url: d.customProviderUrl,
|
|
2122
|
+
bearer_token_auth: d.bearerTokenAuth,
|
|
2123
|
+
api_key_auth: d.apiKeyAuth,
|
|
2124
|
+
}));
|
|
2125
|
+
|
|
2126
|
+
export const marshalDatabricksModelServingConfigSchema: z.ZodType = z
|
|
2127
|
+
.object({
|
|
2128
|
+
databricksApiToken: z.string().optional(),
|
|
2129
|
+
databricksWorkspaceUrl: z.string().optional(),
|
|
2130
|
+
databricksApiTokenPlaintext: z.string().optional(),
|
|
2131
|
+
})
|
|
2132
|
+
.transform(d => ({
|
|
2133
|
+
databricks_api_token: d.databricksApiToken,
|
|
2134
|
+
databricks_workspace_url: d.databricksWorkspaceUrl,
|
|
2135
|
+
databricks_api_token_plaintext: d.databricksApiTokenPlaintext,
|
|
2136
|
+
}));
|
|
2137
|
+
|
|
2138
|
+
export const marshalEmailNotificationsSchema: z.ZodType = z
|
|
2139
|
+
.object({
|
|
2140
|
+
onUpdateSuccess: z.array(z.string()).optional(),
|
|
2141
|
+
onUpdateFailure: z.array(z.string()).optional(),
|
|
2142
|
+
})
|
|
2143
|
+
.transform(d => ({
|
|
2144
|
+
on_update_success: d.onUpdateSuccess,
|
|
2145
|
+
on_update_failure: d.onUpdateFailure,
|
|
2146
|
+
}));
|
|
2147
|
+
|
|
2148
|
+
export const marshalEndpointCoreConfigSchema: z.ZodType = z
|
|
2149
|
+
.object({
|
|
2150
|
+
servedEntities: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
|
|
2151
|
+
servedModels: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
|
|
2152
|
+
trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(),
|
|
2153
|
+
autoCaptureConfig: z.lazy(() => marshalAutoCaptureConfigSchema).optional(),
|
|
2154
|
+
})
|
|
2155
|
+
.transform(d => ({
|
|
2156
|
+
served_entities: d.servedEntities,
|
|
2157
|
+
served_models: d.servedModels,
|
|
2158
|
+
traffic_config: d.trafficConfig,
|
|
2159
|
+
auto_capture_config: d.autoCaptureConfig,
|
|
2160
|
+
}));
|
|
2161
|
+
|
|
2162
|
+
export const marshalEndpointTagSchema: z.ZodType = z
|
|
2163
|
+
.object({
|
|
2164
|
+
key: z.string().optional(),
|
|
2165
|
+
value: z.string().optional(),
|
|
2166
|
+
})
|
|
2167
|
+
.transform(d => ({
|
|
2168
|
+
key: d.key,
|
|
2169
|
+
value: d.value,
|
|
2170
|
+
}));
|
|
2171
|
+
|
|
2172
|
+
export const marshalExternalFunctionRequestSchema: z.ZodType = z
|
|
2173
|
+
.object({
|
|
2174
|
+
connectionName: z.string().optional(),
|
|
2175
|
+
method: z.enum(ExternalFunctionRequest_HttpMethod).optional(),
|
|
2176
|
+
path: z.string().optional(),
|
|
2177
|
+
json: z.string().optional(),
|
|
2178
|
+
headers: z.string().optional(),
|
|
2179
|
+
params: z.string().optional(),
|
|
2180
|
+
subDomain: z.string().optional(),
|
|
2181
|
+
})
|
|
2182
|
+
.transform(d => ({
|
|
2183
|
+
connection_name: d.connectionName,
|
|
2184
|
+
method: d.method,
|
|
2185
|
+
path: d.path,
|
|
2186
|
+
json: d.json,
|
|
2187
|
+
headers: d.headers,
|
|
2188
|
+
params: d.params,
|
|
2189
|
+
sub_domain: d.subDomain,
|
|
2190
|
+
}));
|
|
2191
|
+
|
|
2192
|
+
export const marshalExternalModelSchema: z.ZodType = z
|
|
2193
|
+
.object({
|
|
2194
|
+
provider: z.string().optional(),
|
|
2195
|
+
name: z.string().optional(),
|
|
2196
|
+
task: z.string().optional(),
|
|
2197
|
+
config: z
|
|
2198
|
+
.discriminatedUnion('$case', [
|
|
2199
|
+
z.object({
|
|
2200
|
+
$case: z.literal('ai21labsConfig'),
|
|
2201
|
+
ai21labsConfig: z.lazy(() => marshalAi21LabsConfigSchema),
|
|
2202
|
+
}),
|
|
2203
|
+
z.object({
|
|
2204
|
+
$case: z.literal('anthropicConfig'),
|
|
2205
|
+
anthropicConfig: z.lazy(() => marshalAnthropicConfigSchema),
|
|
2206
|
+
}),
|
|
2207
|
+
z.object({
|
|
2208
|
+
$case: z.literal('amazonBedrockConfig'),
|
|
2209
|
+
amazonBedrockConfig: z.lazy(() => marshalAmazonBedrockConfigSchema),
|
|
2210
|
+
}),
|
|
2211
|
+
z.object({
|
|
2212
|
+
$case: z.literal('cohereConfig'),
|
|
2213
|
+
cohereConfig: z.lazy(() => marshalCohereConfigSchema),
|
|
2214
|
+
}),
|
|
2215
|
+
z.object({
|
|
2216
|
+
$case: z.literal('googleCloudVertexAiConfig'),
|
|
2217
|
+
googleCloudVertexAiConfig: z.lazy(
|
|
2218
|
+
() => marshalGoogleCloudVertexAiConfigSchema
|
|
2219
|
+
),
|
|
2220
|
+
}),
|
|
2221
|
+
z.object({
|
|
2222
|
+
$case: z.literal('databricksModelServingConfig'),
|
|
2223
|
+
databricksModelServingConfig: z.lazy(
|
|
2224
|
+
() => marshalDatabricksModelServingConfigSchema
|
|
2225
|
+
),
|
|
2226
|
+
}),
|
|
2227
|
+
z.object({
|
|
2228
|
+
$case: z.literal('openaiConfig'),
|
|
2229
|
+
openaiConfig: z.lazy(() => marshalOpenAiConfigSchema),
|
|
2230
|
+
}),
|
|
2231
|
+
z.object({
|
|
2232
|
+
$case: z.literal('palmConfig'),
|
|
2233
|
+
palmConfig: z.lazy(() => marshalPaLmConfigSchema),
|
|
2234
|
+
}),
|
|
2235
|
+
z.object({
|
|
2236
|
+
$case: z.literal('customProviderConfig'),
|
|
2237
|
+
customProviderConfig: z.lazy(() => marshalCustomProviderConfigSchema),
|
|
2238
|
+
}),
|
|
2239
|
+
])
|
|
2240
|
+
.optional(),
|
|
2241
|
+
})
|
|
2242
|
+
.transform(d => ({
|
|
2243
|
+
provider: d.provider,
|
|
2244
|
+
name: d.name,
|
|
2245
|
+
task: d.task,
|
|
2246
|
+
...(d.config?.$case === 'ai21labsConfig' && {
|
|
2247
|
+
ai21labs_config: d.config.ai21labsConfig,
|
|
2248
|
+
}),
|
|
2249
|
+
...(d.config?.$case === 'anthropicConfig' && {
|
|
2250
|
+
anthropic_config: d.config.anthropicConfig,
|
|
2251
|
+
}),
|
|
2252
|
+
...(d.config?.$case === 'amazonBedrockConfig' && {
|
|
2253
|
+
amazon_bedrock_config: d.config.amazonBedrockConfig,
|
|
2254
|
+
}),
|
|
2255
|
+
...(d.config?.$case === 'cohereConfig' && {
|
|
2256
|
+
cohere_config: d.config.cohereConfig,
|
|
2257
|
+
}),
|
|
2258
|
+
...(d.config?.$case === 'googleCloudVertexAiConfig' && {
|
|
2259
|
+
google_cloud_vertex_ai_config: d.config.googleCloudVertexAiConfig,
|
|
2260
|
+
}),
|
|
2261
|
+
...(d.config?.$case === 'databricksModelServingConfig' && {
|
|
2262
|
+
databricks_model_serving_config: d.config.databricksModelServingConfig,
|
|
2263
|
+
}),
|
|
2264
|
+
...(d.config?.$case === 'openaiConfig' && {
|
|
2265
|
+
openai_config: d.config.openaiConfig,
|
|
2266
|
+
}),
|
|
2267
|
+
...(d.config?.$case === 'palmConfig' && {palm_config: d.config.palmConfig}),
|
|
2268
|
+
...(d.config?.$case === 'customProviderConfig' && {
|
|
2269
|
+
custom_provider_config: d.config.customProviderConfig,
|
|
2270
|
+
}),
|
|
2271
|
+
}));
|
|
2272
|
+
|
|
2273
|
+
export const marshalFallbackConfigSchema: z.ZodType = z
|
|
2274
|
+
.object({
|
|
2275
|
+
enabled: z.boolean().optional(),
|
|
2276
|
+
})
|
|
2277
|
+
.transform(d => ({
|
|
2278
|
+
enabled: d.enabled,
|
|
2279
|
+
}));
|
|
2280
|
+
|
|
2281
|
+
export const marshalFoundationModelSchema: z.ZodType = z
|
|
2282
|
+
.object({
|
|
2283
|
+
name: z.string().optional(),
|
|
2284
|
+
displayName: z.string().optional(),
|
|
2285
|
+
docs: z.string().optional(),
|
|
2286
|
+
description: z.string().optional(),
|
|
2287
|
+
})
|
|
2288
|
+
.transform(d => ({
|
|
2289
|
+
name: d.name,
|
|
2290
|
+
display_name: d.displayName,
|
|
2291
|
+
docs: d.docs,
|
|
2292
|
+
description: d.description,
|
|
2293
|
+
}));
|
|
2294
|
+
|
|
2295
|
+
export const marshalGoogleCloudVertexAiConfigSchema: z.ZodType = z
|
|
2296
|
+
.object({
|
|
2297
|
+
privateKey: z.string().optional(),
|
|
2298
|
+
projectId: z.string().optional(),
|
|
2299
|
+
region: z.string().optional(),
|
|
2300
|
+
privateKeyPlaintext: z.string().optional(),
|
|
2301
|
+
})
|
|
2302
|
+
.transform(d => ({
|
|
2303
|
+
private_key: d.privateKey,
|
|
2304
|
+
project_id: d.projectId,
|
|
2305
|
+
region: d.region,
|
|
2306
|
+
private_key_plaintext: d.privateKeyPlaintext,
|
|
2307
|
+
}));
|
|
2308
|
+
|
|
2309
|
+
export const marshalInferenceTableConfigSchema: z.ZodType = z
|
|
2310
|
+
.object({
|
|
2311
|
+
catalogName: z.string().optional(),
|
|
2312
|
+
schemaName: z.string().optional(),
|
|
2313
|
+
tableNamePrefix: z.string().optional(),
|
|
2314
|
+
enabled: z.boolean().optional(),
|
|
2315
|
+
})
|
|
2316
|
+
.transform(d => ({
|
|
2317
|
+
catalog_name: d.catalogName,
|
|
2318
|
+
schema_name: d.schemaName,
|
|
2319
|
+
table_name_prefix: d.tableNamePrefix,
|
|
2320
|
+
enabled: d.enabled,
|
|
2321
|
+
}));
|
|
2322
|
+
|
|
2323
|
+
export const marshalOpenAiConfigSchema: z.ZodType = z
|
|
2324
|
+
.object({
|
|
2325
|
+
openaiApiKey: z.string().optional(),
|
|
2326
|
+
openaiApiType: z.string().optional(),
|
|
2327
|
+
openaiApiBase: z.string().optional(),
|
|
2328
|
+
openaiApiVersion: z.string().optional(),
|
|
2329
|
+
openaiDeploymentName: z.string().optional(),
|
|
2330
|
+
openaiOrganization: z.string().optional(),
|
|
2331
|
+
microsoftEntraTenantId: z.string().optional(),
|
|
2332
|
+
microsoftEntraClientId: z.string().optional(),
|
|
2333
|
+
microsoftEntraClientSecret: z.string().optional(),
|
|
2334
|
+
openaiApiKeyPlaintext: z.string().optional(),
|
|
2335
|
+
microsoftEntraClientSecretPlaintext: z.string().optional(),
|
|
2336
|
+
})
|
|
2337
|
+
.transform(d => ({
|
|
2338
|
+
openai_api_key: d.openaiApiKey,
|
|
2339
|
+
openai_api_type: d.openaiApiType,
|
|
2340
|
+
openai_api_base: d.openaiApiBase,
|
|
2341
|
+
openai_api_version: d.openaiApiVersion,
|
|
2342
|
+
openai_deployment_name: d.openaiDeploymentName,
|
|
2343
|
+
openai_organization: d.openaiOrganization,
|
|
2344
|
+
microsoft_entra_tenant_id: d.microsoftEntraTenantId,
|
|
2345
|
+
microsoft_entra_client_id: d.microsoftEntraClientId,
|
|
2346
|
+
microsoft_entra_client_secret: d.microsoftEntraClientSecret,
|
|
2347
|
+
openai_api_key_plaintext: d.openaiApiKeyPlaintext,
|
|
2348
|
+
microsoft_entra_client_secret_plaintext:
|
|
2349
|
+
d.microsoftEntraClientSecretPlaintext,
|
|
2350
|
+
}));
|
|
2351
|
+
|
|
2352
|
+
export const marshalPaLmConfigSchema: z.ZodType = z
|
|
2353
|
+
.object({
|
|
2354
|
+
palmApiKey: z.string().optional(),
|
|
2355
|
+
palmApiKeyPlaintext: z.string().optional(),
|
|
2356
|
+
})
|
|
2357
|
+
.transform(d => ({
|
|
2358
|
+
palm_api_key: d.palmApiKey,
|
|
2359
|
+
palm_api_key_plaintext: d.palmApiKeyPlaintext,
|
|
2360
|
+
}));
|
|
2361
|
+
|
|
2362
|
+
export const marshalPatchInferenceEndpointTagsRequestSchema: z.ZodType = z
|
|
2363
|
+
.object({
|
|
2364
|
+
name: z.string().optional(),
|
|
2365
|
+
addTags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(),
|
|
2366
|
+
deleteTags: z.array(z.string()).optional(),
|
|
2367
|
+
})
|
|
2368
|
+
.transform(d => ({
|
|
2369
|
+
name: d.name,
|
|
2370
|
+
add_tags: d.addTags,
|
|
2371
|
+
delete_tags: d.deleteTags,
|
|
2372
|
+
}));
|
|
2373
|
+
|
|
2374
|
+
export const marshalPayloadTableSchema: z.ZodType = z
|
|
2375
|
+
.object({
|
|
2376
|
+
name: z.string().optional(),
|
|
2377
|
+
status: z.string().optional(),
|
|
2378
|
+
statusMessage: z.string().optional(),
|
|
2379
|
+
})
|
|
2380
|
+
.transform(d => ({
|
|
2381
|
+
name: d.name,
|
|
2382
|
+
status: d.status,
|
|
2383
|
+
status_message: d.statusMessage,
|
|
2384
|
+
}));
|
|
2385
|
+
|
|
2386
|
+
export const marshalPiiSettingsSchema: z.ZodType = z
|
|
2387
|
+
.object({
|
|
2388
|
+
behavior: z.enum(Behavior).optional(),
|
|
2389
|
+
})
|
|
2390
|
+
.transform(d => ({
|
|
2391
|
+
behavior: d.behavior,
|
|
2392
|
+
}));
|
|
2393
|
+
|
|
2394
|
+
export const marshalPtEndpointCoreConfigSchema: z.ZodType = z
|
|
2395
|
+
.object({
|
|
2396
|
+
servedEntities: z
|
|
2397
|
+
.array(z.lazy(() => marshalPtServedModelSchema))
|
|
2398
|
+
.optional(),
|
|
2399
|
+
trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(),
|
|
2400
|
+
})
|
|
2401
|
+
.transform(d => ({
|
|
2402
|
+
served_entities: d.servedEntities,
|
|
2403
|
+
traffic_config: d.trafficConfig,
|
|
2404
|
+
}));
|
|
2405
|
+
|
|
2406
|
+
export const marshalPtServedModelSchema: z.ZodType = z
|
|
2407
|
+
.object({
|
|
2408
|
+
name: z.string().optional(),
|
|
2409
|
+
entityName: z.string().optional(),
|
|
2410
|
+
entityVersion: z.string().optional(),
|
|
2411
|
+
provisionedModelUnits: z.bigint().optional(),
|
|
2412
|
+
burstScalingEnabled: z.boolean().optional(),
|
|
2413
|
+
})
|
|
2414
|
+
.transform(d => ({
|
|
2415
|
+
name: d.name,
|
|
2416
|
+
entity_name: d.entityName,
|
|
2417
|
+
entity_version: d.entityVersion,
|
|
2418
|
+
provisioned_model_units: d.provisionedModelUnits,
|
|
2419
|
+
burst_scaling_enabled: d.burstScalingEnabled,
|
|
2420
|
+
}));
|
|
2421
|
+
|
|
2422
|
+
export const marshalPutInferenceEndpointAiGatewayRequestSchema: z.ZodType = z
|
|
2423
|
+
.object({
|
|
2424
|
+
name: z.string().optional(),
|
|
2425
|
+
usageTrackingConfig: z
|
|
2426
|
+
.lazy(() => marshalUsageTrackingConfigSchema)
|
|
2427
|
+
.optional(),
|
|
2428
|
+
inferenceTableConfig: z
|
|
2429
|
+
.lazy(() => marshalInferenceTableConfigSchema)
|
|
2430
|
+
.optional(),
|
|
2431
|
+
rateLimits: z
|
|
2432
|
+
.array(z.lazy(() => marshalAiGatewayRateLimitSchema))
|
|
2433
|
+
.optional(),
|
|
2434
|
+
guardrails: z.lazy(() => marshalAiGuardrailsSchema).optional(),
|
|
2435
|
+
fallbackConfig: z.lazy(() => marshalFallbackConfigSchema).optional(),
|
|
2436
|
+
})
|
|
2437
|
+
.transform(d => ({
|
|
2438
|
+
name: d.name,
|
|
2439
|
+
usage_tracking_config: d.usageTrackingConfig,
|
|
2440
|
+
inference_table_config: d.inferenceTableConfig,
|
|
2441
|
+
rate_limits: d.rateLimits,
|
|
2442
|
+
guardrails: d.guardrails,
|
|
2443
|
+
fallback_config: d.fallbackConfig,
|
|
2444
|
+
}));
|
|
2445
|
+
|
|
2446
|
+
export const marshalPutInferenceEndpointConfigRequestSchema: z.ZodType = z
|
|
2447
|
+
.object({
|
|
2448
|
+
name: z.string().optional(),
|
|
2449
|
+
servedEntities: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
|
|
2450
|
+
servedModels: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
|
|
2451
|
+
trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(),
|
|
2452
|
+
autoCaptureConfig: z.lazy(() => marshalAutoCaptureConfigSchema).optional(),
|
|
2453
|
+
})
|
|
2454
|
+
.transform(d => ({
|
|
2455
|
+
name: d.name,
|
|
2456
|
+
served_entities: d.servedEntities,
|
|
2457
|
+
served_models: d.servedModels,
|
|
2458
|
+
traffic_config: d.trafficConfig,
|
|
2459
|
+
auto_capture_config: d.autoCaptureConfig,
|
|
2460
|
+
}));
|
|
2461
|
+
|
|
2462
|
+
export const marshalPutInferenceEndpointRateLimitsRequestSchema: z.ZodType = z
|
|
2463
|
+
.object({
|
|
2464
|
+
name: z.string().optional(),
|
|
2465
|
+
rateLimits: z.array(z.lazy(() => marshalRateLimitSchema)).optional(),
|
|
2466
|
+
})
|
|
2467
|
+
.transform(d => ({
|
|
2468
|
+
name: d.name,
|
|
2469
|
+
rate_limits: d.rateLimits,
|
|
2470
|
+
}));
|
|
2471
|
+
|
|
2472
|
+
export const marshalPutPtEndpointConfigRequestSchema: z.ZodType = z
|
|
2473
|
+
.object({
|
|
2474
|
+
name: z.string().optional(),
|
|
2475
|
+
config: z.lazy(() => marshalPtEndpointCoreConfigSchema).optional(),
|
|
2476
|
+
})
|
|
2477
|
+
.transform(d => ({
|
|
2478
|
+
name: d.name,
|
|
2479
|
+
config: d.config,
|
|
2480
|
+
}));
|
|
2481
|
+
|
|
2482
|
+
export const marshalRateLimitSchema: z.ZodType = z
|
|
2483
|
+
.object({
|
|
2484
|
+
calls: z.bigint().optional(),
|
|
2485
|
+
key: z.string().optional(),
|
|
2486
|
+
renewalPeriod: z.string().optional(),
|
|
2487
|
+
})
|
|
2488
|
+
.transform(d => ({
|
|
2489
|
+
calls: d.calls,
|
|
2490
|
+
key: d.key,
|
|
2491
|
+
renewal_period: d.renewalPeriod,
|
|
2492
|
+
}));
|
|
2493
|
+
|
|
2494
|
+
export const marshalRouteSchema: z.ZodType = z
|
|
2495
|
+
.object({
|
|
2496
|
+
servedModelName: z.string().optional(),
|
|
2497
|
+
trafficPercentage: z.number().optional(),
|
|
2498
|
+
servedEntityName: z.string().optional(),
|
|
2499
|
+
})
|
|
2500
|
+
.transform(d => ({
|
|
2501
|
+
served_model_name: d.servedModelName,
|
|
2502
|
+
traffic_percentage: d.trafficPercentage,
|
|
2503
|
+
served_entity_name: d.servedEntityName,
|
|
2504
|
+
}));
|
|
2505
|
+
|
|
2506
|
+
export const marshalServedModelSchema: z.ZodType = z
|
|
2507
|
+
.object({
|
|
2508
|
+
name: z.string().optional(),
|
|
2509
|
+
externalModel: z.lazy(() => marshalExternalModelSchema).optional(),
|
|
2510
|
+
entityName: z.string().optional(),
|
|
2511
|
+
entityVersion: z.string().optional(),
|
|
2512
|
+
minProvisionedThroughput: z.number().optional(),
|
|
2513
|
+
maxProvisionedThroughput: z.number().optional(),
|
|
2514
|
+
minProvisionedConcurrency: z.number().optional(),
|
|
2515
|
+
maxProvisionedConcurrency: z.number().optional(),
|
|
2516
|
+
workloadSize: z.string().optional(),
|
|
2517
|
+
provisionedModelUnits: z.bigint().optional(),
|
|
2518
|
+
burstScalingEnabled: z.boolean().optional(),
|
|
2519
|
+
scaleToZeroEnabled: z.boolean().optional(),
|
|
2520
|
+
modelName: z.string().optional(),
|
|
2521
|
+
modelVersion: z.string().optional(),
|
|
2522
|
+
environmentVars: z.record(z.string(), z.string()).optional(),
|
|
2523
|
+
instanceProfileArn: z.string().optional(),
|
|
2524
|
+
foundationModel: z.lazy(() => marshalFoundationModelSchema).optional(),
|
|
2525
|
+
state: z.lazy(() => marshalServedModelStateSchema).optional(),
|
|
2526
|
+
creator: z.string().optional(),
|
|
2527
|
+
creationTimestamp: z.bigint().optional(),
|
|
2528
|
+
})
|
|
2529
|
+
.transform(d => ({
|
|
2530
|
+
name: d.name,
|
|
2531
|
+
external_model: d.externalModel,
|
|
2532
|
+
entity_name: d.entityName,
|
|
2533
|
+
entity_version: d.entityVersion,
|
|
2534
|
+
min_provisioned_throughput: d.minProvisionedThroughput,
|
|
2535
|
+
max_provisioned_throughput: d.maxProvisionedThroughput,
|
|
2536
|
+
min_provisioned_concurrency: d.minProvisionedConcurrency,
|
|
2537
|
+
max_provisioned_concurrency: d.maxProvisionedConcurrency,
|
|
2538
|
+
workload_size: d.workloadSize,
|
|
2539
|
+
provisioned_model_units: d.provisionedModelUnits,
|
|
2540
|
+
burst_scaling_enabled: d.burstScalingEnabled,
|
|
2541
|
+
scale_to_zero_enabled: d.scaleToZeroEnabled,
|
|
2542
|
+
model_name: d.modelName,
|
|
2543
|
+
model_version: d.modelVersion,
|
|
2544
|
+
environment_vars: d.environmentVars,
|
|
2545
|
+
instance_profile_arn: d.instanceProfileArn,
|
|
2546
|
+
foundation_model: d.foundationModel,
|
|
2547
|
+
state: d.state,
|
|
2548
|
+
creator: d.creator,
|
|
2549
|
+
creation_timestamp: d.creationTimestamp,
|
|
2550
|
+
}));
|
|
2551
|
+
|
|
2552
|
+
export const marshalServedModelStateSchema: z.ZodType = z
|
|
2553
|
+
.object({
|
|
2554
|
+
deployment: z.enum(ServedModelDeploymentState).optional(),
|
|
2555
|
+
deploymentStateMessage: z.string().optional(),
|
|
2556
|
+
})
|
|
2557
|
+
.transform(d => ({
|
|
2558
|
+
deployment: d.deployment,
|
|
2559
|
+
deployment_state_message: d.deploymentStateMessage,
|
|
2560
|
+
}));
|
|
2561
|
+
|
|
2562
|
+
export const marshalTrafficConfigSchema: z.ZodType = z
|
|
2563
|
+
.object({
|
|
2564
|
+
routes: z.array(z.lazy(() => marshalRouteSchema)).optional(),
|
|
2565
|
+
})
|
|
2566
|
+
.transform(d => ({
|
|
2567
|
+
routes: d.routes,
|
|
2568
|
+
}));
|
|
2569
|
+
|
|
2570
|
+
export const marshalUpdateInferenceEndpointNotificationsRequestSchema: z.ZodType =
|
|
2571
|
+
z
|
|
2572
|
+
.object({
|
|
2573
|
+
name: z.string().optional(),
|
|
2574
|
+
emailNotifications: z
|
|
2575
|
+
.lazy(() => marshalEmailNotificationsSchema)
|
|
2576
|
+
.optional(),
|
|
2577
|
+
})
|
|
2578
|
+
.transform(d => ({
|
|
2579
|
+
name: d.name,
|
|
2580
|
+
email_notifications: d.emailNotifications,
|
|
2581
|
+
}));
|
|
2582
|
+
|
|
2583
|
+
export const marshalUsageTrackingConfigSchema: z.ZodType = z
|
|
2584
|
+
.object({
|
|
2585
|
+
enabled: z.boolean().optional(),
|
|
2586
|
+
})
|
|
2587
|
+
.transform(d => ({
|
|
2588
|
+
enabled: d.enabled,
|
|
2589
|
+
}));
|