USVT-136 Update the test of Token for ChageGTP
This commit is contained in:
parent
10a6345914
commit
755f9090f2
|
@ -22,9 +22,11 @@ import org.junit.jupiter.api.TestInstance;
|
||||||
class OpenAiTest {
|
class OpenAiTest {
|
||||||
|
|
||||||
private String wechatMessageStr = StringUtils.EMPTY;
|
private String wechatMessageStr = StringUtils.EMPTY;
|
||||||
|
private String openAiToken = StringUtils.EMPTY;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
|
openAiToken = System.getenv("OPENAI_TOKEN");
|
||||||
this.wechatMessageStr = (" <xml>\n" +
|
this.wechatMessageStr = (" <xml>\n" +
|
||||||
" <ToUserName><![CDATA[toUser]]></ToUserName>\n" +
|
" <ToUserName><![CDATA[toUser]]></ToUserName>\n" +
|
||||||
" <FromUserName><![CDATA[fromUser]]></FromUserName>\n" +
|
" <FromUserName><![CDATA[fromUser]]></FromUserName>\n" +
|
||||||
|
@ -46,7 +48,7 @@ class OpenAiTest {
|
||||||
@Test
|
@Test
|
||||||
public void testToWeChatMessage() {
|
public void testToWeChatMessage() {
|
||||||
|
|
||||||
OpenAiService service = new OpenAiService("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", 30);
|
OpenAiService service = new OpenAiService(openAiToken, 30);
|
||||||
CompletionRequest completionRequest = new CompletionRequestBuilder()
|
CompletionRequest completionRequest = new CompletionRequestBuilder()
|
||||||
.setPrompt("上海天气怎么样")
|
.setPrompt("上海天气怎么样")
|
||||||
.setModel("text-davinci-003")
|
.setModel("text-davinci-003")
|
||||||
|
|
Loading…
Reference in New Issue