Skip to content

Commit

Permalink
Merge branch 'backend/Feature/139-gpt-currency-unit' into dev_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
yo0oni committed Aug 13, 2024
2 parents 40f4717 + a710e51 commit 3aa19c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
@AllArgsConstructor
public class GptSchedulesResponse {
private String countryImage;
private String currencyUnit;
private List<GptScheduleResponse> schedules;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ public CompletableFuture<GptSchedulesResponse> askQuestion(GptScheduleRequest qu
sendRequestAsync(messages, executorService)
);



CompletableFuture<List<GptScheduleResponse>> combinedFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
.thenApply(v -> futures.stream().map(CompletableFuture::join).collect(Collectors.toList()));

return combinedFuture.thenApply(schedules -> new GptSchedulesResponse(countryImage, schedules));
return combinedFuture.thenApply(schedules -> new GptSchedulesResponse(countryImage, country.getCurrencyName(), schedules));
}

private CompletableFuture<GptScheduleResponse> sendRequestAsync(List<GptMessage> messages, ExecutorService executor) {
Expand Down

0 comments on commit 3aa19c0

Please sign in to comment.