Skip to content

Commit d424c8d

Browse files
Merge pull request #332 from ibuildthecloud/seq
feat: add flag to disable tools from running concurrently
2 parents 2cfad3d + 1c0164b commit d424c8d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pkg/cli/gptscript.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/gptscript-ai/gptscript/pkg/monitor"
2424
"github.com/gptscript-ai/gptscript/pkg/mvl"
2525
"github.com/gptscript-ai/gptscript/pkg/openai"
26+
"github.com/gptscript-ai/gptscript/pkg/runner"
2627
"github.com/gptscript-ai/gptscript/pkg/server"
2728
"github.com/gptscript-ai/gptscript/pkg/types"
2829
"github.com/gptscript-ai/gptscript/pkg/version"
@@ -61,6 +62,7 @@ type GPTScript struct {
6162
CredentialOverride string `usage:"Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234)"`
6263
ChatState string `usage:"The chat state to continue, or null to start a new chat and return the state"`
6364
ForceChat bool `usage:"Force an interactive chat session if even the top level tool is not a chat tool"`
65+
ForceSequential bool `usage:"Force parallel calls to run sequentially"`
6466
Workspace string `usage:"Directory to use for the workspace, if specified it will not be deleted on exit"`
6567

6668
readData []byte
@@ -124,9 +126,13 @@ func (r *GPTScript) NewRunContext(cmd *cobra.Command) context.Context {
124126

125127
func (r *GPTScript) NewGPTScriptOpts() (gptscript.Options, error) {
126128
opts := gptscript.Options{
127-
Cache: cache.Options(r.CacheOptions),
128-
OpenAI: openai.Options(r.OpenAIOptions),
129-
Monitor: monitor.Options(r.DisplayOptions),
129+
Cache: cache.Options(r.CacheOptions),
130+
OpenAI: openai.Options(r.OpenAIOptions),
131+
Monitor: monitor.Options(r.DisplayOptions),
132+
Runner: runner.Options{
133+
CredentialOverride: r.CredentialOverride,
134+
Sequential: r.ForceSequential,
135+
},
130136
Quiet: r.Quiet,
131137
Env: os.Environ(),
132138
CredentialContext: r.CredentialContext,
@@ -150,8 +156,6 @@ func (r *GPTScript) NewGPTScriptOpts() (gptscript.Options, error) {
150156
opts.Runner.EndPort = endNum
151157
}
152158

153-
opts.Runner.CredentialOverride = r.CredentialOverride
154-
155159
if r.EventsStreamTo != "" {
156160
mf, err := monitor.NewFileFactory(r.EventsStreamTo)
157161
if err != nil {

pkg/loader/github/github.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func Load(ctx context.Context, _ *cache.Client, urlName string) (string, *types.
9797

9898
if path == "" || path == "/" {
9999
path = "tool.gpt"
100-
} else if !strings.HasSuffix(path, system.Suffix) {
100+
} else if !strings.HasSuffix(path, system.Suffix) && !strings.Contains(parts[len(parts)-1], ".") {
101101
path += "/tool.gpt"
102102
}
103103

0 commit comments

Comments
 (0)