ChatOptions class
Represents the options for a chat request.
- Annotations
-
- @Source(name: 'ChatOptions.cs', namespace: 'Microsoft.Extensions.AI', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/', commit: '19172fa728d335d112581b4e75f5762903281f60')
Constructors
-
ChatOptions({String? conversationId, String? modelId, double? temperature, double? topP, int? topK, int? maxOutputTokens, int? seed, double? frequencyPenalty, double? presencePenalty, ReasoningOptions? reasoning, ChatResponseFormat? responseFormat, List<
String> ? stopSequences, String? instructions, List<AITool> ? tools, ChatToolMode? toolMode, bool? allowMultipleToolCalls, bool? allowBackgroundResponses, ResponseContinuationToken? continuationToken, Object? rawRepresentationFactory(ChatClient)?, AdditionalPropertiesDictionary? additionalProperties}) - Creates a new ChatOptions.
Properties
- additionalProperties ↔ AdditionalPropertiesDictionary?
-
Additional properties.
getter/setter pair
- allowBackgroundResponses ↔ bool?
-
Whether non-streaming responses may start a background operation and
return a continuation token for polling.
getter/setter pair
- allowMultipleToolCalls ↔ bool?
-
Whether the model may make multiple tool calls per response.
getter/setter pair
- continuationToken ↔ ResponseContinuationToken?
-
A token to resume an interrupted response.
getter/setter pair
- conversationId ↔ String?
-
Associates this request with a conversation.
getter/setter pair
- frequencyPenalty ↔ double?
-
Penalty for token frequency to reduce repetitions.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- instructions ↔ String?
-
Per-request instructions for the model.
getter/setter pair
- maxOutputTokens ↔ int?
-
Maximum number of tokens to generate.
getter/setter pair
- modelId ↔ String?
-
The model to use for the request.
getter/setter pair
- presencePenalty ↔ double?
-
Penalty for token presence to reduce repetition.
getter/setter pair
- rawRepresentationFactory ↔ Object? Function(ChatClient)?
-
A callback that produces the implementation-specific options object.
getter/setter pair
- reasoning ↔ ReasoningOptions?
-
Options for configuring reasoning behavior.
getter/setter pair
- responseFormat ↔ ChatResponseFormat?
-
The desired response format.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seed ↔ int?
-
Seed for reproducible generation.
getter/setter pair
-
stopSequences
↔ List<
String> ? -
Sequences that cause the model to stop generating.
getter/setter pair
- temperature ↔ double?
-
Controls randomness in the response (0.0 - 2.0).
getter/setter pair
- toolMode ↔ ChatToolMode?
-
How the model should use the provided tools.
getter/setter pair
-
tools
↔ List<
AITool> ? -
Tools available for the model to use.
getter/setter pair
- topK ↔ int?
-
Number of most probable tokens to consider.
getter/setter pair
- topP ↔ double?
-
Nucleus sampling factor (0.0 - 1.0).
getter/setter pair
Methods
-
clone(
) → ChatOptions - Creates a deep copy of this ChatOptions.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited