Class TemperatureStage
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.chat.ChatConfigurationStage
-
- bg.codexio.ai.openai.api.sdk.chat.TemperatureStage
-
- All Implemented Interfaces:
TerminalStage
public class TemperatureStage extends ChatConfigurationStage implements TerminalStage
Configures the temperature or in other words, the creativity of the model. This is usually related to temperature or topP parameters.
-
-
Field Summary
-
Fields inherited from class bg.codexio.ai.openai.api.sdk.chat.ChatConfigurationStage
executor, requestBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTemperatureStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChatRuntimeSelectionStageandRespond()Bypass all configuration steps and go directly toChatRuntimeSelectionStage.MessageStagecreativeAs(bg.codexio.ai.openai.api.payload.creativity.Creativity creativity)Configures temperatureManualConfigurationStagedeepConfigure()Goes to manually configuring some non-trivial options such as tools, tokens and accuracy.MessageStagedeterministic()Configures all parameters to be mostly deterministic.MessageStageimaginative()You may receive a lot of irrelevancy.
Highly creative parameters with less deterministic properties.MessageStageinventive()Configures all parameters to be balanced between creativity and determinism.MessageStagepredictable()Configures all parameters to be mostly deterministic, but also a little bit creative.MessageStagerandomized()You may receive total non-sense in the answers .
Configures all parameters to the highest creativity with little to none determinism and a lot of repetitions.MessageStagescaleRepetitionToCreativity(bg.codexio.ai.openai.api.payload.creativity.Creativity creativity)Configures temperature and additionally configures topP, frequencyPenalty and presencePenalty by applying approximation for topP and inverse function for the penalties.
-
-
-
Constructor Detail
-
TemperatureStage
protected TemperatureStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
-
-
Method Detail
-
creativeAs
public MessageStage creativeAs(bg.codexio.ai.openai.api.payload.creativity.Creativity creativity)
Configures temperature- Parameters:
creativity-Creativity- Returns:
MessageStageto add prompts
-
scaleRepetitionToCreativity
public MessageStage scaleRepetitionToCreativity(bg.codexio.ai.openai.api.payload.creativity.Creativity creativity)
Configures temperature and additionally configures topP, frequencyPenalty and presencePenalty by applying approximation for topP and inverse function for the penalties.- Parameters:
creativity-Creativity- Returns:
MessageStageto add prompts
-
deterministic
public MessageStage deterministic()
Configures all parameters to be mostly deterministic. This sets zero randomness in the temperature and top_p sampling.- Returns:
MessageStageto add prompts
-
predictable
public MessageStage predictable()
Configures all parameters to be mostly deterministic, but also a little bit creative.- Returns:
MessageStageto add prompts
-
inventive
public MessageStage inventive()
Configures all parameters to be balanced between creativity and determinism.- Returns:
MessageStageto add prompts
-
imaginative
public MessageStage imaginative()
You may receive a lot of irrelevancy.
Highly creative parameters with less deterministic properties.- Returns:
MessageStageto add prompts
-
randomized
public MessageStage randomized()
You may receive total non-sense in the answers .
Configures all parameters to the highest creativity with little to none determinism and a lot of repetitions.- Returns:
MessageStageto add prompts
-
deepConfigure
public ManualConfigurationStage deepConfigure()
Goes to manually configuring some non-trivial options such as tools, tokens and accuracy. After successful configuration, useManualConfigurationStage.done()to go to the nextMessageStage.- Returns:
ManualConfigurationStage
-
andRespond
public ChatRuntimeSelectionStage andRespond()
Bypass all configuration steps and go directly toChatRuntimeSelectionStage.- Specified by:
andRespondin interfaceTerminalStage- Returns:
ChatRuntimeSelectionStageto select runtime and then prompt the API.
-
-