Class CommonModelParameters

java.lang.Object
com.azure.search.documents.indexes.models.CommonModelParameters
All Implemented Interfaces:
com.azure.json.JsonSerializable<CommonModelParameters>

public final class CommonModelParameters extends Object implements com.azure.json.JsonSerializable<CommonModelParameters>
Common language model parameters for Chat Completions. If omitted, default values are used.
  • Constructor Details

    • CommonModelParameters

      public CommonModelParameters()
      Creates an instance of CommonModelParameters class.
  • Method Details

    • getModel

      public String getModel()
      Get the model property: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.
      Returns:
      the model value.
    • setModel

      public CommonModelParameters setModel(String model)
      Set the model property: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.
      Parameters:
      model - the model value to set.
      Returns:
      the CommonModelParameters object itself.
    • getFrequencyPenalty

      public Float getFrequencyPenalty()
      Get the frequencyPenalty property: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens. Default is 0.
      Returns:
      the frequencyPenalty value.
    • setFrequencyPenalty

      public CommonModelParameters setFrequencyPenalty(Float frequencyPenalty)
      Set the frequencyPenalty property: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens. Default is 0.
      Parameters:
      frequencyPenalty - the frequencyPenalty value to set.
      Returns:
      the CommonModelParameters object itself.
    • getPresencePenalty

      public Float getPresencePenalty()
      Get the presencePenalty property: A float in the range [-2,2] that penalizes new tokens based on their existing presence. Default is 0.
      Returns:
      the presencePenalty value.
    • setPresencePenalty

      public CommonModelParameters setPresencePenalty(Float presencePenalty)
      Set the presencePenalty property: A float in the range [-2,2] that penalizes new tokens based on their existing presence. Default is 0.
      Parameters:
      presencePenalty - the presencePenalty value to set.
      Returns:
      the CommonModelParameters object itself.
    • getMaxTokens

      public Integer getMaxTokens()
      Get the maxTokens property: Maximum number of tokens to generate.
      Returns:
      the maxTokens value.
    • setMaxTokens

      public CommonModelParameters setMaxTokens(Integer maxTokens)
      Set the maxTokens property: Maximum number of tokens to generate.
      Parameters:
      maxTokens - the maxTokens value to set.
      Returns:
      the CommonModelParameters object itself.
    • getTemperature

      public Float getTemperature()
      Get the temperature property: Sampling temperature. Default is 0.7.
      Returns:
      the temperature value.
    • setTemperature

      public CommonModelParameters setTemperature(Float temperature)
      Set the temperature property: Sampling temperature. Default is 0.7.
      Parameters:
      temperature - the temperature value to set.
      Returns:
      the CommonModelParameters object itself.
    • getSeed

      public Integer getSeed()
      Get the seed property: Random seed for controlling deterministic outputs. If omitted, randomization is used.
      Returns:
      the seed value.
    • setSeed

      public CommonModelParameters setSeed(Integer seed)
      Set the seed property: Random seed for controlling deterministic outputs. If omitted, randomization is used.
      Parameters:
      seed - the seed value to set.
      Returns:
      the CommonModelParameters object itself.
    • getStop

      public List<String> getStop()
      Get the stop property: List of stop sequences that will cut off text generation. Default is none.
      Returns:
      the stop value.
    • setStop

      public CommonModelParameters setStop(List<String> stop)
      Set the stop property: List of stop sequences that will cut off text generation. Default is none.
      Parameters:
      stop - the stop value to set.
      Returns:
      the CommonModelParameters object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<CommonModelParameters>
      Throws:
      IOException
    • fromJson

      public static CommonModelParameters fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of CommonModelParameters from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of CommonModelParameters if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the CommonModelParameters.