Record Class CreateChatCompletionRequest

java.lang.Object
java.lang.Record
io.github.stefanbratanov.jvm.openai.CreateChatCompletionRequest
Record Components:
toolChoice - String or ToolChoice

public record CreateChatCompletionRequest(List<ChatMessage> messages, String model, Optional<Double> frequencyPenalty, Optional<Map<Integer,Integer>> logitBias, Optional<Boolean> logprobs, Optional<Integer> topLogprobs, Optional<Integer> maxTokens, Optional<Integer> n, Optional<Double> presencePenalty, Optional<ResponseFormat> responseFormat, Optional<Integer> seed, Optional<List<String>> stop, Optional<Boolean> stream, Optional<CreateChatCompletionRequest.StreamOptions> streamOptions, Optional<Double> temperature, Optional<Double> topP, Optional<List<Tool>> tools, Optional<Object> toolChoice, Optional<Boolean> parallelToolCalls, Optional<String> user) extends Record
  • Constructor Details

    • CreateChatCompletionRequest

      public CreateChatCompletionRequest(List<ChatMessage> messages, String model, Optional<Double> frequencyPenalty, Optional<Map<Integer,Integer>> logitBias, Optional<Boolean> logprobs, Optional<Integer> topLogprobs, Optional<Integer> maxTokens, Optional<Integer> n, Optional<Double> presencePenalty, Optional<ResponseFormat> responseFormat, Optional<Integer> seed, Optional<List<String>> stop, Optional<Boolean> stream, Optional<CreateChatCompletionRequest.StreamOptions> streamOptions, Optional<Double> temperature, Optional<Double> topP, Optional<List<Tool>> tools, Optional<Object> toolChoice, Optional<Boolean> parallelToolCalls, Optional<String> user)
      Creates an instance of a CreateChatCompletionRequest record class.
      Parameters:
      messages - the value for the messages record component
      model - the value for the model record component
      frequencyPenalty - the value for the frequencyPenalty record component
      logitBias - the value for the logitBias record component
      logprobs - the value for the logprobs record component
      topLogprobs - the value for the topLogprobs 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
      responseFormat - the value for the responseFormat 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
      streamOptions - the value for the streamOptions 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
      parallelToolCalls - the value for the parallelToolCalls record component
      user - the value for the user record component
  • Method Details

    • newBuilder

      public static CreateChatCompletionRequest.Builder newBuilder()
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • messages

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

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

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

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

      public Optional<Boolean> logprobs()
      Returns the value of the logprobs record component.
      Returns:
      the value of the logprobs record component
    • topLogprobs

      public Optional<Integer> topLogprobs()
      Returns the value of the topLogprobs record component.
      Returns:
      the value of the topLogprobs record component
    • maxTokens

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

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

      public Optional<Double> presencePenalty()
      Returns the value of the presencePenalty record component.
      Returns:
      the value of the presencePenalty record component
    • responseFormat

      public Optional<ResponseFormat> responseFormat()
      Returns the value of the responseFormat record component.
      Returns:
      the value of the responseFormat record component
    • seed

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

      public Optional<List<String>> stop()
      Returns the value of the stop record component.
      Returns:
      the value of the stop record component
    • stream

      public Optional<Boolean> stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component
    • streamOptions

      Returns the value of the streamOptions record component.
      Returns:
      the value of the streamOptions record component
    • temperature

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

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

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

      public Optional<Object> toolChoice()
      Returns the value of the toolChoice record component.
      Returns:
      the value of the toolChoice record component
    • parallelToolCalls

      public Optional<Boolean> parallelToolCalls()
      Returns the value of the parallelToolCalls record component.
      Returns:
      the value of the parallelToolCalls record component
    • user

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