Class DoclingServeClient.DoclingServeClientBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C,B>>
- Type Parameters:
C- the type ofDoclingServeClientbeing builtB- the type of the builder implementation
- All Implemented Interfaces:
ai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C,B>
- Direct Known Subclasses:
DoclingServeJackson2Client.Builder,DoclingServeJackson3Client.Builder
- Enclosing class:
- DoclingServeClient
DoclingServeClient.
This builder class provides methods for configuring shared properties such as the base URL and the HTTP client. Concrete subclasses may extend this builder to add additional configuration options.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected constructor for use by subclasses ofDoclingServeClient.DoclingServeClientBuilder.protectedDoclingServeClientBuilder(DoclingServeClient doclingClient) Initializes a newDoclingServeClient.DoclingServeClientBuilderinstance using the configuration from the providedDoclingServeClient. -
Method Summary
Modifier and TypeMethodDescriptionasyncPollInterval(Duration asyncPollInterval) Sets the polling interval for async operations.asyncTimeout(Duration asyncTimeout) Sets the timeout for async operations.Sets the base URL for the client.connectTimeout(Duration connectTimeout) httpClientBuilder(HttpClient.Builder httpClientBuilder) Sets the HTTP client builder to be used for creating the underlying HTTP client.logRequests(boolean logRequests) logResponses(boolean logResponses) prettyPrint(boolean prettyPrint) readTimeout(Duration readTimeout) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.docling.serve.api.DoclingServeApi.DoclingApiBuilder
baseUrl, build, logRequests, logResponses, prettyPrint
-
Constructor Details
-
DoclingServeClientBuilder
protected DoclingServeClientBuilder()Protected constructor for use by subclasses ofDoclingServeClient.DoclingServeClientBuilder.Initializes a new instance of the builder with default configuration values. This constructor ensures that the builder cannot be instantiated directly, promoting proper use and extension by subclasses.
-
DoclingServeClientBuilder
Initializes a newDoclingServeClient.DoclingServeClientBuilderinstance using the configuration from the providedDoclingServeClient.- Parameters:
doclingClient- theDoclingServeClientwhose configuration (e.g., base URL) will be used to initialize the builder
-
-
Method Details
-
baseUrl
Sets the base URL for the client.This method configures the base URL that will be used for all API requests executed by the client. The provided URL must be non-null.
- Specified by:
baseUrlin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>> - Parameters:
baseUrl- the base URL to use, as aURI- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- ifbaseUrlis null
-
httpClientBuilder
Sets the HTTP client builder to be used for creating the underlying HTTP client.This allows customization of HTTP client properties such as timeouts, proxy settings, SSL context, and other connection parameters.
- Parameters:
httpClientBuilder- theHttpClient.Builderto use- Returns:
- this
DoclingServeJackson3Client.Builderinstance for method chaining
-
apiKey
- Specified by:
apiKeyin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
logRequests
- Specified by:
logRequestsin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
logResponses
- Specified by:
logResponsesin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
prettyPrint
- Specified by:
prettyPrintin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
connectTimeout
- Specified by:
connectTimeoutin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
readTimeout
- Specified by:
readTimeoutin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
asyncPollInterval
Sets the polling interval for async operations.This configures how frequently the client will check the status of async conversion tasks when using
DoclingServeConvertApi.convertSourceAsync(ConvertDocumentRequest)(ConvertDocumentRequest).- Specified by:
asyncPollIntervalin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>> - Parameters:
asyncPollInterval- the polling interval (must not be null or negative)- Returns:
- this builder instance for method chaining
-
asyncTimeout
Sets the timeout for async operations.This configures the maximum time to wait for an async conversion task to complete when using
DoclingServeConvertApi.convertSourceAsync(ConvertDocumentRequest)(ConvertDocumentRequest).- Specified by:
asyncTimeoutin interfaceai.docling.serve.api.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>> - Parameters:
asyncTimeout- the timeout duration (must not be null or negative)- Returns:
- this builder instance for method chaining
-