Skip to content

Commit 361b26d

Browse files
committed
2 parents 8b4029b + 547587c commit 361b26d

31 files changed

+187
-90
lines changed

examples/search.gpt

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ vacation spot give the name and description.
77
name: search
88
description: Searches the internet for content
99
args: query: The query to search for
10-
tools: sys.http.text2html?
10+
tools: sys.http.html2text?
1111

1212
First download the content of "https://html.duckduckgo.com/html/?q=${query}".
1313
Look for the first 5 search results. Download each search result and look for content
1414
that would best answer the query ${query}.
1515

1616
With all that information try your best to provide an answer or useful context to ${query}.
17+
18+
If you can not retrieve a referenced URL then just skip that item and make a reference that
19+
that URL was skipped.

go.mod

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
module github.com/acorn-io/gptscript
1+
module github.com/gptscript-ai/gptscript
22

33
go 1.21.5
44

5+
replace github.com/sashabaranov/go-openai => github.com/gptscript-ai/go-openai v0.0.0-20240206232711-45b6e096246a
6+
57
require (
68
github.com/acorn-io/broadcaster v0.0.0-20240105011354-bfadd4a7b45d
79
github.com/acorn-io/cmd v0.0.0-20240203032901-e9e631185ddb
@@ -10,6 +12,7 @@ require (
1012
github.com/hexops/autogold/v2 v2.1.0
1113
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
1214
github.com/olahol/melody v1.1.4
15+
github.com/rs/cors v1.10.1
1316
github.com/sashabaranov/go-openai v1.18.3
1417
github.com/sirupsen/logrus v1.9.3
1518
github.com/spf13/cobra v1.8.0
@@ -20,12 +23,6 @@ require (
2023

2124
require (
2225
github.com/acorn-io/baaah v0.0.0-20240119160309-2a58ee757bbd // indirect
23-
github.com/kr/pretty v0.3.1 // indirect
24-
github.com/onsi/ginkgo/v2 v2.13.0 // indirect
25-
github.com/onsi/gomega v1.29.0 // indirect
26-
)
27-
28-
require (
2926
github.com/bombsimon/logrusr/v4 v4.0.0 // indirect
3027
github.com/davecgh/go-spew v1.1.1 // indirect
3128
github.com/fatih/color v1.15.0 // indirect
@@ -36,11 +33,14 @@ require (
3633
github.com/hexops/gotextdiff v1.0.3 // indirect
3734
github.com/hexops/valast v1.4.3 // indirect
3835
github.com/inconshreveable/mousetrap v1.1.0 // indirect
36+
github.com/kr/pretty v0.3.1 // indirect
3937
github.com/mattn/go-colorable v0.1.13 // indirect
4038
github.com/mattn/go-isatty v0.0.17 // indirect
4139
github.com/mattn/go-runewidth v0.0.9 // indirect
4240
github.com/nightlyone/lockfile v1.0.0 // indirect
4341
github.com/olekukonko/tablewriter v0.0.5 // indirect
42+
github.com/onsi/ginkgo/v2 v2.13.0 // indirect
43+
github.com/onsi/gomega v1.29.0 // indirect
4444
github.com/pmezard/go-difflib v1.0.0 // indirect
4545
github.com/rogpeppe/go-internal v1.11.0 // indirect
4646
github.com/samber/lo v1.38.1 // indirect

go.sum

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
3737
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
3838
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
3939
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
40+
github.com/gptscript-ai/go-openai v0.0.0-20240206232711-45b6e096246a h1:AdBbQ1ODOYK5AwCey4VFEmKeu9gG4PCzuO80pQmgupE=
41+
github.com/gptscript-ai/go-openai v0.0.0-20240206232711-45b6e096246a/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
4042
github.com/hexops/autogold v0.8.1/go.mod h1:97HLDXyG23akzAoRYJh/2OBs3kd80eHyKPvZw0S5ZBY=
4143
github.com/hexops/autogold v1.3.1 h1:YgxF9OHWbEIUjhDbpnLhgVsjUDsiHDTyDfy2lrfdlzo=
4244
github.com/hexops/autogold v1.3.1/go.mod h1:sQO+mQUCVfxOKPht+ipDSkJ2SCJ7BNJVHZexsXqWMx4=
@@ -85,13 +87,13 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
8587
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
8688
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
8789
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
90+
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
91+
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
8892
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
8993
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
9094
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
9195
github.com/samber/slog-logrus v1.0.0 h1:SsrN0p9akjCEaYd42Q5GtisMdHm0q11UD4fp4XCZi04=
9296
github.com/samber/slog-logrus v1.0.0/go.mod h1:ZTdPCmVWljwlfjz6XflKNvW4TcmYlexz4HMUOO/42bI=
93-
github.com/sashabaranov/go-openai v1.18.3 h1:dspFGkmZbhjg1059KhqLYSV2GaCiRIn+bOu50TlXUq8=
94-
github.com/sashabaranov/go-openai v1.18.3/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
9597
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
9698
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
9799
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"github.com/acorn-io/cmd"
5-
"github.com/acorn-io/gptscript/pkg/cli"
5+
"github.com/gptscript-ai/gptscript/pkg/cli"
66
)
77

88
func main() {

pkg/assemble/assemble.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"encoding/json"
66
"io"
77

8-
"github.com/acorn-io/gptscript/pkg/types"
8+
"github.com/gptscript-ai/gptscript/pkg/types"
99
)
1010

1111
var Header = []byte("GPTSCRIPT!")

pkg/builtin/builtin.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"sort"
1414
"strings"
1515

16-
"github.com/acorn-io/gptscript/pkg/types"
16+
"github.com/gptscript-ai/gptscript/pkg/types"
1717
"github.com/jaytaylor/html2text"
1818
)
1919

@@ -82,6 +82,16 @@ var Tools = map[string]types.Tool{
8282
},
8383
}
8484

85+
func SysProgram() *types.Program {
86+
result := &types.Program{
87+
ToolSet: types.ToolSet{},
88+
}
89+
for _, tool := range ListTools() {
90+
result.ToolSet[tool.ID] = tool
91+
}
92+
return result
93+
}
94+
8595
func ListTools() (result []types.Tool) {
8696
var keys []string
8797
for k := range Tools {

pkg/builtin/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package builtin
22

3-
import "github.com/acorn-io/gptscript/pkg/mvl"
3+
import "github.com/gptscript-ai/gptscript/pkg/mvl"
44

55
var log = mvl.Package()

pkg/cache/cache.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"os"
88
"path/filepath"
99

10-
"github.com/acorn-io/gptscript/pkg/types"
11-
"github.com/acorn-io/gptscript/pkg/version"
1210
"github.com/adrg/xdg"
11+
"github.com/gptscript-ai/gptscript/pkg/types"
12+
"github.com/gptscript-ai/gptscript/pkg/version"
1313
)
1414

1515
type Client struct {

pkg/cli/gptscript.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import (
88
"strings"
99

1010
"github.com/acorn-io/cmd"
11-
"github.com/acorn-io/gptscript/pkg/assemble"
12-
"github.com/acorn-io/gptscript/pkg/builtin"
13-
"github.com/acorn-io/gptscript/pkg/input"
14-
"github.com/acorn-io/gptscript/pkg/loader"
15-
"github.com/acorn-io/gptscript/pkg/monitor"
16-
"github.com/acorn-io/gptscript/pkg/mvl"
17-
"github.com/acorn-io/gptscript/pkg/openai"
18-
"github.com/acorn-io/gptscript/pkg/runner"
19-
"github.com/acorn-io/gptscript/pkg/server"
20-
"github.com/acorn-io/gptscript/pkg/version"
11+
"github.com/gptscript-ai/gptscript/pkg/assemble"
12+
"github.com/gptscript-ai/gptscript/pkg/builtin"
13+
"github.com/gptscript-ai/gptscript/pkg/input"
14+
"github.com/gptscript-ai/gptscript/pkg/loader"
15+
"github.com/gptscript-ai/gptscript/pkg/monitor"
16+
"github.com/gptscript-ai/gptscript/pkg/mvl"
17+
"github.com/gptscript-ai/gptscript/pkg/openai"
18+
"github.com/gptscript-ai/gptscript/pkg/runner"
19+
"github.com/gptscript-ai/gptscript/pkg/server"
20+
"github.com/gptscript-ai/gptscript/pkg/version"
2121
"github.com/spf13/cobra"
2222
"golang.org/x/term"
2323
)

pkg/engine/engine.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"sync"
1212
"sync/atomic"
1313

14-
"github.com/acorn-io/gptscript/pkg/openai"
15-
"github.com/acorn-io/gptscript/pkg/types"
16-
"github.com/acorn-io/gptscript/pkg/version"
1714
"github.com/google/shlex"
15+
"github.com/gptscript-ai/gptscript/pkg/openai"
16+
"github.com/gptscript-ai/gptscript/pkg/types"
17+
"github.com/gptscript-ai/gptscript/pkg/version"
1818
)
1919

2020
// InternalSystemPrompt is added to all threads. Changing this is very dangerous as it has a
@@ -182,17 +182,25 @@ func (e *Engine) runCommand(ctx context.Context, tool types.Tool, input string)
182182
case string:
183183
envMap[envName] = val
184184
env = append(env, envName+"="+val)
185+
envMap[k] = val
186+
env = append(env, k+"="+val)
185187
case json.Number:
186188
envMap[envName] = string(val)
187189
env = append(env, envName+"="+string(val))
190+
envMap[k] = string(val)
191+
env = append(env, k+"="+string(val))
188192
case bool:
189193
envMap[envName] = fmt.Sprint(val)
190194
env = append(env, envName+"="+fmt.Sprint(val))
195+
envMap[k] = fmt.Sprint(val)
196+
env = append(env, k+"="+fmt.Sprint(val))
191197
default:
192198
data, err := json.Marshal(val)
193199
if err == nil {
194200
envMap[envName] = string(data)
195201
env = append(env, envName+"="+string(data))
202+
envMap[k] = string(data)
203+
env = append(env, k+"="+string(data))
196204
}
197205
}
198206
}
@@ -265,6 +273,7 @@ func (e *Engine) Start(ctx Context, input string) (*Return, error) {
265273
MaxToken: tool.MaxTokens,
266274
JSONResponse: tool.JSONResponse,
267275
Cache: tool.Cache,
276+
Temperature: tool.Temperature,
268277
}
269278

270279
if InternalSystemPrompt != "" {

pkg/engine/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package engine
22

3-
import "github.com/acorn-io/gptscript/pkg/mvl"
3+
import "github.com/gptscript-ai/gptscript/pkg/mvl"
44

55
var log = mvl.Package()

pkg/input/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package input
22

3-
import "github.com/acorn-io/gptscript/pkg/mvl"
3+
import "github.com/gptscript-ai/gptscript/pkg/mvl"
44

55
var log = mvl.Package()

pkg/loader/defaults.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package loader
22

33
import (
4-
"github.com/acorn-io/gptscript/pkg/openai"
5-
"github.com/acorn-io/gptscript/pkg/types"
4+
"github.com/gptscript-ai/gptscript/pkg/openai"
5+
"github.com/gptscript-ai/gptscript/pkg/types"
66
)
77

88
var (

pkg/loader/loader.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import (
1818
"regexp"
1919
"strings"
2020

21-
"github.com/acorn-io/gptscript/pkg/assemble"
22-
"github.com/acorn-io/gptscript/pkg/builtin"
23-
"github.com/acorn-io/gptscript/pkg/parser"
24-
"github.com/acorn-io/gptscript/pkg/types"
21+
"github.com/gptscript-ai/gptscript/pkg/assemble"
22+
"github.com/gptscript-ai/gptscript/pkg/builtin"
23+
"github.com/gptscript-ai/gptscript/pkg/parser"
24+
"github.com/gptscript-ai/gptscript/pkg/types"
2525
)
2626

2727
const (

pkg/loader/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package loader
22

3-
import "github.com/acorn-io/gptscript/pkg/mvl"
3+
import "github.com/gptscript-ai/gptscript/pkg/mvl"
44

55
var log = mvl.Package()

0 commit comments

Comments
 (0)