USVT-136 Update the test of Token for ChageGTP

This commit is contained in:
YuCheng Hu 2023-03-07 09:39:18 -05:00
parent 10a6345914
commit 755f9090f2
1 changed files with 3 additions and 1 deletions

View File

@ -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 = (" <xml>\n" +
" <ToUserName><![CDATA[toUser]]></ToUserName>\n" +
" <FromUserName><![CDATA[fromUser]]></FromUserName>\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")