ChatCompletionCommonModelParameters Class

  • java.lang.Object
    • com.azure.search.documents.indexes.models.ChatCompletionCommonModelParameters

Implements

public final class ChatCompletionCommonModelParameters
implements JsonSerializable<ChatCompletionCommonModelParameters>

Common language model parameters for Chat Completions. If omitted, default values are used.

Constructor Summary

Constructor Description
ChatCompletionCommonModelParameters()

Creates an instance of ChatCompletionCommonModelParameters class.

Method Summary

Modifier and Type Method and Description
static ChatCompletionCommonModelParameters fromJson(JsonReader jsonReader)

Reads an instance of ChatCompletionCommonModelParameters from the JsonReader.

Double getFrequencyPenalty()

Get the frequencyPenalty property: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens.

Integer getMaxTokens()

Get the maxTokens property: Maximum number of tokens to generate.

String getModelName()

Get the modelName property: The name of the model to use (e.g., 'gpt-4o', etc.).

Double getPresencePenalty()

Get the presencePenalty property: A float in the range [-2,2] that penalizes new tokens based on their existing presence.

Integer getSeed()

Get the seed property: Random seed for controlling deterministic outputs.

List<String> getStop()

Get the stop property: List of stop sequences that will cut off text generation.

Double getTemperature()

Get the temperature property: Sampling temperature.

ChatCompletionCommonModelParameters setFrequencyPenalty(Double frequencyPenalty)

Set the frequencyPenalty property: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens.

ChatCompletionCommonModelParameters setMaxTokens(Integer maxTokens)

Set the maxTokens property: Maximum number of tokens to generate.

ChatCompletionCommonModelParameters setModelName(String modelName)

Set the modelName property: The name of the model to use (e.g., 'gpt-4o', etc.).

ChatCompletionCommonModelParameters setPresencePenalty(Double presencePenalty)

Set the presencePenalty property: A float in the range [-2,2] that penalizes new tokens based on their existing presence.

ChatCompletionCommonModelParameters setSeed(Integer seed)

Set the seed property: Random seed for controlling deterministic outputs.

ChatCompletionCommonModelParameters setStop(List<String> stop)

Set the stop property: List of stop sequences that will cut off text generation.

ChatCompletionCommonModelParameters setStop(String[] stop)

Set the stop property: List of stop sequences that will cut off text generation.

ChatCompletionCommonModelParameters setTemperature(Double temperature)

Set the temperature property: Sampling temperature.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ChatCompletionCommonModelParameters

public ChatCompletionCommonModelParameters()

Creates an instance of ChatCompletionCommonModelParameters class.

Method Details

fromJson

public static ChatCompletionCommonModelParameters fromJson(JsonReader jsonReader)

Reads an instance of ChatCompletionCommonModelParameters from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ChatCompletionCommonModelParameters 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 ChatCompletionCommonModelParameters.

getFrequencyPenalty

public Double 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.

getMaxTokens

public Integer getMaxTokens()

Get the maxTokens property: Maximum number of tokens to generate.

Returns:

the maxTokens value.

getModelName

public String getModelName()

Get the modelName property: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.

Returns:

the modelName value.

getPresencePenalty

public Double 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.

getSeed

public Integer getSeed()

Get the seed property: Random seed for controlling deterministic outputs. If omitted, randomization is used.

Returns:

the seed value.

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.

getTemperature

public Double getTemperature()

Get the temperature property: Sampling temperature. Default is 0.7.

Returns:

the temperature value.

setFrequencyPenalty

public ChatCompletionCommonModelParameters setFrequencyPenalty(Double 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 ChatCompletionCommonModelParameters object itself.

setMaxTokens

public ChatCompletionCommonModelParameters setMaxTokens(Integer maxTokens)

Set the maxTokens property: Maximum number of tokens to generate.

Parameters:

maxTokens - the maxTokens value to set.

Returns:

the ChatCompletionCommonModelParameters object itself.

setModelName

public ChatCompletionCommonModelParameters setModelName(String modelName)

Set the modelName property: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.

Parameters:

modelName - the modelName value to set.

Returns:

the ChatCompletionCommonModelParameters object itself.

setPresencePenalty

public ChatCompletionCommonModelParameters setPresencePenalty(Double 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 ChatCompletionCommonModelParameters object itself.

setSeed

public ChatCompletionCommonModelParameters 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 ChatCompletionCommonModelParameters object itself.

setStop

public ChatCompletionCommonModelParameters 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 ChatCompletionCommonModelParameters object itself.

setStop

public ChatCompletionCommonModelParameters setStop(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 ChatCompletionCommonModelParameters object itself.

setTemperature

public ChatCompletionCommonModelParameters setTemperature(Double temperature)

Set the temperature property: Sampling temperature. Default is 0.7.

Parameters:

temperature - the temperature value to set.

Returns:

the ChatCompletionCommonModelParameters object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to