Skip to content

Commit 7e7177e

Browse files
chore(OpenAI): Rename API key name
1 parent f8ae950 commit 7e7177e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/main/java/org/wise/portal/presentation/web/controllers/ChatGptController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ChatGptController {
2929
@PostMapping
3030
protected String sendChatMessage(@RequestBody String body) {
3131
if (openAiApiKey == null || openAiApiKey.isEmpty()) {
32-
throw new RuntimeException("OPENAI_API_KEY is not set");
32+
throw new RuntimeException("openai.api.key is not set");
3333
}
3434
try {
3535
URL url = new URL(openAiChatApiUrl);

src/main/java/org/wise/portal/presentation/web/controllers/author/project/AuthorAPIController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ protected HashMap<String, Object> getAuthorProjectConfig(Authentication auth,
399399
config.put("projectAssetURL", contextPath + "/api/author/project/asset/" + project.getId());
400400
config.put("projectBaseURL", projectBaseURL);
401401
config.put("previewProjectURL", contextPath + "/preview/unit/" + project.getId());
402-
config.put("chatGptEnabled", !StringUtils.isEmpty(appProperties.getProperty("OPENAI_API_KEY")));
402+
config.put("chatGptEnabled", !StringUtils.isEmpty(appProperties.getProperty("openai.api.key")));
403403
config.put("cRaterRequestURL", contextPath + "/api/c-rater");
404404
config.put("importStepsURL",
405405
contextPath + "/api/author/project/importSteps/" + project.getId());

src/test/java/org/wise/portal/presentation/web/controllers/author/project/AuthorAPIControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void getAuthorProjectConfig_HasProjectRun_ReturnCanGradeStudentWork() thr
8080
replay(request);
8181
expect(appProperties.getProperty("curriculum_base_www"))
8282
.andReturn("http://localhost:8080/curriculum");
83-
expect(appProperties.getProperty("OPENAI_API_KEY")).andReturn("OPENAPIKEY");
83+
expect(appProperties.getProperty("openai.api.key")).andReturn("OPENAPIKEY");
8484
replay(appProperties);
8585
Map<String, Object> config = authorAPIController.getAuthorProjectConfig(teacherAuth, request,
8686
project1);

0 commit comments

Comments
 (0)