Skip to content

Commit

Permalink
Renamed vars
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesDuboisSAP committed Aug 19, 2024
1 parent 69ae7eb commit 7870e6d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static ResponseBodyEmitter stream() {
.addText(
"Can you give me the first 100 number of the Fibonacci sequence?")));

Stream<OpenAiChatCompletionOutput> delta =
Stream<OpenAiChatCompletionOutput> stream =
OpenAiClient.forModel(GPT_35_TURBO).stream(request).getDelta();

ResponseBodyEmitter emitter = new ResponseBodyEmitter();
Expand All @@ -67,13 +67,13 @@ public static ResponseBodyEmitter stream() {
.submit(
() -> {
try {
delta.forEach(
line -> {
stream.forEach(
delta -> {
try {
if (!line.getChoices().isEmpty()
&& line.getChoices().get(0).getMessage() != null
&& line.getChoices().get(0).getMessage().getContent() != null) {
emitter.send(line.getChoices().get(0).getMessage().getContent());
if (!delta.getChoices().isEmpty()
&& delta.getChoices().get(0).getMessage() != null
&& delta.getChoices().get(0).getMessage().getContent() != null) {
emitter.send(delta.getChoices().get(0).getMessage().getContent());
}
} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit 7870e6d

Please sign in to comment.