@@ -9,20 +9,18 @@ export const BaseMetadataSchema = z.strictObject({
99 supportsStreaming : z . boolean ( ) . prefault ( true ) ,
1010 } ) ;
1111
12- export const AzureMetadataSchema = BaseMetadataSchema . extend (
13- z . strictObject ( {
14- api_base : z . url ( ) ,
15- api_version : z . string ( ) . prefault ( "2023-07-01-preview" ) ,
16- deployment : z . string ( ) . nullish ( ) ,
17- auth_type : z . enum ( [ "api_key" , "entra_api" ] ) . prefault ( "api_key" ) ,
18- no_named_deployment : z
19- . boolean ( )
20- . prefault ( false )
21- . describe (
22- "If true, the deployment name will not be used in the request path." ,
23- ) ,
24- } ) . shape
25- ) ;
12+ export const AzureMetadataSchema = BaseMetadataSchema . extend ( {
13+ api_base : z . url ( ) ,
14+ api_version : z . string ( ) . prefault ( "2023-07-01-preview" ) ,
15+ deployment : z . string ( ) . nullish ( ) ,
16+ auth_type : z . enum ( [ "api_key" , "entra_api" ] ) . prefault ( "api_key" ) ,
17+ no_named_deployment : z
18+ . boolean ( )
19+ . prefault ( false )
20+ . describe (
21+ "If true, the deployment name will not be used in the request path." ,
22+ ) ,
23+ } ) ;
2624
2725export const AzureEntraSecretSchema = z . object ( {
2826 client_id : z . string ( ) . min ( 1 , "Client ID cannot be empty" ) ,
@@ -32,30 +30,24 @@ export const AzureEntraSecretSchema = z.object({
3230} ) ;
3331export type AzureEntraSecret = z . infer < typeof AzureEntraSecretSchema > ;
3432
35- export const BedrockMetadataSchema = BaseMetadataSchema . extend (
36- z . strictObject ( {
37- region : z . string ( ) . min ( 1 , "Region cannot be empty" ) ,
38- access_key : z . string ( ) . min ( 1 , "Access key cannot be empty" ) ,
39- session_token : z . string ( ) . nullish ( ) ,
40- api_base : z . union ( [ z . url ( ) , z . string ( ) . length ( 0 ) ] ) . nullish ( ) ,
41- } ) . shape
42- ) ;
33+ export const BedrockMetadataSchema = BaseMetadataSchema . extend ( {
34+ region : z . string ( ) . min ( 1 , "Region cannot be empty" ) ,
35+ access_key : z . string ( ) . min ( 1 , "Access key cannot be empty" ) ,
36+ session_token : z . string ( ) . nullish ( ) ,
37+ api_base : z . union ( [ z . url ( ) , z . string ( ) . length ( 0 ) ] ) . nullish ( ) ,
38+ } ) ;
4339export type BedrockMetadata = z . infer < typeof BedrockMetadataSchema > ;
4440
45- export const VertexMetadataSchema = BaseMetadataSchema . extend (
46- z . strictObject ( {
47- project : z . string ( ) . min ( 1 , "Project cannot be empty" ) ,
48- authType : z . enum ( [ "access_token" , "service_account_key" ] ) ,
49- api_base : z . union ( [ z . url ( ) , z . string ( ) . length ( 0 ) ] ) . nullish ( ) ,
50- } ) . shape
51- ) ;
41+ export const VertexMetadataSchema = BaseMetadataSchema . extend ( {
42+ project : z . string ( ) . min ( 1 , "Project cannot be empty" ) ,
43+ authType : z . enum ( [ "access_token" , "service_account_key" ] ) ,
44+ api_base : z . union ( [ z . url ( ) , z . string ( ) . length ( 0 ) ] ) . nullish ( ) ,
45+ } ) ;
5246
53- export const DatabricksMetadataSchema = BaseMetadataSchema . extend (
54- z . strictObject ( {
55- api_base : z . url ( ) ,
56- auth_type : z . enum ( [ "pat" , "service_principal_oauth" ] ) . prefault ( "pat" ) ,
57- } ) . shape
58- ) ;
47+ export const DatabricksMetadataSchema = BaseMetadataSchema . extend ( {
48+ api_base : z . url ( ) ,
49+ auth_type : z . enum ( [ "pat" , "service_principal_oauth" ] ) . prefault ( "pat" ) ,
50+ } ) ;
5951
6052export const DatabricksOAuthSecretSchema = z . object ( {
6153 client_id : z . string ( ) . min ( 1 , "Client ID cannot be empty" ) ,
0 commit comments