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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CommonModelParametersfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CommonModelParameters from the JsonReader.Get the frequencyPenalty property: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens.Get the maxTokens property: Maximum number of tokens to generate.getModel()Get the model property: The name of the model to use (e.g., 'gpt-4o', etc.).Get the presencePenalty property: A float in the range [-2,2] that penalizes new tokens based on their existing presence.getSeed()Get the seed property: Random seed for controlling deterministic outputs.getStop()Get the stop property: List of stop sequences that will cut off text generation.Get the temperature property: Sampling temperature.setFrequencyPenalty(Float frequencyPenalty) Set the frequencyPenalty property: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens.setMaxTokens(Integer maxTokens) Set the maxTokens property: Maximum number of tokens to generate.Set the model property: The name of the model to use (e.g., 'gpt-4o', etc.).setPresencePenalty(Float presencePenalty) Set the presencePenalty property: A float in the range [-2,2] that penalizes new tokens based on their existing presence.Set the seed property: Random seed for controlling deterministic outputs.Set the stop property: List of stop sequences that will cut off text generation.setTemperature(Float temperature) Set the temperature property: Sampling temperature.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CommonModelParameters
public CommonModelParameters()Creates an instance of CommonModelParameters class.
-
-
Method Details
-
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
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
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
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
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
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
Get the maxTokens property: Maximum number of tokens to generate.- Returns:
- the maxTokens value.
-
setMaxTokens
Set the maxTokens property: Maximum number of tokens to generate.- Parameters:
maxTokens- the maxTokens value to set.- Returns:
- the CommonModelParameters object itself.
-
getTemperature
Get the temperature property: Sampling temperature. Default is 0.7.- Returns:
- the temperature value.
-
setTemperature
Set the temperature property: Sampling temperature. Default is 0.7.- Parameters:
temperature- the temperature value to set.- Returns:
- the CommonModelParameters object itself.
-
getSeed
Get the seed property: Random seed for controlling deterministic outputs. If omitted, randomization is used.- Returns:
- the seed value.
-
setSeed
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
Get the stop property: List of stop sequences that will cut off text generation. Default is none.- Returns:
- the stop value.
-
setStop
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
- Specified by:
toJsonin interfacecom.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.
-