Class OpenAiImageModelConfig.BuilderBase<BUILDER extends OpenAiImageModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OpenAiImageModelConfig>
java.lang.Object
io.helidon.integrations.langchain4j.providers.openai.OpenAiImageModelConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER
- type of the builder extending this abstract builderPROTOTYPE
- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,
,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
OpenAiImageModelConfig.Builder
- Enclosing interface:
OpenAiImageModelConfig
public abstract static class OpenAiImageModelConfig.BuilderBase<BUILDER extends OpenAiImageModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OpenAiImageModelConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
OpenAiImageModelConfig
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCustomHeaders
(Map<String, String> customHeaders) This method keeps existing values, then puts all new values into the map.apiKey()
The API key used to authenticate requests to the OpenAI API.The API key used to authenticate requests to the OpenAI API.baseUrl()
The base URL for the OpenAI API.The base URL for the OpenAI API.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).A map containing custom headers.customHeaders
(Map<String, String> customHeaders) This method replaces all values with the new ones.boolean
enabled()
If set tofalse
(default), OpenAI model will not be available even if configured.enabled
(boolean enabled) If set tofalse
(default), OpenAI model will not be available even if configured.from
(OpenAiImageModelConfig prototype) Update this builder from an existing prototype instance.from
(OpenAiImageModelConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Whether to log API requests.logRequests
(boolean logRequests) Whether to log API requests.Whether to log API responses.logResponses
(boolean logResponses) Whether to log API responses.The maximum number of retries for failed API requests.maxRetries
(int maxRetries) The maximum number of retries for failed API requests.The model name to use (e.g., "gpt-3.5-turbo").The model name to use (e.g., "gpt-3.5-turbo").The ID of the organization for API requests.organizationId
(String organizationId) The ID of the organization for API requests.The path or location where the generated images should be persisted.The path or location where the generated images should be persisted.protected void
Handles providers and decorators.proxy()
Proxy to use.Proxy to use.putCustomHeader
(String key, String customHeader) This method adds a new value to the map, or replaces it if the key already exists.quality()
The quality of the generated images.The quality of the generated images.The format of the response.responseFormat
(String responseFormat) The format of the response.size()
The desired size of the generated images.The desired size of the generated images.style()
The style of the generated images.The style of the generated images.timeout()
The timeout setting for API requests.The timeout setting for API requests.toString()
user()
The unique identifier for the user making the request.The unique identifier for the user making the request.protected void
Validates required properties.The flag to indicate whether to persist the generated images.withPersisting
(boolean withPersisting) The flag to indicate whether to persist the generated images.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype
- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder
- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends OpenAiImageModelConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends OpenAiImageModelConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearMaxRetries
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
maxRetries
The maximum number of retries for failed API requests.- Parameters:
maxRetries
- anOptional
containing the maximum number of retries- Returns:
- updated builder instance
- See Also:
-
clearSize
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
size
The desired size of the generated images.- Parameters:
size
- the image size.- Returns:
- updated builder instance
- See Also:
-
clearQuality
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
quality
The quality of the generated images.- Parameters:
quality
- the image quality.- Returns:
- updated builder instance
- See Also:
-
clearStyle
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
style
The style of the generated images.- Parameters:
style
- the image style.- Returns:
- updated builder instance
- See Also:
-
clearUser
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
user
The unique identifier for the user making the request.- Parameters:
user
- the user ID.- Returns:
- updated builder instance
- See Also:
-
clearResponseFormat
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
responseFormat
The format of the response.- Parameters:
responseFormat
- the response format.- Returns:
- updated builder instance
- See Also:
-
clearWithPersisting
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
withPersisting
The flag to indicate whether to persist the generated images.- Parameters:
withPersisting
- the persist flag.- Returns:
- updated builder instance
- See Also:
-
clearPersistTo
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
persistTo
The path or location where the generated images should be persisted.- Parameters:
persistTo
- the persist path.- Returns:
- updated builder instance
- See Also:
-
enabled
If set tofalse
(default), OpenAI model will not be available even if configured.- Parameters:
enabled
- whether OpenAI model is enabled, defaults tofalse
- Returns:
- updated builder instance
- See Also:
-
clearBaseUrl
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
baseUrl
The base URL for the OpenAI API.- Parameters:
baseUrl
- the base URL- Returns:
- updated builder instance
- See Also:
-
clearApiKey
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
apiKey
The API key used to authenticate requests to the OpenAI API.- Parameters:
apiKey
- anOptional
containing the API key- Returns:
- updated builder instance
- See Also:
-
clearLogRequests
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
logRequests
Whether to log API requests.- Parameters:
logRequests
- anOptional
containing true if requests should be logged, false otherwise- Returns:
- updated builder instance
- See Also:
-
clearLogResponses
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
logResponses
Whether to log API responses.- Parameters:
logResponses
- anOptional
containing true if responses should be logged, false otherwise- Returns:
- updated builder instance
- See Also:
-
customHeaders
This method replaces all values with the new ones.- Parameters:
customHeaders
- custom headers map- Returns:
- updated builder instance
- See Also:
-
addCustomHeaders
This method keeps existing values, then puts all new values into the map.- Parameters:
customHeaders
- custom headers map- Returns:
- updated builder instance
- See Also:
-
putCustomHeader
This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replacecustomHeader
- new value for the key- Returns:
- updated builder instance
- See Also:
-
clearTimeout
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
timeout
The timeout setting for API requests.- Parameters:
timeout
- the timeout setting inDuration.parse(java.lang.CharSequence)
format- Returns:
- updated builder instance
- See Also:
-
clearProxy
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
proxy
Proxy to use.- Parameters:
proxy
- anOptional
containing HTTP proxy to use- Returns:
- updated builder instance
- See Also:
-
clearOrganizationId
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
organizationId
The ID of the organization for API requests.- Parameters:
organizationId
- organization ID- Returns:
- updated builder instance
- See Also:
-
clearModelName
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
modelName
The model name to use (e.g., "gpt-3.5-turbo").- Parameters:
modelName
- the model name- Returns:
- updated builder instance
- See Also:
-
maxRetries
The maximum number of retries for failed API requests.- Returns:
- the max retries
-
size
The desired size of the generated images.- Returns:
- the size
-
quality
The quality of the generated images.- Returns:
- the quality
-
style
The style of the generated images.- Returns:
- the style
-
user
The unique identifier for the user making the request.- Returns:
- the user
-
responseFormat
The format of the response.- Returns:
- the response format
-
withPersisting
The flag to indicate whether to persist the generated images.- Returns:
- the with persisting
-
persistTo
The path or location where the generated images should be persisted.- Returns:
- the persist to
-
enabled
public boolean enabled()If set tofalse
(default), OpenAI model will not be available even if configured.- Returns:
- the enabled
-
baseUrl
The base URL for the OpenAI API.- Returns:
- the base url
-
apiKey
The API key used to authenticate requests to the OpenAI API.- Returns:
- the api key
-
logRequests
Whether to log API requests.- Returns:
- the log requests
-
logResponses
Whether to log API responses.- Returns:
- the log responses
-
customHeaders
A map containing custom headers.- Returns:
- the custom headers
-
timeout
The timeout setting for API requests.- Returns:
- the timeout
-
proxy
Proxy to use.- Returns:
- the proxy
-
organizationId
The ID of the organization for API requests.- Returns:
- the organization id
-
modelName
The model name to use (e.g., "gpt-3.5-turbo").- Returns:
- the model name
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-