Skip to content

Commit

Permalink
Update client.go with a meaningful message to set openAPI key
Browse files Browse the repository at this point in the history
Update client.go with a meaningful message to set openAPI key

Signed-off-by: Saiyam Pathak <[email protected]>
  • Loading branch information
saiyam1814 authored Feb 14, 2024
1 parent 357da7b commit a93db65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/openai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ func complete(opts ...Options) (result Options, err error) {
if result.APIKey == "" && key != "" {
result.APIKey = key
}


Check failure on line 74 in pkg/openai/client.go

View workflow job for this annotation

GitHub Actions / test

File is not `gofmt`-ed with `-s` (gofmt)
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 a93db65

Please sign in to comment.