Skip to content

Commit

Permalink
chore: format example
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach committed Dec 19, 2024
1 parent 045c7ba commit 892bb69
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public static void main(String[] args) {
ChatCompletionUserMessageParam.builder()
.role(ChatCompletionUserMessageParam.Role.USER)
.content(ChatCompletionUserMessageParam.Content.ofTextContent(
"Tell me a story about building the best SDK!"
))
.build()
))
"Tell me a story about building the best SDK!"))
.build()))
.build();

// Non-streaming example
Expand All @@ -31,7 +29,8 @@ public static void main(String[] args) {
System.out.println("\n-----------------------------------\n");

// Streaming example
try (StreamResponse<ChatCompletionChunk> messageStreamResponse = client.chat().completions().createStreaming(completionCreateParams)) {
try (StreamResponse<ChatCompletionChunk> messageStreamResponse =
client.chat().completions().createStreaming(completionCreateParams)) {
messageStreamResponse.stream()
.flatMap(completion -> completion.choices().stream())
.flatMap(choice -> choice.delta().content().stream())
Expand Down

0 comments on commit 892bb69

Please sign in to comment.