Package bg.codexio.ai.openai.api.sdk
Class HttpBuilder<T>
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.HttpBuilder<T>
-
- Type Parameters:
T- The next stage to go afterunderstanding(ObjectMapper)orand().
public class HttpBuilder<T> extends Object
Default usage is to configure the HTTP connection and
serialization / deserialization methods usingObjectMapper.
-
-
Constructor Summary
Constructors Constructor Description HttpBuilder(HttpExecutorContext context, BiFunction<HttpExecutorContext,com.fasterxml.jackson.databind.ObjectMapper,T> nextStepDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tand()Goes to next stage with emptyObjectMapperTunderstanding(com.fasterxml.jackson.databind.ObjectMapper mapper)SetsObjectMapperto be used from the HTTP client.HttpBuilder<T>withCallTimeout(long timeout, TimeUnit timeUnit)Configures HTTP Call TimeoutHttpBuilder<T>withConnectTimeout(long timeout, TimeUnit timeUnit)Configures HTTP Connect TimeoutHttpBuilder<T>withReadTimeout(long timeout, TimeUnit timeUnit)Configures HTTP Read Timeout
-
-
-
Constructor Detail
-
HttpBuilder
public HttpBuilder(HttpExecutorContext context, BiFunction<HttpExecutorContext,com.fasterxml.jackson.databind.ObjectMapper,T> nextStepDelegate)
- Parameters:
context-HttpExecutorContextnextStepDelegate- a supplier ofHttpBuildernext stage, which will receiveHttpExecutorContextandObjectMapperin order to create the instance.
-
-
Method Detail
-
understanding
public T understanding(com.fasterxml.jackson.databind.ObjectMapper mapper)
SetsObjectMapperto be used from the HTTP client.- Parameters:
mapper-ObjectMapper- Returns:
- Next stage
HttpBuilder
-
withReadTimeout
public HttpBuilder<T> withReadTimeout(long timeout, TimeUnit timeUnit)
Configures HTTP Read Timeout
-
withConnectTimeout
public HttpBuilder<T> withConnectTimeout(long timeout, TimeUnit timeUnit)
Configures HTTP Connect Timeout
-
withCallTimeout
public HttpBuilder<T> withCallTimeout(long timeout, TimeUnit timeUnit)
Configures HTTP Call Timeout
-
and
public T and()
Goes to next stage with emptyObjectMapper- Returns:
- Next stage
HttpBuilder
-
-