File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
openai-java-example/src/main/java/com/openai/example Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,8 @@ public static void main(String[] args) {
17
17
ChatCompletionUserMessageParam .builder ()
18
18
.role (ChatCompletionUserMessageParam .Role .USER )
19
19
.content (ChatCompletionUserMessageParam .Content .ofTextContent (
20
- "Tell me a story about building the best SDK!"
21
- ))
22
- .build ()
23
- ))
20
+ "Tell me a story about building the best SDK!" ))
21
+ .build ()))
24
22
.build ();
25
23
26
24
// Non-streaming example
@@ -31,7 +29,8 @@ public static void main(String[] args) {
31
29
System .out .println ("\n -----------------------------------\n " );
32
30
33
31
// Streaming example
34
- try (StreamResponse <ChatCompletionChunk > messageStreamResponse = client .chat ().completions ().createStreaming (completionCreateParams )) {
32
+ try (StreamResponse <ChatCompletionChunk > messageStreamResponse =
33
+ client .chat ().completions ().createStreaming (completionCreateParams )) {
35
34
messageStreamResponse .stream ()
36
35
.flatMap (completion -> completion .choices ().stream ())
37
36
.flatMap (choice -> choice .delta ().content ().stream ())
You can’t perform that action at this time.
0 commit comments