Skip to content

feat: add support for default model provider in the TUI #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/gptscript-ai/broadcaster v0.0.0-20240625175512-c43682019b86
github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379
github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d
github.com/gptscript-ai/go-gptscript v0.9.3-0.20240728044543-20d868b5baa6
github.com/gptscript-ai/tui v0.0.0-20240728045051-19ba83cd96c1
github.com/gptscript-ai/go-gptscript v0.9.3-0.20240731222146-b67275f3fa69
github.com/gptscript-ai/tui v0.0.0-20240731002102-544a80108f89
github.com/hexops/autogold/v2 v2.2.1
github.com/hexops/valast v1.4.4
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf037
github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379/go.mod h1:7P/o6/IWa1KqsntVf68hSnLKuu3+xuqm6lYhch1w4jo=
github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d h1:sKf7T7twhGXs6AVbvD9pKDVewykkwSAPwEpmIEQIR/4=
github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d/go.mod h1:DJAo1xTht1LDkNYFNydVjTHd576TC7MlpsVRl3oloVw=
github.com/gptscript-ai/go-gptscript v0.9.3-0.20240728044543-20d868b5baa6 h1:hF9Q8KdQhuoXSGKVh4ywRvwn5RJt9rbPraigpXqbGYU=
github.com/gptscript-ai/go-gptscript v0.9.3-0.20240728044543-20d868b5baa6/go.mod h1:Dh6vYRAiVcyC3ElZIGzTvNF1FxtYwA07BHfSiFKQY7s=
github.com/gptscript-ai/tui v0.0.0-20240728045051-19ba83cd96c1 h1:gJXswjjwoiWdOS+s73mliWbN9dyJpiUkb3T+EiV7EFc=
github.com/gptscript-ai/tui v0.0.0-20240728045051-19ba83cd96c1/go.mod h1:Llh3vi87gyry6j/sgJxhkHHvgv9uQRzEiMWuQtmpW1w=
github.com/gptscript-ai/go-gptscript v0.9.3-0.20240731222146-b67275f3fa69 h1:c+Tf6I8jUg8hDgfP8jKs93UcC9dDIGxClWGZUL36Hd0=
github.com/gptscript-ai/go-gptscript v0.9.3-0.20240731222146-b67275f3fa69/go.mod h1:Dh6vYRAiVcyC3ElZIGzTvNF1FxtYwA07BHfSiFKQY7s=
github.com/gptscript-ai/tui v0.0.0-20240731002102-544a80108f89 h1:1G8OhXzCqCe/LARec8Qb7XkpQiEWoRYE/2UfohD+Do4=
github.com/gptscript-ai/tui v0.0.0-20240731002102-544a80108f89/go.mod h1:Llh3vi87gyry6j/sgJxhkHHvgv9uQRzEiMWuQtmpW1w=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
Expand Down
7 changes: 4 additions & 3 deletions pkg/cli/gptscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,10 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) (retErr error) {
// Don't use cmd.Context() because then sigint will cancel everything
return tui.Run(context.Background(), args[0], tui.RunOptions{
ClientOpts: &gptscript2.GlobalOptions{
OpenAIAPIKey: r.OpenAIOptions.APIKey,
OpenAIBaseURL: r.OpenAIOptions.BaseURL,
DefaultModel: r.DefaultModel,
OpenAIAPIKey: r.OpenAIOptions.APIKey,
OpenAIBaseURL: r.OpenAIOptions.BaseURL,
DefaultModel: r.DefaultModel,
DefaultModelProvider: r.DefaultModelProvider,
},
TrustedRepoPrefixes: []string{"github.com/gptscript-ai"},
DisableCache: r.DisableCache,
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdkserver/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type toolOrFileRequest struct {
Confirm bool `json:"confirm"`
Location string `json:"location,omitempty"`
ForceSequential bool `json:"forceSequential"`
DefaultModelProvider string `json:"defaultModelProvider,omitempty"`
DefaultModelProvider string `json:"DefaultModelProvider,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this capitalization change intentional? Just want to make sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was. Thanks for checking.

}

type content struct {
Expand Down