File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,17 @@ export class GPTScript {
139
139
if ( ! this . opts . URL ) {
140
140
this . opts . URL = GPTScript . serverURL
141
141
}
142
+
143
+ if ( ! this . opts . Env ) {
144
+ this . opts . Env = [ ]
145
+ }
146
+ if ( this . opts . URL ) {
147
+ this . opts . Env . push ( `GPTSCRIPT_URL=${ this . opts . URL } ` )
148
+ }
149
+
150
+ if ( this . opts . Token ) {
151
+ this . opts . Env . push ( `GPTSCRIPT_TOKEN=${ this . opts . Token } ` )
152
+ }
142
153
}
143
154
}
144
155
@@ -400,6 +411,14 @@ export class GPTScript {
400
411
try {
401
412
await fetch ( `${ GPTScript . serverURL } /healthz` )
402
413
this . opts . URL = GPTScript . serverURL
414
+ if ( ! this . opts . Env ) {
415
+ this . opts . Env = [ ]
416
+ }
417
+ this . opts . Env . push ( `GPTSCRIPT_URL=${ this . opts . URL } ` )
418
+ if ( this . opts . Token ) {
419
+ this . opts . Env . push ( `GPTSCRIPT_TOKEN=${ this . opts . Token } ` )
420
+ }
421
+
403
422
return
404
423
} catch {
405
424
if ( count === 0 ) {
You can’t perform that action at this time.
0 commit comments