Class GenericOaiClientConfig.Builder

java.lang.Object
de.xima.fc.prompt.ms.impl.service.generic_oai.client.GenericOaiClientConfig.Builder
Enclosing class:
GenericOaiClientConfig

public static final class GenericOaiClientConfig.Builder extends Object
Builder for a GenericOaiClientConfig.
Since:
8.5.0
  • Method Details

    • apiKey

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder apiKey(String apiKey)
      Sets the API key for authenticating with the Generic OAI API.
      Parameters:
      apiKey - The API key.
      Returns:
      This builder for chaining method calls.
    • apiUrl

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder apiUrl(String apiUrl)
      Sets the URL to the Generic OAI API.
      Parameters:
      apiUrl - The API URL.
      Returns:
      This builder for chaining method calls.
    • build

      @CanIgnoreReturnValue public GenericOaiClientConfig build()
      Builds the API configuration. Subsequent modifications to the builder will not affect the built instance.
      Returns:
      The built API configuration.
    • connectTimeout

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder connectTimeout(Duration connectTimeout)
      Sets the connect timeout for connections to the prompt service. Defaults to an implementation-specific value if not set.
      Parameters:
      connectTimeout - The connection timeout duration.
      Returns:
      This builder for chaining method calls.
    • disableRequestStreaming

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder disableRequestStreaming(boolean disableRequestStreaming)
      Whether to disable streaming the request. If enabled, the entire content is loaded into memory first, which allows the Content-Length header to be set. Should be set to false unless the prompt service cannot handled streamed requests without a Content-Length header.
      Parameters:
      disableRequestStreaming - Whether request streaming is disabled.
      Returns:
      This builder for chaining method calls.
      Since:
      8.5.3
    • fileStorage

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder fileStorage(GenericOaiFileStorage fileStorage)
      Sets the file storage to use for managing files sent to the prompt service and returned by it.
      Parameters:
      fileStorage - The file storage.
      Returns:
      This builder for chaining method calls.
    • omitDefaultResponseFormat

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder omitDefaultResponseFormat(boolean omitDefaultResponseFormat)
      Whether to omit the response_format parameter in requests when it is the default. The response_format.type is either text, json_object, or json_schema. The default is text . When this option is enabled, no response_format parameter is included in the request if the response_format.type is text. Should be left disabled unless the prompt service has issues with the default response format.
      Parameters:
      omitDefaultResponseFormat - Whether to omit the response_format parameter in requests when it is the default.
      Returns:
      This builder instance for chaining method calls.
      Since:
      8.5.3
    • readTimeout

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder readTimeout(Duration readTimeout)
      Sets the read timeout for connections to the prompt service. Defaults to an implementation-specific value if not set.
      Parameters:
      readTimeout - The read timeout duration.
      Returns:
      This builder for chaining method calls.
    • sslContextSupplier

      @CanIgnoreReturnValue public GenericOaiClientConfig.Builder sslContextSupplier(Supplier<SSLContext> sslContextSupplier)
      Sets the SSL context supplier for the connection to the Generic OAI API.
      Parameters:
      sslContextSupplier - The SSL context supplier.
      Returns:
      This builder for chaining method calls.