Record Class ChatMessageRequest.Builder

java.lang.Object
java.lang.Record
bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder
Enclosing class:
ChatMessageRequest

public static record ChatMessageRequest.Builder(String model, List<ChatMessage> messages, Double frequencyPenalty, Map<String,Integer> logitBias, Integer maxTokens, Integer n, Double presencePenalty, Integer seed, String[] stop, boolean stream, Double temperature, Double topP, List<ChatTool> tools, ChatTool.ChatToolChoice toolChoice, String user) extends Record
  • Constructor Details

    • Builder

      public Builder(String model, List<ChatMessage> messages, Double frequencyPenalty, Map<String,Integer> logitBias, Integer maxTokens, Integer n, Double presencePenalty, Integer seed, String[] stop, boolean stream, Double temperature, Double topP, List<ChatTool> tools, ChatTool.ChatToolChoice toolChoice, String user)
      Creates an instance of a Builder record class.
      Parameters:
      model - the value for the model record component
      messages - the value for the messages record component
      frequencyPenalty - the value for the frequencyPenalty record component
      logitBias - the value for the logitBias record component
      maxTokens - the value for the maxTokens record component
      n - the value for the n record component
      presencePenalty - the value for the presencePenalty record component
      seed - the value for the seed record component
      stop - the value for the stop record component
      stream - the value for the stream record component
      temperature - the value for the temperature record component
      topP - the value for the topP record component
      tools - the value for the tools record component
      toolChoice - the value for the toolChoice record component
      user - the value for the user record component
  • Method Details

    • withModel

      public ChatMessageRequest.Builder withModel(String model)
    • withMessages

      public ChatMessageRequest.Builder withMessages(List<ChatMessage> messages)
    • addMessage

      public ChatMessageRequest.Builder addMessage(ChatMessage message)
    • withFrequencyPenalty

      public ChatMessageRequest.Builder withFrequencyPenalty(Double frequencyPenalty)
    • withLogitBias

      public ChatMessageRequest.Builder withLogitBias(Map<String,Integer> logitBias)
    • withMaxTokens

      public ChatMessageRequest.Builder withMaxTokens(Integer maxTokens)
    • withN

    • withPresencePenalty

      public ChatMessageRequest.Builder withPresencePenalty(Double presencePenalty)
    • withSeed

      public ChatMessageRequest.Builder withSeed(Integer seed)
    • withStop

      public ChatMessageRequest.Builder withStop(String[] stop)
    • shouldStream

      public ChatMessageRequest.Builder shouldStream(boolean stream)
    • withTermperature

      public ChatMessageRequest.Builder withTermperature(Double temperature)
    • withTopP

      public ChatMessageRequest.Builder withTopP(Double topP)
    • withTools

      public ChatMessageRequest.Builder withTools(List<ChatTool> tools)
    • addTool

      public ChatMessageRequest.Builder addTool(ChatTool chatTool)
    • withToolChoice

      public ChatMessageRequest.Builder withToolChoice(ChatTool.ChatToolChoice toolChoice)
    • withUser

      public ChatMessageRequest.Builder withUser(String user)
    • build

      public ChatMessageRequest build()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • messages

      public List<ChatMessage> messages()
      Returns the value of the messages record component.
      Returns:
      the value of the messages record component
    • frequencyPenalty

      public Double frequencyPenalty()
      Returns the value of the frequencyPenalty record component.
      Returns:
      the value of the frequencyPenalty record component
    • logitBias

      public Map<String,Integer> logitBias()
      Returns the value of the logitBias record component.
      Returns:
      the value of the logitBias record component
    • maxTokens

      public Integer maxTokens()
      Returns the value of the maxTokens record component.
      Returns:
      the value of the maxTokens record component
    • n

      public Integer n()
      Returns the value of the n record component.
      Returns:
      the value of the n record component
    • presencePenalty

      public Double presencePenalty()
      Returns the value of the presencePenalty record component.
      Returns:
      the value of the presencePenalty record component
    • seed

      public Integer seed()
      Returns the value of the seed record component.
      Returns:
      the value of the seed record component
    • stop

      public String[] stop()
      Returns the value of the stop record component.
      Returns:
      the value of the stop record component
    • stream

      public boolean stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component
    • temperature

      public Double temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component
    • topP

      public Double topP()
      Returns the value of the topP record component.
      Returns:
      the value of the topP record component
    • tools

      public List<ChatTool> tools()
      Returns the value of the tools record component.
      Returns:
      the value of the tools record component
    • toolChoice

      public ChatTool.ChatToolChoice toolChoice()
      Returns the value of the toolChoice record component.
      Returns:
      the value of the toolChoice record component
    • user

      public String user()
      Returns the value of the user record component.
      Returns:
      the value of the user record component