File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ async function main() {
119119 model : z . string ( ) ,
120120 provider : z . enum ( PROVIDERS_OR_POLICIES ) . optional ( ) ,
121121 endpointUrl : z . string ( ) . optional ( ) ,
122+ apiKey : z . string ( ) . optional ( ) ,
122123 servers : z . array ( ServerConfigSchema ) ,
123124 } )
124125 . refine ( ( data ) => data . provider !== undefined || data . endpointUrl !== undefined , {
@@ -139,15 +140,15 @@ async function main() {
139140 ? {
140141 endpointUrl : config . endpointUrl ,
141142 model : config . model ,
142- apiKey : process . env . HF_TOKEN ,
143+ apiKey : config . apiKey ?? process . env . API_KEY ?? process . env . HF_TOKEN ,
143144 servers : config . servers ,
144145 prompt,
145146 }
146147 : {
147148 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
148149 provider : config . provider ! ,
149150 model : config . model ,
150- apiKey : process . env . HF_TOKEN ,
151+ apiKey : config . apiKey ?? process . env . API_KEY ?? process . env . HF_TOKEN ,
151152 servers : config . servers ,
152153 prompt,
153154 }
You can’t perform that action at this time.
0 commit comments