Class OpenAiStreamingChatModelConfig.BuilderBase<BUILDER extends OpenAiStreamingChatModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OpenAiStreamingChatModelConfig>
java.lang.Object
io.helidon.integrations.langchain4j.providers.openai.OpenAiStreamingChatModelConfig.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:
OpenAiStreamingChatModelConfig.Builder
- Enclosing interface:
OpenAiStreamingChatModelConfig
public abstract static class OpenAiStreamingChatModelConfig.BuilderBase<BUILDER extends OpenAiStreamingChatModelConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OpenAiStreamingChatModelConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
OpenAiStreamingChatModelConfig
.-
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.addLogitBias
(Map<String, Integer> logitBias) This method keeps existing values, then puts all new values into the map.The list of sequences where the API will stop generating further tokens.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.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.The frequency penalty, between -2.0 and 2.0.frequencyPenalty
(double frequencyPenalty) The frequency penalty, between -2.0 and 2.0.from
(OpenAiStreamingChatModelConfig prototype) Update this builder from an existing prototype instance.from
(OpenAiStreamingChatModelConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.LogitBias adjusts the likelihood of specific tokens appearing in a model's response.This method replaces all values with the new ones.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 tokens allowed for the model's response.maxCompletionTokens
(int maxCompletionTokens) The maximum number of tokens allowed for the model's response.The maximum number of tokens to generate in the completion.maxTokens
(int maxTokens) The maximum number of tokens to generate in the completion.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.Whether to allow parallel calls to tools.parallelToolCalls
(boolean parallelToolCalls) Whether to allow parallel calls to tools.protected void
Handles providers and decorators.The presence penalty, between -2.0 and 2.0.presencePenalty
(double presencePenalty) The presence penalty, between -2.0 and 2.0.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.putLogitBia
(String key, Integer logitBia) This method adds a new value to the map, or replaces it if the key already exists.The format in which the model should return the response.responseFormat
(String responseFormat) The format in which the model should return the response.seed()
The seed for the random number generator used by the model.seed
(int seed) The seed for the random number generator used by the model.stop()
The list of sequences where the API will stop generating further tokens.The list of sequences where the API will stop generating further tokens.Whether to enforce strict validation of tools used by the model.strictTools
(boolean strictTools) Whether to enforce strict validation of tools used by the model.The sampling temperature to use, between 0 and 2.temperature
(double temperature) The sampling temperature to use, between 0 and 2.timeout()
The timeout setting for API requests.The timeout setting for API requests.Optional
<dev.langchain4j.model.Tokenizer> Tokenizer to use.tokenizer
(dev.langchain4j.model.Tokenizer tokenizer) Tokenizer to use.topP()
The nucleus sampling value, where the model considers the results of the tokens with top_p probability mass.topP
(double topP) The nucleus sampling value, where the model considers the results of the tokens with top_p probability mass.toString()
user()
The user ID associated with the API requests.The user ID associated with the API requests.protected void
Validates required properties.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 OpenAiStreamingChatModelConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends OpenAiStreamingChatModelConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearTemperature
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
temperature
The sampling temperature to use, between 0 and 2. Higher values make the output more random, while lower values make it more focused and deterministic.- Parameters:
temperature
- anOptional
containing the sampling temperature- Returns:
- updated builder instance
- See Also:
-
clearTopP
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
topP
The nucleus sampling value, where the model considers the results of the tokens with top_p probability mass.- Parameters:
topP
- anOptional
containing the nucleus sampling value- Returns:
- updated builder instance
- See Also:
-
stop
The list of sequences where the API will stop generating further tokens.- Parameters:
stop
- the list of stop sequences- Returns:
- updated builder instance
- See Also:
-
addStop
The list of sequences where the API will stop generating further tokens.- Parameters:
stop
- the list of stop sequences- Returns:
- updated builder instance
- See Also:
-
clearMaxTokens
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
maxTokens
The maximum number of tokens to generate in the completion.- Parameters:
maxTokens
- anOptional
containing the maximum number of tokens- Returns:
- updated builder instance
- See Also:
-
clearMaxCompletionTokens
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
maxCompletionTokens
The maximum number of tokens allowed for the model's response.- Parameters:
maxCompletionTokens
- anOptional
containing the maximum number of completion tokens- Returns:
- updated builder instance
- See Also:
-
clearPresencePenalty
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
presencePenalty
The presence penalty, between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, encouraging the model to use new words.- Parameters:
presencePenalty
- anOptional
containing the presence penalty- Returns:
- updated builder instance
- See Also:
-
clearFrequencyPenalty
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
frequencyPenalty
The frequency penalty, between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line.- Parameters:
frequencyPenalty
- anOptional
containing the frequency penalty- Returns:
- updated builder instance
- See Also:
-
logitBias
This method replaces all values with the new ones.- Parameters:
logitBias
- a logitBias map- Returns:
- updated builder instance
- See Also:
-
addLogitBias
This method keeps existing values, then puts all new values into the map.- Parameters:
logitBias
- a logitBias map- Returns:
- updated builder instance
- See Also:
-
putLogitBia
This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replacelogitBia
- new value for the key- Returns:
- updated builder instance
- See Also:
-
clearResponseFormat
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
responseFormat
The format in which the model should return the response.- Parameters:
responseFormat
- anOptional
containing the response format- Returns:
- updated builder instance
- See Also:
-
clearSeed
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
seed
The seed for the random number generator used by the model.- Parameters:
seed
- anOptional
containing the seed- Returns:
- updated builder instance
- See Also:
-
clearUser
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
user
The user ID associated with the API requests.- Parameters:
user
- anOptional
containing the user ID- Returns:
- updated builder instance
- See Also:
-
clearStrictTools
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
strictTools
Whether to enforce strict validation of tools used by the model.- Parameters:
strictTools
- anOptional
containing true if strict tools are enforced, false otherwise- Returns:
- updated builder instance
- See Also:
-
clearParallelToolCalls
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
parallelToolCalls
Whether to allow parallel calls to tools.- Parameters:
parallelToolCalls
- anOptional
containing true if parallel tool calls are allowed, false otherwise- Returns:
- updated builder instance
- See Also:
-
clearTokenizer
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
tokenizer
Tokenizer to use.- Parameters:
tokenizer
- anOptional
containing the tokenizer- 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:
-
temperature
The sampling temperature to use, between 0 and 2. Higher values make the output more random, while lower values make it more focused and deterministic.- Returns:
- the temperature
-
topP
The nucleus sampling value, where the model considers the results of the tokens with top_p probability mass.- Returns:
- the top p
-
stop
The list of sequences where the API will stop generating further tokens.- Returns:
- the stop
-
maxTokens
The maximum number of tokens to generate in the completion.- Returns:
- the max tokens
-
maxCompletionTokens
The maximum number of tokens allowed for the model's response.- Returns:
- the max completion tokens
-
presencePenalty
The presence penalty, between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, encouraging the model to use new words.- Returns:
- the presence penalty
-
frequencyPenalty
The frequency penalty, between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line.- Returns:
- the frequency penalty
-
logitBias
LogitBias adjusts the likelihood of specific tokens appearing in a model's response. A map of token IDs to bias values (-100 to 100). Positive values increase the chance of the token, while negative values reduce it, allowing fine control over token preferences in the output.- Returns:
- the logit bias
-
responseFormat
The format in which the model should return the response.- Returns:
- the response format
-
seed
The seed for the random number generator used by the model.- Returns:
- the seed
-
user
The user ID associated with the API requests.- Returns:
- the user
-
strictTools
Whether to enforce strict validation of tools used by the model.- Returns:
- the strict tools
-
parallelToolCalls
Whether to allow parallel calls to tools.- Returns:
- the parallel tool calls
-
tokenizer
Tokenizer to use.- Returns:
- the tokenizer
-
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.
-