1919 */
2020public class HermesChatClient extends HermesHttpClient {
2121
22- private final HermesHttpClientConfig config ;
2322 private final HermesSseClient sseClient ;
2423 private final boolean ownsSseClient ;
2524
2625 public HermesChatClient (HermesHttpClientConfig config ) {
2726 super (config );
28- this . config = Objects .requireNonNull (config , "config" );
27+ Objects .requireNonNull (config , "config" );
2928 this .sseClient = new HermesSseClient (config , getObjectMapper (), getOkHttpClient ());
3029 this .ownsSseClient = true ;
3130 }
3231
3332 public HermesChatClient (HermesHttpClientConfig config , ObjectMapper objectMapper ,
3433 OkHttpClient httpClient ) {
3534 super (config , objectMapper , httpClient );
36- this . config = Objects .requireNonNull (config , "config" );
35+ Objects .requireNonNull (config , "config" );
3736 this .sseClient = new HermesSseClient (config , getObjectMapper (), getOkHttpClient ());
3837 this .ownsSseClient = true ;
3938 }
4039
4140 public HermesChatClient (HermesHttpClientConfig config , ObjectMapper objectMapper ,
4241 OkHttpClient httpClient , HermesSseClient sseClient ) {
4342 super (config , objectMapper , httpClient );
44- this . config = Objects .requireNonNull (config , "config" );
43+ Objects .requireNonNull (config , "config" );
4544 this .sseClient = Objects .requireNonNull (sseClient , "sseClient" );
4645 this .ownsSseClient = false ;
4746 }
@@ -60,8 +59,7 @@ public StreamingChatResponse chatCompletionStream(ChatRequest request,
6059 Map <String , String > headers ,
6160 Consumer <String > deltaConsumer ) {
6261 Objects .requireNonNull (request , "request" );
63- StreamingChatResponse stream = new StreamingChatResponse (
64- config .getStreamEventQueueCapacity ()).onDelta (deltaConsumer );
62+ StreamingChatResponse stream = new StreamingChatResponse ().onDelta (deltaConsumer );
6563 SseSubscription subscription = sseClient .subscribeChat (
6664 request .withStream (), headers , stream ::accept , stream ::finish , stream ::fail );
6765 stream .onCancel (subscription ::close );
0 commit comments