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.
  • Constructor Details

    • TemperatureStage

      protected TemperatureStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
  • Method Details

    • creativeAs

      public MessageStage creativeAs(bg.codexio.ai.openai.api.payload.creativity.Creativity creativity)
      Configures temperature
      Parameters:
      creativity - Creativity
      Returns:
      MessageStage to 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:
      MessageStage to 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:
      MessageStage to add prompts
    • predictable

      public MessageStage predictable()
      Configures all parameters to be mostly deterministic, but also a little bit creative.
      Returns:
      MessageStage to add prompts
    • inventive

      public MessageStage inventive()
      Configures all parameters to be balanced between creativity and determinism.
      Returns:
      MessageStage to add prompts
    • imaginative

      public MessageStage imaginative()
      You may receive a lot of irrelevancy.
      Highly creative parameters with less deterministic properties.
      Returns:
      MessageStage to 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:
      MessageStage to add prompts
    • deepConfigure

      public ManualConfigurationStage deepConfigure()
      Goes to manually configuring some non-trivial options such as tools, tokens and accuracy. After successful configuration, use ManualConfigurationStage.done() to go to the next MessageStage.
      Returns:
      ManualConfigurationStage
    • andRespond

      public ChatRuntimeSelectionStage andRespond()
      Bypass all configuration steps and go directly to ChatRuntimeSelectionStage.
      Specified by:
      andRespond in interface TerminalStage
      Returns:
      ChatRuntimeSelectionStage to select runtime and then prompt the API.