Skip to content

Commit

Permalink
Merge pull request #40 from saiyam1814/patch-1
Browse files Browse the repository at this point in the history
Update client.go with a meaningful message to set openAPI key
  • Loading branch information
ibuildthecloud authored Feb 14, 2024
2 parents 2e9265c + c9397ff commit bbf61d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/openai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func complete(opts ...Options) (result Options, err error) {
result.APIKey = key
}

if result.APIKey == "" {
return result, fmt.Errorf("OPENAI_API_KEY is not set. Please set the OPENAI_API_KEY environment variable")
}

return result, err
}

Expand Down

0 comments on commit bbf61d3

Please sign in to comment.