Skip to content

Commit 6111015

Browse files
authored
Merge branch 'gptscript-ai:main' into main
2 parents d452dd5 + bbf61d3 commit 6111015

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/openai/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ func complete(opts ...Options) (result Options, err error) {
7272
result.APIKey = key
7373
}
7474

75+
if result.APIKey == "" {
76+
return result, fmt.Errorf("OPENAI_API_KEY is not set. Please set the OPENAI_API_KEY environment variable")
77+
}
78+
7579
return result, err
7680
}
7781

0 commit comments

Comments
 (0)