Class ApacheHttpClientBuilder

java.lang.Object
dev.langchain4j.http.client.apache.ApacheHttpClientBuilder
All Implemented Interfaces:
HttpClientBuilder

public class ApacheHttpClientBuilder extends Object implements HttpClientBuilder
  • Constructor Details

    • ApacheHttpClientBuilder

      public ApacheHttpClientBuilder()
  • Method Details

    • httpClientBuilder

      public org.apache.hc.client5.http.impl.classic.HttpClientBuilder httpClientBuilder()
    • httpClientBuilder

      public ApacheHttpClientBuilder httpClientBuilder(org.apache.hc.client5.http.impl.classic.HttpClientBuilder httpClientBuilder)
    • httpAsyncClientBuilder

      public org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder httpAsyncClientBuilder()
    • httpAsyncClientBuilder

      public ApacheHttpClientBuilder httpAsyncClientBuilder(org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder httpAsyncClientBuilder)
    • connectTimeout

      public Duration connectTimeout()
      Specified by:
      connectTimeout in interface HttpClientBuilder
    • connectTimeout

      public ApacheHttpClientBuilder connectTimeout(Duration connectTimeout)
      Specified by:
      connectTimeout in interface HttpClientBuilder
    • readTimeout

      public Duration readTimeout()
      Specified by:
      readTimeout in interface HttpClientBuilder
    • readTimeout

      public ApacheHttpClientBuilder readTimeout(Duration readTimeout)
      Specified by:
      readTimeout in interface HttpClientBuilder
    • streamingBufferSize

      @Experimental public Integer streamingBufferSize()
      Returns:
      the bounded back-pressure buffer size used by stream(...), or null for the default.
      Since:
      1.20.0
    • streamingBufferSize

      @Experimental public ApacheHttpClientBuilder streamingBufferSize(Integer streamingBufferSize)
      Sets the size of the bounded back-pressure buffer used by the streaming (stream) path. Server-sent events are relayed to the subscriber through this buffer; if the subscriber consumes slower than the server produces and the buffer overflows, the stream terminates with an error.

      The default is 16384.

      Parameters:
      streamingBufferSize - the buffer size; must be greater than zero
      Returns:
      the builder instance
      Since:
      1.20.0
    • build

      public ApacheHttpClient build()
      Specified by:
      build in interface HttpClientBuilder