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 {
139139 if ( ! this . opts . URL ) {
140140 this . opts . URL = GPTScript . serverURL
141141 }
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+ }
142153 }
143154 }
144155
@@ -400,6 +411,14 @@ export class GPTScript {
400411 try {
401412 await fetch ( `${ GPTScript . serverURL } /healthz` )
402413 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+
403422 return
404423 } catch {
405424 if ( count === 0 ) {
You can’t perform that action at this time.
0 commit comments