Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 7b089d1

Browse files
committed
change: back to stock NewGPTScript
1 parent bf3fde2 commit 7b089d1

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

pkg/client/common.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import (
1212
"strings"
1313

1414
"github.com/go-git/go-git/v5/plumbing/format/gitignore"
15-
"github.com/gptscript-ai/go-gptscript"
16-
"github.com/gptscript-ai/gptscript/pkg/sdkserver"
1715
"github.com/gptscript-ai/knowledge/pkg/datastore"
1816
"github.com/gptscript-ai/knowledge/pkg/datastore/documentloader"
1917
remotes "github.com/gptscript-ai/knowledge/pkg/datastore/documentloader/remote"
@@ -23,33 +21,6 @@ import (
2321
"golang.org/x/sync/semaphore"
2422
)
2523

26-
func newGPTScript(ctx context.Context) (*gptscript.GPTScript, error) {
27-
workspaceTool := os.Getenv("WORKSPACE_TOOL")
28-
if workspaceTool == "" {
29-
workspaceTool = "github.com/gptscript-ai/workspace-provider"
30-
}
31-
if os.Getenv("GPTSCRIPT_URL") != "" {
32-
return gptscript.NewGPTScript(gptscript.GlobalOptions{
33-
URL: os.Getenv("GPTSCRIPT_URL"),
34-
WorkspaceTool: workspaceTool,
35-
})
36-
}
37-
38-
url, err := sdkserver.EmbeddedStart(ctx)
39-
if err != nil {
40-
return nil, err
41-
}
42-
43-
if err := os.Setenv("GPTSCRIPT_URL", url); err != nil {
44-
return nil, err
45-
}
46-
47-
return gptscript.NewGPTScript(gptscript.GlobalOptions{
48-
URL: url,
49-
WorkspaceTool: workspaceTool,
50-
})
51-
}
52-
5324
func ingestPaths(ctx context.Context, c Client, opts *IngestPathsOpts, datasetID string, ingestionFunc func(path string, metadata map[string]any) error, paths ...string) (int, int, error) {
5425
ingestedFilesCount := 0
5526
skippedUnsupportedFilesCount := 0

pkg/client/standalone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type StandaloneClient struct {
2121
}
2222

2323
func NewStandaloneClient(ctx context.Context, ds *datastore.Datastore) (*StandaloneClient, error) {
24-
gs, err := newGPTScript(ctx)
24+
gs, err := gptscript.NewGPTScript()
2525
if err != nil {
2626
return nil, err
2727
}

0 commit comments

Comments
 (0)