Interface DoclingServeApi.DoclingApiBuilder<T extends DoclingServeApi,B extends DoclingServeApi.DoclingApiBuilder<T,B>>

Type Parameters:
T - the type of the DoclingServeApi implementation being built.
B - the type of the concrete builder implementation.
Enclosing interface:
DoclingServeApi

public static interface DoclingServeApi.DoclingApiBuilder<T extends DoclingServeApi,B extends DoclingServeApi.DoclingApiBuilder<T,B>>
A builder interface for constructing implementations of DoclingServeApi. This interface supports a fluent API for setting configuration properties before building an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    apiKey(@Nullable String apiKey)
    Sets the API key for authenticating requests made by the client being built.
    asyncPollInterval(Duration asyncPollInterval)
    Sets the polling interval for async operations.
    asyncTimeout(Duration asyncTimeout)
    Sets the timeout for async operations.
    Builds and returns an instance of the specified type, representing the completed configuration of the builder.
    default B
    Enables logging of requests for the API client being built.
    logRequests(boolean logRequests)
    Configures whether logging of API requests is enabled or not.
    default B
    Enables logging of responses for the API client being built.
    logResponses(boolean logResponses)
    Configures whether logging of API responses is enabled or not.
    default B
    Configures the API client to format JSON requests and responses in a "pretty" format.
    prettyPrint(boolean prettyPrint)
    Configures whether the API client should format JSON requests and responses in a "pretty" format.
  • Method Details

    • apiKey

      B apiKey(@Nullable String apiKey)
      Sets the API key for authenticating requests made by the client being built. The provided API key will be used as a credential to authorize and authenticate API requests. This method updates the configuration of the builder with the specified API key and ensures that the API client includes it in its requests as required for secure access to the API.
      Parameters:
      apiKey - the API key to be used for authenticating API requests
      Returns:
      this builder instance for fluent API usage
    • logRequests

      default B logRequests()
      Enables logging of requests for the API client being built. This can be useful for debugging or monitoring the behavior of requests made to the API.

      This method influences the logging behavior of requests initiated by the client without specifying further configuration details.

      Returns:
      this builder instance for fluent API usage.
    • logRequests

      B logRequests(boolean logRequests)
      Configures whether logging of API requests is enabled or not. Logging can help monitor or debug request communications with the API.
      Parameters:
      logRequests - true to enable request logging; false to disable it.
      Returns:
      this builder instance for fluent API usage.
    • logResponses

      default B logResponses()
      Enables logging of responses for the API client being built. This can assist in debugging or monitoring the behavior of responses received from the API.
      Returns:
      this builder instance for fluent API usage.
    • logResponses

      B logResponses(boolean logResponses)
      Configures whether logging of API responses is enabled or not. Logging can help monitor or debug the responses received from the API.
      Parameters:
      logResponses - true to enable response logging; false to disable it.
      Returns:
      this builder instance for fluent API usage.
    • prettyPrint

      B prettyPrint(boolean prettyPrint)
      Configures whether the API client should format JSON requests and responses in a "pretty" format. Pretty formatting organizes the response data to improve readability, typically by adding spacing and line breaks. This setting does not affect the functional content of the response but can assist with debugging or human-readable output for development purposes.
      Parameters:
      prettyPrint - true to enable pretty-printing of JSON requests and responses; false to use compact formatting.
      Returns:
      this builder instance for fluent API usage.
    • prettyPrint

      default B prettyPrint()
      Configures the API client to format JSON requests and responses in a "pretty" format. Pretty formatting improves readability by including spacing and line breaks.
      Returns:
      this builder instance for fluent API usage.
    • asyncPollInterval

      B asyncPollInterval(Duration 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)}.

      Parameters:
      asyncPollInterval - the polling interval (must not be null or negative)
      Returns:
      this builder instance for method chaining
      Throws:
      IllegalArgumentException - if asyncPollInterval is null or negative
    • asyncTimeout

      B asyncTimeout(Duration 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)}.

      Parameters:
      asyncTimeout - the timeout duration (must not be null or negative)
      Returns:
      this builder instance for method chaining
      Throws:
      IllegalArgumentException - if asyncTimeout is null or negative
    • build

      T build()
      Builds and returns an instance of the specified type, representing the completed configuration of the builder. The returned instance is typically an implementation of the Docling API.
      Returns:
      an instance of type T representing a configured Docling API client.