Class GenericOaiClientConfig.Builder
java.lang.Object
de.xima.fc.prompt.ms.impl.service.generic_oai.client.GenericOaiClientConfig.Builder
- Enclosing class:
GenericOaiClientConfig
Builder for a
GenericOaiClientConfig.- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionSets the API key for authenticating with the Generic OAI API.Sets the URL to the Generic OAI API.build()Builds the API configuration.connectTimeout(Duration connectTimeout) Sets the connect timeout for connections to the prompt service.disableRequestStreaming(boolean disableRequestStreaming) Whether to disable streaming the request.fileStorage(GenericOaiFileStorage fileStorage) Sets the file storage to use for managing files sent to the prompt service and returned by it.omitDefaultResponseFormat(boolean omitDefaultResponseFormat) Whether to omit the response_format parameter in requests when it is the default.readTimeout(Duration readTimeout) Sets the read timeout for connections to the prompt service.sslContextSupplier(Supplier<SSLContext> sslContextSupplier) Sets the SSL context supplier for the connection to the Generic OAI API.
-
Method Details
-
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
Sets the URL to the Generic OAI API.- Parameters:
apiUrl- The API URL.- Returns:
- This builder for chaining method calls.
-
build
Builds the API configuration. Subsequent modifications to the builder will not affect the built instance.- Returns:
- The built API configuration.
-
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 eithertext,json_object, orjson_schema. The default istext. When this option is enabled, no response_format parameter is included in the request if the response_format.type istext. 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
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.
-