Skip to content
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

fix: use default values #568

Merged
merged 5 commits into from
Sep 19, 2023
Merged
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
14 changes: 9 additions & 5 deletions cmd/auth/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,19 @@ var addCmd = &cobra.Command{
}

// check if backend is not empty and a valid value
if backend == "" || !validBackend(ai.Backends, backend) {
color.Red("Error: Backend AI cannot be empty and accepted values are '%v'", strings.Join(ai.Backends, ", "))
os.Exit(1)
if backend == "" {
color.Yellow("Warning: backend input is empty, will use the default value: openai")
backend = "openai"
} else {
if !validBackend(ai.Backends, backend) {
color.Red("Error: Backend AI accepted values are '%v'", strings.Join(ai.Backends, ", "))
os.Exit(1)
}
}

// check if model is not empty
if model == "" {
AlexsJones marked this conversation as resolved.
Show resolved Hide resolved
color.Red("Error: Model cannot be empty.")
os.Exit(1)
color.Yellow("Warning: model input is empty, will use the default value: gpt-3.5-turbo")
}
if temperature > 1.0 || temperature < 0.0 {
color.Red("Error: temperature ranges from 0 to 1.")
Expand Down