File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ func NewGPTScript(opts ...GlobalOptions) (*GPTScript, error) {
51
51
52
52
opt .Env = append (opt .Env , opt .toEnv ()... )
53
53
54
- if serverProcessCancel == nil && os .Getenv ("GPTSCRIPT_DISABLE_SERVER " ) != "true " {
54
+ if serverProcessCancel == nil && os .Getenv ("GPTSCRIPT_URL " ) == " " {
55
55
if serverURL != "" {
56
56
u , err := url .Parse (serverURL )
57
57
if err != nil {
@@ -66,6 +66,7 @@ func NewGPTScript(opts ...GlobalOptions) (*GPTScript, error) {
66
66
opt .URL = "http://" + opt .URL
67
67
}
68
68
69
+ opt .Env = append (opt .Env , "GPTSCRIPT_URL=" + opt .URL )
69
70
return & GPTScript {
70
71
globalOpts : opt ,
71
72
}, nil
@@ -121,6 +122,9 @@ func NewGPTScript(opts ...GlobalOptions) (*GPTScript, error) {
121
122
if ! strings .HasPrefix (opt .URL , "http://" ) && ! strings .HasPrefix (opt .URL , "https://" ) {
122
123
opt .URL = "http://" + opt .URL
123
124
}
125
+
126
+ opt .Env = append (opt .Env , "GPTSCRIPT_URL=" + opt .URL )
127
+
124
128
return & GPTScript {
125
129
globalOpts : opt ,
126
130
}, nil
You can’t perform that action at this time.
0 commit comments