Skip to content

Commit 4eaf770

Browse files
author
hexiaochun
committed
feat: optimize bot example
1 parent e7a9a5a commit 4eaf770

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

volcengine-java-sdk-ark-runtime/test/java/com/volcengine/ark/runtime/BotChatCompletionsExample.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public static void main(String[] args) {
5959
BotChatCompletionResult chatCompletionResult = service.createBotChatCompletion(chatCompletionRequest);
6060
chatCompletionResult.getChoices().forEach(choice -> System.out.println(choice.getMessage().getContent()));
6161
// the references example
62-
chatCompletionResult.getReferences().forEach(ref -> System.out.println(ref.getUrl()));
62+
if (chatCompletionResult.getReferences() != null) {
63+
chatCompletionResult.getReferences().forEach(ref -> System.out.println(ref.getUrl()));
64+
}
6365

6466
System.out.println("\n----- streaming request -----");
6567
final List<ChatMessage> streamMessages = new ArrayList<>();

0 commit comments

Comments
 (0)