Switch order of literals to prevent NullPointerException (#1)
Co-authored-by: pixeebot[bot] <23113631+pixeebot@users.noreply.github.com>
This commit is contained in:
@@ -52,7 +52,7 @@ public class OpenAiAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public OpenAiService theoOpenAiService(OpenAiProperties openAiProperties) {
|
||||
if (openAiProperties.getBaseUrl().equals("https://api.openai.com")) {
|
||||
if ("https://api.openai.com".equals(openAiProperties.getBaseUrl())) {
|
||||
if (!StringUtils.hasText(openAiProperties.getApiKey())) {
|
||||
throw new IllegalArgumentException(
|
||||
"You must provide an API key with the property name " + CONFIG_PREFIX + ".api-key");
|
||||
|
||||
Reference in New Issue
Block a user