Skip to content

Commit

Permalink
feat 1.1.2 新版接口开发
Browse files Browse the repository at this point in the history
  • Loading branch information
guorutao committed Nov 13, 2023
1 parent b6dcc04 commit f189b97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/test/java/com/unfbx/chatgpt/OpenAiClientFunctionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void chatFunction() {
.messages(Collections.singletonList(message))
.functions(Collections.singletonList(functions))
.functionCall("auto")
.model(ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName())
.model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName())
.build();
ChatCompletionResponse chatCompletionResponse = openAiClient.chatCompletion(chatCompletion);

Expand Down Expand Up @@ -149,7 +149,7 @@ public void chatFunction() {
ChatCompletion chatCompletionV2 = ChatCompletion
.builder()
.messages(messageList)
.model(ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName())
.model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName())
.build();
ChatCompletionResponse chatCompletionResponseV2 = openAiClient.chatCompletion(chatCompletionV2);
log.info("自定义的方法返回值:{}",chatCompletionResponseV2.getChoices().get(0).getMessage().getContent());
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/unfbx/chatgpt/PluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void plugin() {
messages.add(message2);
//默认模型:GPT_3_5_TURBO_16K_0613
//有四个重载方法,都可以使用
ChatCompletionResponse response = openAiClient.chatCompletionWithPlugin(messages, plugin);
ChatCompletionResponse response = openAiClient.chatCompletionWithPlugin(messages, ChatCompletion.Model.GPT_4_1106_PREVIEW.getName(), plugin);
log.info("自定义的方法返回值:{}", response.getChoices().get(0).getMessage().getContent());
}

Expand All @@ -103,7 +103,7 @@ public void streamPlugin() {
messages.add(message2);
//默认模型:GPT_3_5_TURBO_16K_0613
//有四个重载方法,都可以使用
openAiStreamClient.streamChatCompletionWithPlugin(messages, new ConsoleEventSourceListener(), plugin);
openAiStreamClient.streamChatCompletionWithPlugin(messages, ChatCompletion.Model.GPT_4_1106_PREVIEW.getName(), new ConsoleEventSourceListener(), plugin);
CountDownLatch countDownLatch = new CountDownLatch(1);
try {
countDownLatch.await();
Expand Down

0 comments on commit f189b97

Please sign in to comment.