From 755f9090f24475e458bba5a862abd86567e7ce96 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Tue, 7 Mar 2023 09:39:18 -0500 Subject: [PATCH] USVT-136 Update the test of Token for ChageGTP --- src/test/java/com/northtecom/visatrack/api/OpenAiTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java b/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java index 349313a..e8d918a 100644 --- a/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java +++ b/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java @@ -22,9 +22,11 @@ import org.junit.jupiter.api.TestInstance; class OpenAiTest { private String wechatMessageStr = StringUtils.EMPTY; + private String openAiToken = StringUtils.EMPTY; @BeforeEach protected void setUp() throws Exception { + openAiToken = System.getenv("OPENAI_TOKEN"); this.wechatMessageStr = (" \n" + " \n" + " \n" + @@ -46,7 +48,7 @@ class OpenAiTest { @Test public void testToWeChatMessage() { - OpenAiService service = new OpenAiService("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", 30); + OpenAiService service = new OpenAiService(openAiToken, 30); CompletionRequest completionRequest = new CompletionRequestBuilder() .setPrompt("上海天气怎么样") .setModel("text-davinci-003")