@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.
@@ -0,0 +1,1424 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+ import { z } from 'zod';
3
+ export var Behavior;
4
+ (function (Behavior) {
5
+ Behavior["BEHAVIOR_UNSPECIFIED"] = "BEHAVIOR_UNSPECIFIED";
6
+ Behavior["NONE"] = "NONE";
7
+ Behavior["BLOCK"] = "BLOCK";
8
+ Behavior["MASK"] = "MASK";
9
+ })(Behavior || (Behavior = {}));
10
+ export var ServedModelDeploymentState;
11
+ (function (ServedModelDeploymentState) {
12
+ ServedModelDeploymentState["DEPLOYMENT_UNKNOWN"] = "DEPLOYMENT_UNKNOWN";
13
+ ServedModelDeploymentState["DEPLOYMENT_CREATING"] = "DEPLOYMENT_CREATING";
14
+ ServedModelDeploymentState["DEPLOYMENT_RECOVERING"] = "DEPLOYMENT_RECOVERING";
15
+ ServedModelDeploymentState["DEPLOYMENT_READY"] = "DEPLOYMENT_READY";
16
+ ServedModelDeploymentState["DEPLOYMENT_FAILED"] = "DEPLOYMENT_FAILED";
17
+ ServedModelDeploymentState["DEPLOYMENT_ABORTED"] = "DEPLOYMENT_ABORTED";
18
+ ServedModelDeploymentState["DEPLOYMENT_STOPPED"] = "DEPLOYMENT_STOPPED";
19
+ })(ServedModelDeploymentState || (ServedModelDeploymentState = {}));
20
+ export var ServingEndpointDetailedPermissionLevel;
21
+ (function (ServingEndpointDetailedPermissionLevel) {
22
+ ServingEndpointDetailedPermissionLevel["CAN_MANAGE"] = "CAN_MANAGE";
23
+ ServingEndpointDetailedPermissionLevel["CAN_QUERY"] = "CAN_QUERY";
24
+ ServingEndpointDetailedPermissionLevel["CAN_VIEW"] = "CAN_VIEW";
25
+ })(ServingEndpointDetailedPermissionLevel || (ServingEndpointDetailedPermissionLevel = {}));
26
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
27
+ export var ExternalFunctionRequest_HttpMethod;
28
+ (function (ExternalFunctionRequest_HttpMethod) {
29
+ ExternalFunctionRequest_HttpMethod["HTTP_METHOD_UNSPECIFIED"] = "HTTP_METHOD_UNSPECIFIED";
30
+ ExternalFunctionRequest_HttpMethod["GET"] = "GET";
31
+ ExternalFunctionRequest_HttpMethod["POST"] = "POST";
32
+ ExternalFunctionRequest_HttpMethod["PUT"] = "PUT";
33
+ ExternalFunctionRequest_HttpMethod["DELETE"] = "DELETE";
34
+ ExternalFunctionRequest_HttpMethod["PATCH"] = "PATCH";
35
+ })(ExternalFunctionRequest_HttpMethod || (ExternalFunctionRequest_HttpMethod = {}));
36
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
37
+ export var InferenceEndpointState_ConfigUpdateState;
38
+ (function (InferenceEndpointState_ConfigUpdateState) {
39
+ InferenceEndpointState_ConfigUpdateState["CONFIG_UPDATE_STATE_UNSPECIFIED"] = "CONFIG_UPDATE_STATE_UNSPECIFIED";
40
+ InferenceEndpointState_ConfigUpdateState["NOT_UPDATING"] = "NOT_UPDATING";
41
+ InferenceEndpointState_ConfigUpdateState["IN_PROGRESS"] = "IN_PROGRESS";
42
+ InferenceEndpointState_ConfigUpdateState["UPDATE_FAILED"] = "UPDATE_FAILED";
43
+ InferenceEndpointState_ConfigUpdateState["UPDATE_CANCELED"] = "UPDATE_CANCELED";
44
+ })(InferenceEndpointState_ConfigUpdateState || (InferenceEndpointState_ConfigUpdateState = {}));
45
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
46
+ export var InferenceEndpointState_ReadyState;
47
+ (function (InferenceEndpointState_ReadyState) {
48
+ InferenceEndpointState_ReadyState["READY_STATE_UNSPECIFIED"] = "READY_STATE_UNSPECIFIED";
49
+ InferenceEndpointState_ReadyState["READY"] = "READY";
50
+ InferenceEndpointState_ReadyState["NOT_READY"] = "NOT_READY";
51
+ })(InferenceEndpointState_ReadyState || (InferenceEndpointState_ReadyState = {}));
52
+ export const unmarshalAi21LabsConfigSchema = z
53
+ .object({
54
+ ai21labs_api_key: z.string().optional(),
55
+ ai21labs_api_key_plaintext: z.string().optional(),
56
+ })
57
+ .transform(d => ({
58
+ ai21labsApiKey: d.ai21labs_api_key,
59
+ ai21labsApiKeyPlaintext: d.ai21labs_api_key_plaintext,
60
+ }));
61
+ export const unmarshalAiGatewayConfigSchema = z
62
+ .object({
63
+ usage_tracking_config: z
64
+ .lazy(() => unmarshalUsageTrackingConfigSchema)
65
+ .optional(),
66
+ inference_table_config: z
67
+ .lazy(() => unmarshalInferenceTableConfigSchema)
68
+ .optional(),
69
+ rate_limits: z
70
+ .array(z.lazy(() => unmarshalAiGatewayRateLimitSchema))
71
+ .optional(),
72
+ guardrails: z.lazy(() => unmarshalAiGuardrailsSchema).optional(),
73
+ fallback_config: z.lazy(() => unmarshalFallbackConfigSchema).optional(),
74
+ })
75
+ .transform(d => ({
76
+ usageTrackingConfig: d.usage_tracking_config,
77
+ inferenceTableConfig: d.inference_table_config,
78
+ rateLimits: d.rate_limits,
79
+ guardrails: d.guardrails,
80
+ fallbackConfig: d.fallback_config,
81
+ }));
82
+ export const unmarshalAiGatewayRateLimitSchema = z
83
+ .object({
84
+ calls: z
85
+ .union([z.number(), z.bigint()])
86
+ .transform(v => BigInt(v))
87
+ .optional(),
88
+ key: z.string().optional(),
89
+ renewal_period: z.string().optional(),
90
+ principal: z.string().optional(),
91
+ tokens: z
92
+ .union([z.number(), z.bigint()])
93
+ .transform(v => BigInt(v))
94
+ .optional(),
95
+ })
96
+ .transform(d => ({
97
+ calls: d.calls,
98
+ key: d.key,
99
+ renewalPeriod: d.renewal_period,
100
+ principal: d.principal,
101
+ tokens: d.tokens,
102
+ }));
103
+ export const unmarshalAiGuardrailParametersSchema = z
104
+ .object({
105
+ safety: z.boolean().optional(),
106
+ pii: z.lazy(() => unmarshalPiiSettingsSchema).optional(),
107
+ valid_topics: z.array(z.string()).optional(),
108
+ invalid_keywords: z.array(z.string()).optional(),
109
+ })
110
+ .transform(d => ({
111
+ safety: d.safety,
112
+ pii: d.pii,
113
+ validTopics: d.valid_topics,
114
+ invalidKeywords: d.invalid_keywords,
115
+ }));
116
+ export const unmarshalAiGuardrailsSchema = z
117
+ .object({
118
+ input: z.lazy(() => unmarshalAiGuardrailParametersSchema).optional(),
119
+ output: z.lazy(() => unmarshalAiGuardrailParametersSchema).optional(),
120
+ })
121
+ .transform(d => ({
122
+ input: d.input,
123
+ output: d.output,
124
+ }));
125
+ export const unmarshalAmazonBedrockConfigSchema = z
126
+ .object({
127
+ aws_region: z.string().optional(),
128
+ aws_access_key_id: z.string().optional(),
129
+ aws_secret_access_key: z.string().optional(),
130
+ bedrock_provider: z.string().optional(),
131
+ aws_access_key_id_plaintext: z.string().optional(),
132
+ aws_secret_access_key_plaintext: z.string().optional(),
133
+ instance_profile_arn: z.string().optional(),
134
+ })
135
+ .transform(d => ({
136
+ awsRegion: d.aws_region,
137
+ awsAccessKeyId: d.aws_access_key_id,
138
+ awsSecretAccessKey: d.aws_secret_access_key,
139
+ bedrockProvider: d.bedrock_provider,
140
+ awsAccessKeyIdPlaintext: d.aws_access_key_id_plaintext,
141
+ awsSecretAccessKeyPlaintext: d.aws_secret_access_key_plaintext,
142
+ instanceProfileArn: d.instance_profile_arn,
143
+ }));
144
+ export const unmarshalAnthropicConfigSchema = z
145
+ .object({
146
+ anthropic_api_key: z.string().optional(),
147
+ anthropic_api_key_plaintext: z.string().optional(),
148
+ })
149
+ .transform(d => ({
150
+ anthropicApiKey: d.anthropic_api_key,
151
+ anthropicApiKeyPlaintext: d.anthropic_api_key_plaintext,
152
+ }));
153
+ export const unmarshalApiKeyAuthSchema = z
154
+ .object({
155
+ key: z.string().optional(),
156
+ value: z.string().optional(),
157
+ value_plaintext: z.string().optional(),
158
+ })
159
+ .transform(d => ({
160
+ key: d.key,
161
+ value: d.value,
162
+ valuePlaintext: d.value_plaintext,
163
+ }));
164
+ export const unmarshalAutoCaptureConfigSchema = z
165
+ .object({
166
+ catalog_name: z.string().optional(),
167
+ schema_name: z.string().optional(),
168
+ table_name_prefix: z.string().optional(),
169
+ state: z.lazy(() => unmarshalAutoCaptureStateSchema).optional(),
170
+ enabled: z.boolean().optional(),
171
+ })
172
+ .transform(d => ({
173
+ catalogName: d.catalog_name,
174
+ schemaName: d.schema_name,
175
+ tableNamePrefix: d.table_name_prefix,
176
+ state: d.state,
177
+ enabled: d.enabled,
178
+ }));
179
+ export const unmarshalAutoCaptureStateSchema = z
180
+ .object({
181
+ payload_table: z.lazy(() => unmarshalPayloadTableSchema).optional(),
182
+ })
183
+ .transform(d => ({
184
+ payloadTable: d.payload_table,
185
+ }));
186
+ export const unmarshalBearerTokenAuthSchema = z
187
+ .object({
188
+ token: z.string().optional(),
189
+ token_plaintext: z.string().optional(),
190
+ })
191
+ .transform(d => ({
192
+ token: d.token,
193
+ tokenPlaintext: d.token_plaintext,
194
+ }));
195
+ export const unmarshalCohereConfigSchema = z
196
+ .object({
197
+ cohere_api_key: z.string().optional(),
198
+ cohere_api_key_plaintext: z.string().optional(),
199
+ cohere_api_base: z.string().optional(),
200
+ })
201
+ .transform(d => ({
202
+ cohereApiKey: d.cohere_api_key,
203
+ cohereApiKeyPlaintext: d.cohere_api_key_plaintext,
204
+ cohereApiBase: d.cohere_api_base,
205
+ }));
206
+ export const unmarshalCustomProviderConfigSchema = z
207
+ .object({
208
+ custom_provider_url: z.string().optional(),
209
+ bearer_token_auth: z
210
+ .lazy(() => unmarshalBearerTokenAuthSchema)
211
+ .optional(),
212
+ api_key_auth: z.lazy(() => unmarshalApiKeyAuthSchema).optional(),
213
+ })
214
+ .transform(d => ({
215
+ customProviderUrl: d.custom_provider_url,
216
+ bearerTokenAuth: d.bearer_token_auth,
217
+ apiKeyAuth: d.api_key_auth,
218
+ }));
219
+ export const unmarshalDataPlaneInfoSchema = z
220
+ .object({
221
+ endpoint_url: z.string().optional(),
222
+ authorization_details: z.string().optional(),
223
+ })
224
+ .transform(d => ({
225
+ endpointUrl: d.endpoint_url,
226
+ authorizationDetails: d.authorization_details,
227
+ }));
228
+ export const unmarshalDatabricksModelServingConfigSchema = z
229
+ .object({
230
+ databricks_api_token: z.string().optional(),
231
+ databricks_workspace_url: z.string().optional(),
232
+ databricks_api_token_plaintext: z.string().optional(),
233
+ })
234
+ .transform(d => ({
235
+ databricksApiToken: d.databricks_api_token,
236
+ databricksWorkspaceUrl: d.databricks_workspace_url,
237
+ databricksApiTokenPlaintext: d.databricks_api_token_plaintext,
238
+ }));
239
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
240
+ export const unmarshalDeleteInferenceEndpointRequest_ResponseSchema = z.object({});
241
+ export const unmarshalEmailNotificationsSchema = z
242
+ .object({
243
+ on_update_success: z.array(z.string()).optional(),
244
+ on_update_failure: z.array(z.string()).optional(),
245
+ })
246
+ .transform(d => ({
247
+ onUpdateSuccess: d.on_update_success,
248
+ onUpdateFailure: d.on_update_failure,
249
+ }));
250
+ export const unmarshalEndpointCoreConfigOutputSchema = z
251
+ .object({
252
+ config_version: z
253
+ .union([z.number(), z.bigint()])
254
+ .transform(v => BigInt(v))
255
+ .optional(),
256
+ served_entities: z
257
+ .array(z.lazy(() => unmarshalServedModelSchema))
258
+ .optional(),
259
+ served_models: z
260
+ .array(z.lazy(() => unmarshalServedModelSchema))
261
+ .optional(),
262
+ traffic_config: z.lazy(() => unmarshalTrafficConfigSchema).optional(),
263
+ auto_capture_config: z
264
+ .lazy(() => unmarshalAutoCaptureConfigSchema)
265
+ .optional(),
266
+ })
267
+ .transform(d => ({
268
+ configVersion: d.config_version,
269
+ servedEntities: d.served_entities,
270
+ servedModels: d.served_models,
271
+ trafficConfig: d.traffic_config,
272
+ autoCaptureConfig: d.auto_capture_config,
273
+ }));
274
+ export const unmarshalEndpointCoreConfigSummarySchema = z
275
+ .object({
276
+ served_entities: z
277
+ .array(z.lazy(() => unmarshalServedModelLiteSchema))
278
+ .optional(),
279
+ served_models: z
280
+ .array(z.lazy(() => unmarshalServedModelLiteSchema))
281
+ .optional(),
282
+ })
283
+ .transform(d => ({
284
+ servedEntities: d.served_entities,
285
+ servedModels: d.served_models,
286
+ }));
287
+ export const unmarshalEndpointTagSchema = z
288
+ .object({
289
+ key: z.string().optional(),
290
+ value: z.string().optional(),
291
+ })
292
+ .transform(d => ({
293
+ key: d.key,
294
+ value: d.value,
295
+ }));
296
+ export const unmarshalExternalModelSchema = z
297
+ .object({
298
+ provider: z.string().optional(),
299
+ name: z.string().optional(),
300
+ task: z.string().optional(),
301
+ ai21labs_config: z.lazy(() => unmarshalAi21LabsConfigSchema).optional(),
302
+ anthropic_config: z.lazy(() => unmarshalAnthropicConfigSchema).optional(),
303
+ amazon_bedrock_config: z
304
+ .lazy(() => unmarshalAmazonBedrockConfigSchema)
305
+ .optional(),
306
+ cohere_config: z.lazy(() => unmarshalCohereConfigSchema).optional(),
307
+ google_cloud_vertex_ai_config: z
308
+ .lazy(() => unmarshalGoogleCloudVertexAiConfigSchema)
309
+ .optional(),
310
+ databricks_model_serving_config: z
311
+ .lazy(() => unmarshalDatabricksModelServingConfigSchema)
312
+ .optional(),
313
+ openai_config: z.lazy(() => unmarshalOpenAiConfigSchema).optional(),
314
+ palm_config: z.lazy(() => unmarshalPaLmConfigSchema).optional(),
315
+ custom_provider_config: z
316
+ .lazy(() => unmarshalCustomProviderConfigSchema)
317
+ .optional(),
318
+ })
319
+ .transform(d => ({
320
+ provider: d.provider,
321
+ name: d.name,
322
+ task: d.task,
323
+ config: d.ai21labs_config !== undefined
324
+ ? { $case: 'ai21labsConfig', ai21labsConfig: d.ai21labs_config }
325
+ : d.anthropic_config !== undefined
326
+ ? {
327
+ $case: 'anthropicConfig',
328
+ anthropicConfig: d.anthropic_config,
329
+ }
330
+ : d.amazon_bedrock_config !== undefined
331
+ ? {
332
+ $case: 'amazonBedrockConfig',
333
+ amazonBedrockConfig: d.amazon_bedrock_config,
334
+ }
335
+ : d.cohere_config !== undefined
336
+ ? { $case: 'cohereConfig', cohereConfig: d.cohere_config }
337
+ : d.google_cloud_vertex_ai_config !== undefined
338
+ ? {
339
+ $case: 'googleCloudVertexAiConfig',
340
+ googleCloudVertexAiConfig: d.google_cloud_vertex_ai_config,
341
+ }
342
+ : d.databricks_model_serving_config !== undefined
343
+ ? {
344
+ $case: 'databricksModelServingConfig',
345
+ databricksModelServingConfig: d.databricks_model_serving_config,
346
+ }
347
+ : d.openai_config !== undefined
348
+ ? {
349
+ $case: 'openaiConfig',
350
+ openaiConfig: d.openai_config,
351
+ }
352
+ : d.palm_config !== undefined
353
+ ? {
354
+ $case: 'palmConfig',
355
+ palmConfig: d.palm_config,
356
+ }
357
+ : d.custom_provider_config !== undefined
358
+ ? {
359
+ $case: 'customProviderConfig',
360
+ customProviderConfig: d.custom_provider_config,
361
+ }
362
+ : undefined,
363
+ }));
364
+ export const unmarshalFallbackConfigSchema = z
365
+ .object({
366
+ enabled: z.boolean().optional(),
367
+ })
368
+ .transform(d => ({
369
+ enabled: d.enabled,
370
+ }));
371
+ export const unmarshalFoundationModelSchema = z
372
+ .object({
373
+ name: z.string().optional(),
374
+ display_name: z.string().optional(),
375
+ docs: z.string().optional(),
376
+ description: z.string().optional(),
377
+ })
378
+ .transform(d => ({
379
+ name: d.name,
380
+ displayName: d.display_name,
381
+ docs: d.docs,
382
+ description: d.description,
383
+ }));
384
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
385
+ export const unmarshalGetServedModelBuildLogsRequest_ResponseSchema = z
386
+ .object({
387
+ logs: z.string().optional(),
388
+ })
389
+ .transform(d => ({
390
+ logs: d.logs,
391
+ }));
392
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
393
+ export const unmarshalGetServedModelLogsRequest_ResponseSchema = z
394
+ .object({
395
+ logs: z.string().optional(),
396
+ })
397
+ .transform(d => ({
398
+ logs: d.logs,
399
+ }));
400
+ export const unmarshalGoogleCloudVertexAiConfigSchema = z
401
+ .object({
402
+ private_key: z.string().optional(),
403
+ project_id: z.string().optional(),
404
+ region: z.string().optional(),
405
+ private_key_plaintext: z.string().optional(),
406
+ })
407
+ .transform(d => ({
408
+ privateKey: d.private_key,
409
+ projectId: d.project_id,
410
+ region: d.region,
411
+ privateKeyPlaintext: d.private_key_plaintext,
412
+ }));
413
+ export const unmarshalInferenceEndpointSchema = z
414
+ .object({
415
+ name: z.string().optional(),
416
+ creator: z.string().optional(),
417
+ creation_timestamp: z
418
+ .union([z.number(), z.bigint()])
419
+ .transform(v => BigInt(v))
420
+ .optional(),
421
+ last_updated_timestamp: z
422
+ .union([z.number(), z.bigint()])
423
+ .transform(v => BigInt(v))
424
+ .optional(),
425
+ state: z.lazy(() => unmarshalInferenceEndpointStateSchema).optional(),
426
+ config: z.lazy(() => unmarshalEndpointCoreConfigSummarySchema).optional(),
427
+ tags: z.array(z.lazy(() => unmarshalEndpointTagSchema)).optional(),
428
+ id: z.string().optional(),
429
+ task: z.string().optional(),
430
+ ai_gateway: z.lazy(() => unmarshalAiGatewayConfigSchema).optional(),
431
+ budget_policy_id: z.string().optional(),
432
+ description: z.string().optional(),
433
+ usage_policy_id: z.string().optional(),
434
+ })
435
+ .transform(d => ({
436
+ name: d.name,
437
+ creator: d.creator,
438
+ creationTimestamp: d.creation_timestamp,
439
+ lastUpdatedTimestamp: d.last_updated_timestamp,
440
+ state: d.state,
441
+ config: d.config,
442
+ tags: d.tags,
443
+ id: d.id,
444
+ task: d.task,
445
+ aiGateway: d.ai_gateway,
446
+ budgetPolicyId: d.budget_policy_id,
447
+ description: d.description,
448
+ usagePolicyId: d.usage_policy_id,
449
+ }));
450
+ export const unmarshalInferenceEndpointDetailedSchema = z
451
+ .object({
452
+ name: z.string().optional(),
453
+ creator: z.string().optional(),
454
+ creation_timestamp: z
455
+ .union([z.number(), z.bigint()])
456
+ .transform(v => BigInt(v))
457
+ .optional(),
458
+ last_updated_timestamp: z
459
+ .union([z.number(), z.bigint()])
460
+ .transform(v => BigInt(v))
461
+ .optional(),
462
+ state: z.lazy(() => unmarshalInferenceEndpointStateSchema).optional(),
463
+ config: z.lazy(() => unmarshalEndpointCoreConfigOutputSchema).optional(),
464
+ pending_config: z.lazy(() => unmarshalPendingConfigSchema).optional(),
465
+ id: z.string().optional(),
466
+ permission_level: z
467
+ .enum(ServingEndpointDetailedPermissionLevel)
468
+ .optional(),
469
+ tags: z.array(z.lazy(() => unmarshalEndpointTagSchema)).optional(),
470
+ task: z.string().optional(),
471
+ route_optimized: z.boolean().optional(),
472
+ endpoint_url: z.string().optional(),
473
+ data_plane_info: z
474
+ .lazy(() => unmarshalModelDataPlaneInfoSchema)
475
+ .optional(),
476
+ ai_gateway: z.lazy(() => unmarshalAiGatewayConfigSchema).optional(),
477
+ budget_policy_id: z.string().optional(),
478
+ email_notifications: z
479
+ .lazy(() => unmarshalEmailNotificationsSchema)
480
+ .optional(),
481
+ description: z.string().optional(),
482
+ })
483
+ .transform(d => ({
484
+ name: d.name,
485
+ creator: d.creator,
486
+ creationTimestamp: d.creation_timestamp,
487
+ lastUpdatedTimestamp: d.last_updated_timestamp,
488
+ state: d.state,
489
+ config: d.config,
490
+ pendingConfig: d.pending_config,
491
+ id: d.id,
492
+ permissionLevel: d.permission_level,
493
+ tags: d.tags,
494
+ task: d.task,
495
+ routeOptimized: d.route_optimized,
496
+ endpointUrl: d.endpoint_url,
497
+ dataPlaneInfo: d.data_plane_info,
498
+ aiGateway: d.ai_gateway,
499
+ budgetPolicyId: d.budget_policy_id,
500
+ emailNotifications: d.email_notifications,
501
+ description: d.description,
502
+ }));
503
+ export const unmarshalInferenceEndpointStateSchema = z
504
+ .object({
505
+ ready: z.enum(InferenceEndpointState_ReadyState).optional(),
506
+ config_update: z
507
+ .enum(InferenceEndpointState_ConfigUpdateState)
508
+ .optional(),
509
+ })
510
+ .transform(d => ({
511
+ ready: d.ready,
512
+ configUpdate: d.config_update,
513
+ }));
514
+ export const unmarshalInferenceTableConfigSchema = z
515
+ .object({
516
+ catalog_name: z.string().optional(),
517
+ schema_name: z.string().optional(),
518
+ table_name_prefix: z.string().optional(),
519
+ enabled: z.boolean().optional(),
520
+ })
521
+ .transform(d => ({
522
+ catalogName: d.catalog_name,
523
+ schemaName: d.schema_name,
524
+ tableNamePrefix: d.table_name_prefix,
525
+ enabled: d.enabled,
526
+ }));
527
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
528
+ export const unmarshalListInferenceEndpointsRequest_ResponseSchema = z
529
+ .object({
530
+ endpoints: z
531
+ .array(z.lazy(() => unmarshalInferenceEndpointSchema))
532
+ .optional(),
533
+ })
534
+ .transform(d => ({
535
+ endpoints: d.endpoints,
536
+ }));
537
+ export const unmarshalModelDataPlaneInfoSchema = z
538
+ .object({
539
+ query_info: z.lazy(() => unmarshalDataPlaneInfoSchema).optional(),
540
+ })
541
+ .transform(d => ({
542
+ queryInfo: d.query_info,
543
+ }));
544
+ export const unmarshalOpenAiConfigSchema = z
545
+ .object({
546
+ openai_api_key: z.string().optional(),
547
+ openai_api_type: z.string().optional(),
548
+ openai_api_base: z.string().optional(),
549
+ openai_api_version: z.string().optional(),
550
+ openai_deployment_name: z.string().optional(),
551
+ openai_organization: z.string().optional(),
552
+ microsoft_entra_tenant_id: z.string().optional(),
553
+ microsoft_entra_client_id: z.string().optional(),
554
+ microsoft_entra_client_secret: z.string().optional(),
555
+ openai_api_key_plaintext: z.string().optional(),
556
+ microsoft_entra_client_secret_plaintext: z.string().optional(),
557
+ })
558
+ .transform(d => ({
559
+ openaiApiKey: d.openai_api_key,
560
+ openaiApiType: d.openai_api_type,
561
+ openaiApiBase: d.openai_api_base,
562
+ openaiApiVersion: d.openai_api_version,
563
+ openaiDeploymentName: d.openai_deployment_name,
564
+ openaiOrganization: d.openai_organization,
565
+ microsoftEntraTenantId: d.microsoft_entra_tenant_id,
566
+ microsoftEntraClientId: d.microsoft_entra_client_id,
567
+ microsoftEntraClientSecret: d.microsoft_entra_client_secret,
568
+ openaiApiKeyPlaintext: d.openai_api_key_plaintext,
569
+ microsoftEntraClientSecretPlaintext: d.microsoft_entra_client_secret_plaintext,
570
+ }));
571
+ export const unmarshalPaLmConfigSchema = z
572
+ .object({
573
+ palm_api_key: z.string().optional(),
574
+ palm_api_key_plaintext: z.string().optional(),
575
+ })
576
+ .transform(d => ({
577
+ palmApiKey: d.palm_api_key,
578
+ palmApiKeyPlaintext: d.palm_api_key_plaintext,
579
+ }));
580
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
581
+ export const unmarshalPatchInferenceEndpointTagsRequest_ResponseSchema = z
582
+ .object({
583
+ tags: z.array(z.lazy(() => unmarshalEndpointTagSchema)).optional(),
584
+ })
585
+ .transform(d => ({
586
+ tags: d.tags,
587
+ }));
588
+ export const unmarshalPayloadTableSchema = z
589
+ .object({
590
+ name: z.string().optional(),
591
+ status: z.string().optional(),
592
+ status_message: z.string().optional(),
593
+ })
594
+ .transform(d => ({
595
+ name: d.name,
596
+ status: d.status,
597
+ statusMessage: d.status_message,
598
+ }));
599
+ export const unmarshalPendingConfigSchema = z
600
+ .object({
601
+ served_entities: z
602
+ .array(z.lazy(() => unmarshalServedModelSchema))
603
+ .optional(),
604
+ served_models: z.array(z.lazy(() => unmarshalServedModelSchema)).optional(),
605
+ traffic_config: z.lazy(() => unmarshalTrafficConfigSchema).optional(),
606
+ config_version: z.number().optional(),
607
+ start_time: z
608
+ .union([z.number(), z.bigint()])
609
+ .transform(v => BigInt(v))
610
+ .optional(),
611
+ auto_capture_config: z
612
+ .lazy(() => unmarshalAutoCaptureConfigSchema)
613
+ .optional(),
614
+ })
615
+ .transform(d => ({
616
+ servedEntities: d.served_entities,
617
+ servedModels: d.served_models,
618
+ trafficConfig: d.traffic_config,
619
+ configVersion: d.config_version,
620
+ startTime: d.start_time,
621
+ autoCaptureConfig: d.auto_capture_config,
622
+ }));
623
+ export const unmarshalPiiSettingsSchema = z
624
+ .object({
625
+ behavior: z.enum(Behavior).optional(),
626
+ })
627
+ .transform(d => ({
628
+ behavior: d.behavior,
629
+ }));
630
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
631
+ export const unmarshalPutInferenceEndpointAiGatewayRequest_ResponseSchema = z
632
+ .object({
633
+ usage_tracking_config: z
634
+ .lazy(() => unmarshalUsageTrackingConfigSchema)
635
+ .optional(),
636
+ inference_table_config: z
637
+ .lazy(() => unmarshalInferenceTableConfigSchema)
638
+ .optional(),
639
+ rate_limits: z
640
+ .array(z.lazy(() => unmarshalAiGatewayRateLimitSchema))
641
+ .optional(),
642
+ guardrails: z.lazy(() => unmarshalAiGuardrailsSchema).optional(),
643
+ fallback_config: z.lazy(() => unmarshalFallbackConfigSchema).optional(),
644
+ })
645
+ .transform(d => ({
646
+ usageTrackingConfig: d.usage_tracking_config,
647
+ inferenceTableConfig: d.inference_table_config,
648
+ rateLimits: d.rate_limits,
649
+ guardrails: d.guardrails,
650
+ fallbackConfig: d.fallback_config,
651
+ }));
652
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
653
+ export const unmarshalPutInferenceEndpointRateLimitsRequest_ResponseSchema = z
654
+ .object({
655
+ rate_limits: z.array(z.lazy(() => unmarshalRateLimitSchema)).optional(),
656
+ })
657
+ .transform(d => ({
658
+ rateLimits: d.rate_limits,
659
+ }));
660
+ export const unmarshalRateLimitSchema = z
661
+ .object({
662
+ calls: z
663
+ .union([z.number(), z.bigint()])
664
+ .transform(v => BigInt(v))
665
+ .optional(),
666
+ key: z.string().optional(),
667
+ renewal_period: z.string().optional(),
668
+ })
669
+ .transform(d => ({
670
+ calls: d.calls,
671
+ key: d.key,
672
+ renewalPeriod: d.renewal_period,
673
+ }));
674
+ export const unmarshalRouteSchema = z
675
+ .object({
676
+ served_model_name: z.string().optional(),
677
+ traffic_percentage: z.number().optional(),
678
+ served_entity_name: z.string().optional(),
679
+ })
680
+ .transform(d => ({
681
+ servedModelName: d.served_model_name,
682
+ trafficPercentage: d.traffic_percentage,
683
+ servedEntityName: d.served_entity_name,
684
+ }));
685
+ export const unmarshalServedModelSchema = z
686
+ .object({
687
+ name: z.string().optional(),
688
+ external_model: z.lazy(() => unmarshalExternalModelSchema).optional(),
689
+ entity_name: z.string().optional(),
690
+ entity_version: z.string().optional(),
691
+ min_provisioned_throughput: z.number().optional(),
692
+ max_provisioned_throughput: z.number().optional(),
693
+ min_provisioned_concurrency: z.number().optional(),
694
+ max_provisioned_concurrency: z.number().optional(),
695
+ workload_size: z.string().optional(),
696
+ provisioned_model_units: z
697
+ .union([z.number(), z.bigint()])
698
+ .transform(v => BigInt(v))
699
+ .optional(),
700
+ burst_scaling_enabled: z.boolean().optional(),
701
+ scale_to_zero_enabled: z.boolean().optional(),
702
+ model_name: z.string().optional(),
703
+ model_version: z.string().optional(),
704
+ environment_vars: z.record(z.string(), z.string()).optional(),
705
+ instance_profile_arn: z.string().optional(),
706
+ foundation_model: z.lazy(() => unmarshalFoundationModelSchema).optional(),
707
+ state: z.lazy(() => unmarshalServedModelStateSchema).optional(),
708
+ creator: z.string().optional(),
709
+ creation_timestamp: z
710
+ .union([z.number(), z.bigint()])
711
+ .transform(v => BigInt(v))
712
+ .optional(),
713
+ })
714
+ .transform(d => ({
715
+ name: d.name,
716
+ externalModel: d.external_model,
717
+ entityName: d.entity_name,
718
+ entityVersion: d.entity_version,
719
+ minProvisionedThroughput: d.min_provisioned_throughput,
720
+ maxProvisionedThroughput: d.max_provisioned_throughput,
721
+ minProvisionedConcurrency: d.min_provisioned_concurrency,
722
+ maxProvisionedConcurrency: d.max_provisioned_concurrency,
723
+ workloadSize: d.workload_size,
724
+ provisionedModelUnits: d.provisioned_model_units,
725
+ burstScalingEnabled: d.burst_scaling_enabled,
726
+ scaleToZeroEnabled: d.scale_to_zero_enabled,
727
+ modelName: d.model_name,
728
+ modelVersion: d.model_version,
729
+ environmentVars: d.environment_vars,
730
+ instanceProfileArn: d.instance_profile_arn,
731
+ foundationModel: d.foundation_model,
732
+ state: d.state,
733
+ creator: d.creator,
734
+ creationTimestamp: d.creation_timestamp,
735
+ }));
736
+ export const unmarshalServedModelLiteSchema = z
737
+ .object({
738
+ name: z.string().optional(),
739
+ model_name: z.string().optional(),
740
+ entity_name: z.string().optional(),
741
+ model_version: z.string().optional(),
742
+ entity_version: z.string().optional(),
743
+ external_model: z.lazy(() => unmarshalExternalModelSchema).optional(),
744
+ foundation_model: z.lazy(() => unmarshalFoundationModelSchema).optional(),
745
+ })
746
+ .transform(d => ({
747
+ name: d.name,
748
+ modelName: d.model_name,
749
+ entityName: d.entity_name,
750
+ modelVersion: d.model_version,
751
+ entityVersion: d.entity_version,
752
+ externalModel: d.external_model,
753
+ foundationModel: d.foundation_model,
754
+ }));
755
+ export const unmarshalServedModelStateSchema = z
756
+ .object({
757
+ deployment: z.enum(ServedModelDeploymentState).optional(),
758
+ deployment_state_message: z.string().optional(),
759
+ })
760
+ .transform(d => ({
761
+ deployment: d.deployment,
762
+ deploymentStateMessage: d.deployment_state_message,
763
+ }));
764
+ export const unmarshalTrafficConfigSchema = z
765
+ .object({
766
+ routes: z.array(z.lazy(() => unmarshalRouteSchema)).optional(),
767
+ })
768
+ .transform(d => ({
769
+ routes: d.routes,
770
+ }));
771
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
772
+ export const unmarshalUpdateInferenceEndpointNotificationsRequest_ResponseSchema = z
773
+ .object({
774
+ name: z.string().optional(),
775
+ email_notifications: z
776
+ .lazy(() => unmarshalEmailNotificationsSchema)
777
+ .optional(),
778
+ })
779
+ .transform(d => ({
780
+ name: d.name,
781
+ emailNotifications: d.email_notifications,
782
+ }));
783
+ export const unmarshalUsageTrackingConfigSchema = z
784
+ .object({
785
+ enabled: z.boolean().optional(),
786
+ })
787
+ .transform(d => ({
788
+ enabled: d.enabled,
789
+ }));
790
+ export const marshalAi21LabsConfigSchema = z
791
+ .object({
792
+ ai21labsApiKey: z.string().optional(),
793
+ ai21labsApiKeyPlaintext: z.string().optional(),
794
+ })
795
+ .transform(d => ({
796
+ ai21labs_api_key: d.ai21labsApiKey,
797
+ ai21labs_api_key_plaintext: d.ai21labsApiKeyPlaintext,
798
+ }));
799
+ export const marshalAiGatewayConfigSchema = z
800
+ .object({
801
+ usageTrackingConfig: z
802
+ .lazy(() => marshalUsageTrackingConfigSchema)
803
+ .optional(),
804
+ inferenceTableConfig: z
805
+ .lazy(() => marshalInferenceTableConfigSchema)
806
+ .optional(),
807
+ rateLimits: z
808
+ .array(z.lazy(() => marshalAiGatewayRateLimitSchema))
809
+ .optional(),
810
+ guardrails: z.lazy(() => marshalAiGuardrailsSchema).optional(),
811
+ fallbackConfig: z.lazy(() => marshalFallbackConfigSchema).optional(),
812
+ })
813
+ .transform(d => ({
814
+ usage_tracking_config: d.usageTrackingConfig,
815
+ inference_table_config: d.inferenceTableConfig,
816
+ rate_limits: d.rateLimits,
817
+ guardrails: d.guardrails,
818
+ fallback_config: d.fallbackConfig,
819
+ }));
820
+ export const marshalAiGatewayRateLimitSchema = z
821
+ .object({
822
+ calls: z.bigint().optional(),
823
+ key: z.string().optional(),
824
+ renewalPeriod: z.string().optional(),
825
+ principal: z.string().optional(),
826
+ tokens: z.bigint().optional(),
827
+ })
828
+ .transform(d => ({
829
+ calls: d.calls,
830
+ key: d.key,
831
+ renewal_period: d.renewalPeriod,
832
+ principal: d.principal,
833
+ tokens: d.tokens,
834
+ }));
835
+ export const marshalAiGuardrailParametersSchema = z
836
+ .object({
837
+ safety: z.boolean().optional(),
838
+ pii: z.lazy(() => marshalPiiSettingsSchema).optional(),
839
+ validTopics: z.array(z.string()).optional(),
840
+ invalidKeywords: z.array(z.string()).optional(),
841
+ })
842
+ .transform(d => ({
843
+ safety: d.safety,
844
+ pii: d.pii,
845
+ valid_topics: d.validTopics,
846
+ invalid_keywords: d.invalidKeywords,
847
+ }));
848
+ export const marshalAiGuardrailsSchema = z
849
+ .object({
850
+ input: z.lazy(() => marshalAiGuardrailParametersSchema).optional(),
851
+ output: z.lazy(() => marshalAiGuardrailParametersSchema).optional(),
852
+ })
853
+ .transform(d => ({
854
+ input: d.input,
855
+ output: d.output,
856
+ }));
857
+ export const marshalAmazonBedrockConfigSchema = z
858
+ .object({
859
+ awsRegion: z.string().optional(),
860
+ awsAccessKeyId: z.string().optional(),
861
+ awsSecretAccessKey: z.string().optional(),
862
+ bedrockProvider: z.string().optional(),
863
+ awsAccessKeyIdPlaintext: z.string().optional(),
864
+ awsSecretAccessKeyPlaintext: z.string().optional(),
865
+ instanceProfileArn: z.string().optional(),
866
+ })
867
+ .transform(d => ({
868
+ aws_region: d.awsRegion,
869
+ aws_access_key_id: d.awsAccessKeyId,
870
+ aws_secret_access_key: d.awsSecretAccessKey,
871
+ bedrock_provider: d.bedrockProvider,
872
+ aws_access_key_id_plaintext: d.awsAccessKeyIdPlaintext,
873
+ aws_secret_access_key_plaintext: d.awsSecretAccessKeyPlaintext,
874
+ instance_profile_arn: d.instanceProfileArn,
875
+ }));
876
+ export const marshalAnthropicConfigSchema = z
877
+ .object({
878
+ anthropicApiKey: z.string().optional(),
879
+ anthropicApiKeyPlaintext: z.string().optional(),
880
+ })
881
+ .transform(d => ({
882
+ anthropic_api_key: d.anthropicApiKey,
883
+ anthropic_api_key_plaintext: d.anthropicApiKeyPlaintext,
884
+ }));
885
+ export const marshalApiKeyAuthSchema = z
886
+ .object({
887
+ key: z.string().optional(),
888
+ value: z.string().optional(),
889
+ valuePlaintext: z.string().optional(),
890
+ })
891
+ .transform(d => ({
892
+ key: d.key,
893
+ value: d.value,
894
+ value_plaintext: d.valuePlaintext,
895
+ }));
896
+ export const marshalAutoCaptureConfigSchema = z
897
+ .object({
898
+ catalogName: z.string().optional(),
899
+ schemaName: z.string().optional(),
900
+ tableNamePrefix: z.string().optional(),
901
+ state: z.lazy(() => marshalAutoCaptureStateSchema).optional(),
902
+ enabled: z.boolean().optional(),
903
+ })
904
+ .transform(d => ({
905
+ catalog_name: d.catalogName,
906
+ schema_name: d.schemaName,
907
+ table_name_prefix: d.tableNamePrefix,
908
+ state: d.state,
909
+ enabled: d.enabled,
910
+ }));
911
+ export const marshalAutoCaptureStateSchema = z
912
+ .object({
913
+ payloadTable: z.lazy(() => marshalPayloadTableSchema).optional(),
914
+ })
915
+ .transform(d => ({
916
+ payload_table: d.payloadTable,
917
+ }));
918
+ export const marshalBearerTokenAuthSchema = z
919
+ .object({
920
+ token: z.string().optional(),
921
+ tokenPlaintext: z.string().optional(),
922
+ })
923
+ .transform(d => ({
924
+ token: d.token,
925
+ token_plaintext: d.tokenPlaintext,
926
+ }));
927
+ export const marshalCohereConfigSchema = z
928
+ .object({
929
+ cohereApiKey: z.string().optional(),
930
+ cohereApiKeyPlaintext: z.string().optional(),
931
+ cohereApiBase: z.string().optional(),
932
+ })
933
+ .transform(d => ({
934
+ cohere_api_key: d.cohereApiKey,
935
+ cohere_api_key_plaintext: d.cohereApiKeyPlaintext,
936
+ cohere_api_base: d.cohereApiBase,
937
+ }));
938
+ export const marshalCreateInferenceEndpointRequestSchema = z
939
+ .object({
940
+ name: z.string().optional(),
941
+ config: z.lazy(() => marshalEndpointCoreConfigSchema).optional(),
942
+ tags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(),
943
+ routeOptimized: z.boolean().optional(),
944
+ rateLimits: z.array(z.lazy(() => marshalRateLimitSchema)).optional(),
945
+ aiGateway: z.lazy(() => marshalAiGatewayConfigSchema).optional(),
946
+ budgetPolicyId: z.string().optional(),
947
+ emailNotifications: z
948
+ .lazy(() => marshalEmailNotificationsSchema)
949
+ .optional(),
950
+ description: z.string().optional(),
951
+ })
952
+ .transform(d => ({
953
+ name: d.name,
954
+ config: d.config,
955
+ tags: d.tags,
956
+ route_optimized: d.routeOptimized,
957
+ rate_limits: d.rateLimits,
958
+ ai_gateway: d.aiGateway,
959
+ budget_policy_id: d.budgetPolicyId,
960
+ email_notifications: d.emailNotifications,
961
+ description: d.description,
962
+ }));
963
+ export const marshalCreatePtEndpointRequestSchema = z
964
+ .object({
965
+ name: z.string().optional(),
966
+ config: z.lazy(() => marshalPtEndpointCoreConfigSchema).optional(),
967
+ tags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(),
968
+ aiGateway: z.lazy(() => marshalAiGatewayConfigSchema).optional(),
969
+ budgetPolicyId: z.string().optional(),
970
+ emailNotifications: z
971
+ .lazy(() => marshalEmailNotificationsSchema)
972
+ .optional(),
973
+ })
974
+ .transform(d => ({
975
+ name: d.name,
976
+ config: d.config,
977
+ tags: d.tags,
978
+ ai_gateway: d.aiGateway,
979
+ budget_policy_id: d.budgetPolicyId,
980
+ email_notifications: d.emailNotifications,
981
+ }));
982
+ export const marshalCustomProviderConfigSchema = z
983
+ .object({
984
+ customProviderUrl: z.string().optional(),
985
+ bearerTokenAuth: z.lazy(() => marshalBearerTokenAuthSchema).optional(),
986
+ apiKeyAuth: z.lazy(() => marshalApiKeyAuthSchema).optional(),
987
+ })
988
+ .transform(d => ({
989
+ custom_provider_url: d.customProviderUrl,
990
+ bearer_token_auth: d.bearerTokenAuth,
991
+ api_key_auth: d.apiKeyAuth,
992
+ }));
993
+ export const marshalDatabricksModelServingConfigSchema = z
994
+ .object({
995
+ databricksApiToken: z.string().optional(),
996
+ databricksWorkspaceUrl: z.string().optional(),
997
+ databricksApiTokenPlaintext: z.string().optional(),
998
+ })
999
+ .transform(d => ({
1000
+ databricks_api_token: d.databricksApiToken,
1001
+ databricks_workspace_url: d.databricksWorkspaceUrl,
1002
+ databricks_api_token_plaintext: d.databricksApiTokenPlaintext,
1003
+ }));
1004
+ export const marshalEmailNotificationsSchema = z
1005
+ .object({
1006
+ onUpdateSuccess: z.array(z.string()).optional(),
1007
+ onUpdateFailure: z.array(z.string()).optional(),
1008
+ })
1009
+ .transform(d => ({
1010
+ on_update_success: d.onUpdateSuccess,
1011
+ on_update_failure: d.onUpdateFailure,
1012
+ }));
1013
+ export const marshalEndpointCoreConfigSchema = z
1014
+ .object({
1015
+ servedEntities: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
1016
+ servedModels: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
1017
+ trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(),
1018
+ autoCaptureConfig: z.lazy(() => marshalAutoCaptureConfigSchema).optional(),
1019
+ })
1020
+ .transform(d => ({
1021
+ served_entities: d.servedEntities,
1022
+ served_models: d.servedModels,
1023
+ traffic_config: d.trafficConfig,
1024
+ auto_capture_config: d.autoCaptureConfig,
1025
+ }));
1026
+ export const marshalEndpointTagSchema = z
1027
+ .object({
1028
+ key: z.string().optional(),
1029
+ value: z.string().optional(),
1030
+ })
1031
+ .transform(d => ({
1032
+ key: d.key,
1033
+ value: d.value,
1034
+ }));
1035
+ export const marshalExternalFunctionRequestSchema = z
1036
+ .object({
1037
+ connectionName: z.string().optional(),
1038
+ method: z.enum(ExternalFunctionRequest_HttpMethod).optional(),
1039
+ path: z.string().optional(),
1040
+ json: z.string().optional(),
1041
+ headers: z.string().optional(),
1042
+ params: z.string().optional(),
1043
+ subDomain: z.string().optional(),
1044
+ })
1045
+ .transform(d => ({
1046
+ connection_name: d.connectionName,
1047
+ method: d.method,
1048
+ path: d.path,
1049
+ json: d.json,
1050
+ headers: d.headers,
1051
+ params: d.params,
1052
+ sub_domain: d.subDomain,
1053
+ }));
1054
+ export const marshalExternalModelSchema = z
1055
+ .object({
1056
+ provider: z.string().optional(),
1057
+ name: z.string().optional(),
1058
+ task: z.string().optional(),
1059
+ config: z
1060
+ .discriminatedUnion('$case', [
1061
+ z.object({
1062
+ $case: z.literal('ai21labsConfig'),
1063
+ ai21labsConfig: z.lazy(() => marshalAi21LabsConfigSchema),
1064
+ }),
1065
+ z.object({
1066
+ $case: z.literal('anthropicConfig'),
1067
+ anthropicConfig: z.lazy(() => marshalAnthropicConfigSchema),
1068
+ }),
1069
+ z.object({
1070
+ $case: z.literal('amazonBedrockConfig'),
1071
+ amazonBedrockConfig: z.lazy(() => marshalAmazonBedrockConfigSchema),
1072
+ }),
1073
+ z.object({
1074
+ $case: z.literal('cohereConfig'),
1075
+ cohereConfig: z.lazy(() => marshalCohereConfigSchema),
1076
+ }),
1077
+ z.object({
1078
+ $case: z.literal('googleCloudVertexAiConfig'),
1079
+ googleCloudVertexAiConfig: z.lazy(() => marshalGoogleCloudVertexAiConfigSchema),
1080
+ }),
1081
+ z.object({
1082
+ $case: z.literal('databricksModelServingConfig'),
1083
+ databricksModelServingConfig: z.lazy(() => marshalDatabricksModelServingConfigSchema),
1084
+ }),
1085
+ z.object({
1086
+ $case: z.literal('openaiConfig'),
1087
+ openaiConfig: z.lazy(() => marshalOpenAiConfigSchema),
1088
+ }),
1089
+ z.object({
1090
+ $case: z.literal('palmConfig'),
1091
+ palmConfig: z.lazy(() => marshalPaLmConfigSchema),
1092
+ }),
1093
+ z.object({
1094
+ $case: z.literal('customProviderConfig'),
1095
+ customProviderConfig: z.lazy(() => marshalCustomProviderConfigSchema),
1096
+ }),
1097
+ ])
1098
+ .optional(),
1099
+ })
1100
+ .transform(d => ({
1101
+ provider: d.provider,
1102
+ name: d.name,
1103
+ task: d.task,
1104
+ ...(d.config?.$case === 'ai21labsConfig' && {
1105
+ ai21labs_config: d.config.ai21labsConfig,
1106
+ }),
1107
+ ...(d.config?.$case === 'anthropicConfig' && {
1108
+ anthropic_config: d.config.anthropicConfig,
1109
+ }),
1110
+ ...(d.config?.$case === 'amazonBedrockConfig' && {
1111
+ amazon_bedrock_config: d.config.amazonBedrockConfig,
1112
+ }),
1113
+ ...(d.config?.$case === 'cohereConfig' && {
1114
+ cohere_config: d.config.cohereConfig,
1115
+ }),
1116
+ ...(d.config?.$case === 'googleCloudVertexAiConfig' && {
1117
+ google_cloud_vertex_ai_config: d.config.googleCloudVertexAiConfig,
1118
+ }),
1119
+ ...(d.config?.$case === 'databricksModelServingConfig' && {
1120
+ databricks_model_serving_config: d.config.databricksModelServingConfig,
1121
+ }),
1122
+ ...(d.config?.$case === 'openaiConfig' && {
1123
+ openai_config: d.config.openaiConfig,
1124
+ }),
1125
+ ...(d.config?.$case === 'palmConfig' && { palm_config: d.config.palmConfig }),
1126
+ ...(d.config?.$case === 'customProviderConfig' && {
1127
+ custom_provider_config: d.config.customProviderConfig,
1128
+ }),
1129
+ }));
1130
+ export const marshalFallbackConfigSchema = z
1131
+ .object({
1132
+ enabled: z.boolean().optional(),
1133
+ })
1134
+ .transform(d => ({
1135
+ enabled: d.enabled,
1136
+ }));
1137
+ export const marshalFoundationModelSchema = z
1138
+ .object({
1139
+ name: z.string().optional(),
1140
+ displayName: z.string().optional(),
1141
+ docs: z.string().optional(),
1142
+ description: z.string().optional(),
1143
+ })
1144
+ .transform(d => ({
1145
+ name: d.name,
1146
+ display_name: d.displayName,
1147
+ docs: d.docs,
1148
+ description: d.description,
1149
+ }));
1150
+ export const marshalGoogleCloudVertexAiConfigSchema = z
1151
+ .object({
1152
+ privateKey: z.string().optional(),
1153
+ projectId: z.string().optional(),
1154
+ region: z.string().optional(),
1155
+ privateKeyPlaintext: z.string().optional(),
1156
+ })
1157
+ .transform(d => ({
1158
+ private_key: d.privateKey,
1159
+ project_id: d.projectId,
1160
+ region: d.region,
1161
+ private_key_plaintext: d.privateKeyPlaintext,
1162
+ }));
1163
+ export const marshalInferenceTableConfigSchema = z
1164
+ .object({
1165
+ catalogName: z.string().optional(),
1166
+ schemaName: z.string().optional(),
1167
+ tableNamePrefix: z.string().optional(),
1168
+ enabled: z.boolean().optional(),
1169
+ })
1170
+ .transform(d => ({
1171
+ catalog_name: d.catalogName,
1172
+ schema_name: d.schemaName,
1173
+ table_name_prefix: d.tableNamePrefix,
1174
+ enabled: d.enabled,
1175
+ }));
1176
+ export const marshalOpenAiConfigSchema = z
1177
+ .object({
1178
+ openaiApiKey: z.string().optional(),
1179
+ openaiApiType: z.string().optional(),
1180
+ openaiApiBase: z.string().optional(),
1181
+ openaiApiVersion: z.string().optional(),
1182
+ openaiDeploymentName: z.string().optional(),
1183
+ openaiOrganization: z.string().optional(),
1184
+ microsoftEntraTenantId: z.string().optional(),
1185
+ microsoftEntraClientId: z.string().optional(),
1186
+ microsoftEntraClientSecret: z.string().optional(),
1187
+ openaiApiKeyPlaintext: z.string().optional(),
1188
+ microsoftEntraClientSecretPlaintext: z.string().optional(),
1189
+ })
1190
+ .transform(d => ({
1191
+ openai_api_key: d.openaiApiKey,
1192
+ openai_api_type: d.openaiApiType,
1193
+ openai_api_base: d.openaiApiBase,
1194
+ openai_api_version: d.openaiApiVersion,
1195
+ openai_deployment_name: d.openaiDeploymentName,
1196
+ openai_organization: d.openaiOrganization,
1197
+ microsoft_entra_tenant_id: d.microsoftEntraTenantId,
1198
+ microsoft_entra_client_id: d.microsoftEntraClientId,
1199
+ microsoft_entra_client_secret: d.microsoftEntraClientSecret,
1200
+ openai_api_key_plaintext: d.openaiApiKeyPlaintext,
1201
+ microsoft_entra_client_secret_plaintext: d.microsoftEntraClientSecretPlaintext,
1202
+ }));
1203
+ export const marshalPaLmConfigSchema = z
1204
+ .object({
1205
+ palmApiKey: z.string().optional(),
1206
+ palmApiKeyPlaintext: z.string().optional(),
1207
+ })
1208
+ .transform(d => ({
1209
+ palm_api_key: d.palmApiKey,
1210
+ palm_api_key_plaintext: d.palmApiKeyPlaintext,
1211
+ }));
1212
+ export const marshalPatchInferenceEndpointTagsRequestSchema = z
1213
+ .object({
1214
+ name: z.string().optional(),
1215
+ addTags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(),
1216
+ deleteTags: z.array(z.string()).optional(),
1217
+ })
1218
+ .transform(d => ({
1219
+ name: d.name,
1220
+ add_tags: d.addTags,
1221
+ delete_tags: d.deleteTags,
1222
+ }));
1223
+ export const marshalPayloadTableSchema = z
1224
+ .object({
1225
+ name: z.string().optional(),
1226
+ status: z.string().optional(),
1227
+ statusMessage: z.string().optional(),
1228
+ })
1229
+ .transform(d => ({
1230
+ name: d.name,
1231
+ status: d.status,
1232
+ status_message: d.statusMessage,
1233
+ }));
1234
+ export const marshalPiiSettingsSchema = z
1235
+ .object({
1236
+ behavior: z.enum(Behavior).optional(),
1237
+ })
1238
+ .transform(d => ({
1239
+ behavior: d.behavior,
1240
+ }));
1241
+ export const marshalPtEndpointCoreConfigSchema = z
1242
+ .object({
1243
+ servedEntities: z
1244
+ .array(z.lazy(() => marshalPtServedModelSchema))
1245
+ .optional(),
1246
+ trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(),
1247
+ })
1248
+ .transform(d => ({
1249
+ served_entities: d.servedEntities,
1250
+ traffic_config: d.trafficConfig,
1251
+ }));
1252
+ export const marshalPtServedModelSchema = z
1253
+ .object({
1254
+ name: z.string().optional(),
1255
+ entityName: z.string().optional(),
1256
+ entityVersion: z.string().optional(),
1257
+ provisionedModelUnits: z.bigint().optional(),
1258
+ burstScalingEnabled: z.boolean().optional(),
1259
+ })
1260
+ .transform(d => ({
1261
+ name: d.name,
1262
+ entity_name: d.entityName,
1263
+ entity_version: d.entityVersion,
1264
+ provisioned_model_units: d.provisionedModelUnits,
1265
+ burst_scaling_enabled: d.burstScalingEnabled,
1266
+ }));
1267
+ export const marshalPutInferenceEndpointAiGatewayRequestSchema = z
1268
+ .object({
1269
+ name: z.string().optional(),
1270
+ usageTrackingConfig: z
1271
+ .lazy(() => marshalUsageTrackingConfigSchema)
1272
+ .optional(),
1273
+ inferenceTableConfig: z
1274
+ .lazy(() => marshalInferenceTableConfigSchema)
1275
+ .optional(),
1276
+ rateLimits: z
1277
+ .array(z.lazy(() => marshalAiGatewayRateLimitSchema))
1278
+ .optional(),
1279
+ guardrails: z.lazy(() => marshalAiGuardrailsSchema).optional(),
1280
+ fallbackConfig: z.lazy(() => marshalFallbackConfigSchema).optional(),
1281
+ })
1282
+ .transform(d => ({
1283
+ name: d.name,
1284
+ usage_tracking_config: d.usageTrackingConfig,
1285
+ inference_table_config: d.inferenceTableConfig,
1286
+ rate_limits: d.rateLimits,
1287
+ guardrails: d.guardrails,
1288
+ fallback_config: d.fallbackConfig,
1289
+ }));
1290
+ export const marshalPutInferenceEndpointConfigRequestSchema = z
1291
+ .object({
1292
+ name: z.string().optional(),
1293
+ servedEntities: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
1294
+ servedModels: z.array(z.lazy(() => marshalServedModelSchema)).optional(),
1295
+ trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(),
1296
+ autoCaptureConfig: z.lazy(() => marshalAutoCaptureConfigSchema).optional(),
1297
+ })
1298
+ .transform(d => ({
1299
+ name: d.name,
1300
+ served_entities: d.servedEntities,
1301
+ served_models: d.servedModels,
1302
+ traffic_config: d.trafficConfig,
1303
+ auto_capture_config: d.autoCaptureConfig,
1304
+ }));
1305
+ export const marshalPutInferenceEndpointRateLimitsRequestSchema = z
1306
+ .object({
1307
+ name: z.string().optional(),
1308
+ rateLimits: z.array(z.lazy(() => marshalRateLimitSchema)).optional(),
1309
+ })
1310
+ .transform(d => ({
1311
+ name: d.name,
1312
+ rate_limits: d.rateLimits,
1313
+ }));
1314
+ export const marshalPutPtEndpointConfigRequestSchema = z
1315
+ .object({
1316
+ name: z.string().optional(),
1317
+ config: z.lazy(() => marshalPtEndpointCoreConfigSchema).optional(),
1318
+ })
1319
+ .transform(d => ({
1320
+ name: d.name,
1321
+ config: d.config,
1322
+ }));
1323
+ export const marshalRateLimitSchema = z
1324
+ .object({
1325
+ calls: z.bigint().optional(),
1326
+ key: z.string().optional(),
1327
+ renewalPeriod: z.string().optional(),
1328
+ })
1329
+ .transform(d => ({
1330
+ calls: d.calls,
1331
+ key: d.key,
1332
+ renewal_period: d.renewalPeriod,
1333
+ }));
1334
+ export const marshalRouteSchema = z
1335
+ .object({
1336
+ servedModelName: z.string().optional(),
1337
+ trafficPercentage: z.number().optional(),
1338
+ servedEntityName: z.string().optional(),
1339
+ })
1340
+ .transform(d => ({
1341
+ served_model_name: d.servedModelName,
1342
+ traffic_percentage: d.trafficPercentage,
1343
+ served_entity_name: d.servedEntityName,
1344
+ }));
1345
+ export const marshalServedModelSchema = z
1346
+ .object({
1347
+ name: z.string().optional(),
1348
+ externalModel: z.lazy(() => marshalExternalModelSchema).optional(),
1349
+ entityName: z.string().optional(),
1350
+ entityVersion: z.string().optional(),
1351
+ minProvisionedThroughput: z.number().optional(),
1352
+ maxProvisionedThroughput: z.number().optional(),
1353
+ minProvisionedConcurrency: z.number().optional(),
1354
+ maxProvisionedConcurrency: z.number().optional(),
1355
+ workloadSize: z.string().optional(),
1356
+ provisionedModelUnits: z.bigint().optional(),
1357
+ burstScalingEnabled: z.boolean().optional(),
1358
+ scaleToZeroEnabled: z.boolean().optional(),
1359
+ modelName: z.string().optional(),
1360
+ modelVersion: z.string().optional(),
1361
+ environmentVars: z.record(z.string(), z.string()).optional(),
1362
+ instanceProfileArn: z.string().optional(),
1363
+ foundationModel: z.lazy(() => marshalFoundationModelSchema).optional(),
1364
+ state: z.lazy(() => marshalServedModelStateSchema).optional(),
1365
+ creator: z.string().optional(),
1366
+ creationTimestamp: z.bigint().optional(),
1367
+ })
1368
+ .transform(d => ({
1369
+ name: d.name,
1370
+ external_model: d.externalModel,
1371
+ entity_name: d.entityName,
1372
+ entity_version: d.entityVersion,
1373
+ min_provisioned_throughput: d.minProvisionedThroughput,
1374
+ max_provisioned_throughput: d.maxProvisionedThroughput,
1375
+ min_provisioned_concurrency: d.minProvisionedConcurrency,
1376
+ max_provisioned_concurrency: d.maxProvisionedConcurrency,
1377
+ workload_size: d.workloadSize,
1378
+ provisioned_model_units: d.provisionedModelUnits,
1379
+ burst_scaling_enabled: d.burstScalingEnabled,
1380
+ scale_to_zero_enabled: d.scaleToZeroEnabled,
1381
+ model_name: d.modelName,
1382
+ model_version: d.modelVersion,
1383
+ environment_vars: d.environmentVars,
1384
+ instance_profile_arn: d.instanceProfileArn,
1385
+ foundation_model: d.foundationModel,
1386
+ state: d.state,
1387
+ creator: d.creator,
1388
+ creation_timestamp: d.creationTimestamp,
1389
+ }));
1390
+ export const marshalServedModelStateSchema = z
1391
+ .object({
1392
+ deployment: z.enum(ServedModelDeploymentState).optional(),
1393
+ deploymentStateMessage: z.string().optional(),
1394
+ })
1395
+ .transform(d => ({
1396
+ deployment: d.deployment,
1397
+ deployment_state_message: d.deploymentStateMessage,
1398
+ }));
1399
+ export const marshalTrafficConfigSchema = z
1400
+ .object({
1401
+ routes: z.array(z.lazy(() => marshalRouteSchema)).optional(),
1402
+ })
1403
+ .transform(d => ({
1404
+ routes: d.routes,
1405
+ }));
1406
+ export const marshalUpdateInferenceEndpointNotificationsRequestSchema = z
1407
+ .object({
1408
+ name: z.string().optional(),
1409
+ emailNotifications: z
1410
+ .lazy(() => marshalEmailNotificationsSchema)
1411
+ .optional(),
1412
+ })
1413
+ .transform(d => ({
1414
+ name: d.name,
1415
+ email_notifications: d.emailNotifications,
1416
+ }));
1417
+ export const marshalUsageTrackingConfigSchema = z
1418
+ .object({
1419
+ enabled: z.boolean().optional(),
1420
+ })
1421
+ .transform(d => ({
1422
+ enabled: d.enabled,
1423
+ }));
1424
+ //# sourceMappingURL=model.js.map