2222 */
2323public class HermesChatClient extends HermesHttpClient {
2424
25- private final HermesHttpClientConfig config ;
2625 private final HermesSseClient sseClient ;
2726 private final boolean ownsSseClient ;
2827
2928 public HermesChatClient (HermesHttpClientConfig config ) {
3029 super (config );
31- this . config = Objects .requireNonNull (config , "config" );
30+ Objects .requireNonNull (config , "config" );
3231 this .sseClient = new HermesSseClient (config , getObjectMapper (), getOkHttpClient ());
3332 this .ownsSseClient = true ;
3433 }
3534
3635 public HermesChatClient (HermesHttpClientConfig config , ObjectMapper objectMapper ,
3736 OkHttpClient httpClient ) {
3837 super (config , objectMapper , httpClient );
39- this . config = Objects .requireNonNull (config , "config" );
38+ Objects .requireNonNull (config , "config" );
4039 this .sseClient = new HermesSseClient (config , getObjectMapper (), getOkHttpClient ());
4140 this .ownsSseClient = true ;
4241 }
4342
4443 public HermesChatClient (HermesHttpClientConfig config , ObjectMapper objectMapper ,
4544 OkHttpClient httpClient , HermesSseClient sseClient ) {
4645 super (config , objectMapper , httpClient );
47- this . config = Objects .requireNonNull (config , "config" );
46+ Objects .requireNonNull (config , "config" );
4847 this .sseClient = Objects .requireNonNull (sseClient , "sseClient" );
4948 this .ownsSseClient = false ;
5049 }
@@ -63,8 +62,7 @@ public StreamingChatResponse chatCompletionStream(ChatRequest request,
6362 Map <String , String > headers ,
6463 Consumer <String > deltaConsumer ) {
6564 Objects .requireNonNull (request , "request" );
66- StreamingChatResponse stream = new StreamingChatResponse (
67- config .getStreamEventQueueCapacity ()).onDelta (deltaConsumer );
65+ StreamingChatResponse stream = new StreamingChatResponse ().onDelta (deltaConsumer );
6866 SseSubscription subscription = sseClient .subscribeChat (
6967 request .withStream (), headers , stream ::accept , stream ::finish , stream ::fail );
7068 stream .onCancel (subscription ::close );
0 commit comments