Skip to content

Commit bbd0e2b

Browse files
committed
fix: ensure default model is parsed when using default model provider
When using the default model provider flag, the default model will be gpt-4o. However, when it is parsed, the expected format is 'gpt-4p from my-model-provider'. When using a default model provider, the 'gpt-4o' was being parsed and the model was set to the empty string. After this change, the default model will be of the form 'default-model from default-model-provider' and will be parsed properly. Signed-off-by: Donnie Adams <[email protected]>
1 parent 498381d commit bbd0e2b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/cli/gptscript.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ func (r *GPTScript) PersistentPre(*cobra.Command, []string) error {
231231
if r.DefaultModel != "" {
232232
builtin.SetDefaultModel(r.DefaultModel)
233233
}
234+
if r.DefaultModelProvider != "" {
235+
builtin.SetDefaultModel(fmt.Sprintf("%s from %s", builtin.GetDefaultModel(), r.DefaultModelProvider))
236+
}
234237

235238
if r.Quiet == nil {
236239
if term.IsTerminal(int(os.Stdout.Fd())) {

0 commit comments

Comments
 (0)