Skip to content

Commit

Permalink
✨ Update error message for missing OpenAI API key πŸ”‘
Browse files Browse the repository at this point in the history
The error message for missing OpenAI API key is updated, now it indicates the
address where the developers can obtain their API key.
It is important that developers can know how to obtain the API key to use the
API service to avoid accumulating errors, and frustrate developers.
  • Loading branch information
marocchino committed Mar 30, 2023
1 parent d0a482a commit ea14f32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func getStagedDiff() (string, error) {

func generateText(prompt string) (string, error) {
if apiKey == "" {
return "", fmt.Errorf("OPENAI_API_KEY environment variable is not set")
return "", fmt.Errorf("OPENAI_API_KEY environment variable is not set. you can get it from https://platform.openai.com/account/api-keys.")
}
url := "https://api.openai.com/v1/chat/completions"
messages := []Message{
Expand Down

0 comments on commit ea14f32

Please sign in to comment.