Class JdkHttpClientBuilder
java.lang.Object
dev.langchain4j.http.client.jdk.JdkHttpClientBuilder
- All Implemented Interfaces:
HttpClientBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()connectTimeout(Duration connectTimeout) httpClientBuilder(HttpClient.Builder httpClientBuilder) readTimeout(Duration readTimeout) streamingBufferSize(Integer streamingBufferSize) Sets the size of the bounded back-pressure buffer used by the streaming (stream) path.
-
Constructor Details
-
JdkHttpClientBuilder
public JdkHttpClientBuilder()
-
-
Method Details
-
httpClientBuilder
-
httpClientBuilder
-
connectTimeout
- Specified by:
connectTimeoutin interfaceHttpClientBuilder
-
connectTimeout
- Specified by:
connectTimeoutin interfaceHttpClientBuilder
-
readTimeout
- Specified by:
readTimeoutin interfaceHttpClientBuilder
-
readTimeout
- Specified by:
readTimeoutin interfaceHttpClientBuilder
-
streamingBufferSize
- Returns:
- the bounded back-pressure buffer size used by
stream(...), ornullfor the default. - Since:
- 1.20.0
-
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
- Specified by:
buildin interfaceHttpClientBuilder
-