@@ -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
125127func (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 {
0 commit comments