Share via


AzureAIInferencePromptExecutionSettings Class

Definition

Chat completion prompt execution settings.

[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public sealed class AzureAIInferencePromptExecutionSettings : Microsoft.SemanticKernel.PromptExecutionSettings
[<System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)>]
type AzureAIInferencePromptExecutionSettings = class
    inherit PromptExecutionSettings
Public NotInheritable Class AzureAIInferencePromptExecutionSettings
Inherits PromptExecutionSettings
Inheritance
AzureAIInferencePromptExecutionSettings
Attributes

Constructors

AzureAIInferencePromptExecutionSettings()

Initializes a new instance of the AzureAIInferencePromptExecutionSettings class.

Properties

ExtensionData

Extra properties that may be included in the serialized execution settings.

(Inherited from PromptExecutionSettings)
ExtraParameters

Allowed values: "error" | "drop" | "pass-through"

FrequencyPenalty

A value that influences the probability of generated tokens appearing based on their cumulative frequency in generated text. Positive values will make tokens less likely to appear as their frequency increases and decrease the likelihood of the model repeating the same statements verbatim. Supported range is [-2, 2].

FunctionChoiceBehavior

Gets or sets the behavior defining the way functions are chosen by LLM and how they are invoked by AI connectors.

(Inherited from PromptExecutionSettings)
IsFrozen

Gets a value that indicates whether the PromptExecutionSettings are currently modifiable.

(Inherited from PromptExecutionSettings)
MaxTokens

The maximum number of tokens to generate.

ModelId

Model identifier. This identifies the AI model these settings are configured for e.g., gpt-4, gpt-3.5-turbo

(Inherited from PromptExecutionSettings)
NucleusSamplingFactor

An alternative to sampling with temperature called nucleus sampling. This value causes the model to consider the results of tokens with the provided probability mass. As an example, a value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be considered. It is not recommended to modify temperature and top_p for the same completions request as the interaction of these two settings is difficult to predict. Supported range is [0, 1].

PresencePenalty

A value that influences the probability of generated tokens appearing based on their existing presence in generated text. Positive values will make tokens less likely to appear when they already exist and increase the model's likelihood to output new topics. Supported range is [-2, 2].

ResponseFormat

The format that the model must output. Use this to enable JSON mode instead of the default text mode. Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON via a system or user message. Please note ChatCompletionsResponseFormat is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include ChatCompletionsResponseFormatJSON and ChatCompletionsResponseFormatText.

Seed

If specified, the system will make a best effort to sample deterministically such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed.

ServiceId

Service identifier. This identifies the service these settings are configured for e.g., azure_openai_eastus, openai, ollama, huggingface, etc.

(Inherited from PromptExecutionSettings)
StopSequences

A collection of textual sequences that will end completions generation.

Temperature

The sampling temperature to use that controls the apparent creativity of generated completions. Higher values will make output more random while lower values will make results more focused and deterministic. It is not recommended to modify temperature and top_p for the same completions request as the interaction of these two settings is difficult to predict. Supported range is [0, 1].

Tools

The available tool definitions that the chat completions request can use, including caller-defined functions. Please note ChatCompletionsToolDefinition is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include Azure.AI.Inference.ChatCompletionsFunctionToolDefinition.

Methods

Clone()

Creates a new PromptExecutionSettings object that is a copy of the current instance.

Freeze()

Makes the current PromptExecutionSettings unmodifiable and sets its IsFrozen property to true.

FromExecutionSettings(PromptExecutionSettings)

Create a new settings object with the values from another settings object.

ThrowIfFrozen()

Throws an InvalidOperationException if the PromptExecutionSettings are frozen.

(Inherited from PromptExecutionSettings)

Applies to