File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ async function main() {
119
119
model : z . string ( ) ,
120
120
provider : z . enum ( PROVIDERS_OR_POLICIES ) . optional ( ) ,
121
121
endpointUrl : z . string ( ) . optional ( ) ,
122
+ apiKey : z . string ( ) . optional ( ) ,
122
123
servers : z . array ( ServerConfigSchema ) ,
123
124
} )
124
125
. refine ( ( data ) => data . provider !== undefined || data . endpointUrl !== undefined , {
@@ -139,15 +140,15 @@ async function main() {
139
140
? {
140
141
endpointUrl : config . endpointUrl ,
141
142
model : config . model ,
142
- apiKey : process . env . HF_TOKEN ,
143
+ apiKey : config . apiKey ?? process . env . API_KEY ?? process . env . HF_TOKEN ,
143
144
servers : config . servers ,
144
145
prompt,
145
146
}
146
147
: {
147
148
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
148
149
provider : config . provider ! ,
149
150
model : config . model ,
150
- apiKey : process . env . HF_TOKEN ,
151
+ apiKey : config . apiKey ?? process . env . API_KEY ?? process . env . HF_TOKEN ,
151
152
servers : config . servers ,
152
153
prompt,
153
154
}
You can’t perform that action at this time.
0 commit comments