Skip to content

Commit

Permalink
OPIK-610 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
idoberko2 committed Dec 27, 2024
1 parent 203f2ce commit a9f0fc9
Showing 1 changed file with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,11 @@ private AnthropicClient newClient(String apiKey) {
.build();
}

private static class ChunkedResponseHandler implements StreamingResponseHandler<AiMessage> {
private final Consumer<ChatCompletionResponse> handleMessage;
private final Runnable handleClose;
private final Consumer<Throwable> handleError;
private final String model;

public ChunkedResponseHandler(
Consumer<ChatCompletionResponse> handleMessage,
Runnable handleClose,
Consumer<Throwable> handleError,
String model) {
this.handleMessage = handleMessage;
this.handleClose = handleClose;
this.handleError = handleError;
this.model = model;
}
private record ChunkedResponseHandler(
Consumer<ChatCompletionResponse> handleMessage,
Runnable handleClose,
Consumer<Throwable> handleError,
String model) implements StreamingResponseHandler<AiMessage> {

@SneakyThrows
@Override
Expand Down

0 comments on commit a9f0fc9

Please sign in to comment.