CreateChatCompletionResponse class abstract
Represents a chat completion response returned by model, based on the provided input.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
CreateChatCompletionResponse.new({@JsonKey(includeIfNull: false) String? id, required List<
ChatCompletionResponseChoice> choices, required int created, required String model, @JsonKey(name: 'service_tier', includeIfNull: false, unknownEnumValue: JsonKey.nullForUndefinedEnumValue) ServiceTier? serviceTier, @JsonKey(name: 'system_fingerprint', includeIfNull: false) String? systemFingerprint, required String object, @JsonKey(includeIfNull: false) CompletionUsage? usage}) -
Factory constructor for CreateChatCompletionResponse
constfactory
-
CreateChatCompletionResponse.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
Properties
-
choices
→ List<
ChatCompletionResponseChoice> -
A list of chat completion choices. Can be more than one if
n
is greater than 1.no setterinherited -
copyWith
→ $CreateChatCompletionResponseCopyWith<
CreateChatCompletionResponse> -
Create a copy of CreateChatCompletionResponse
with the given fields replaced by the non-null parameter values.
no setterinherited
- created → int
-
The Unix timestamp (in seconds) of when the chat completion was created.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
A unique identifier for the chat completion.
no setterinherited
- model → String
-
The model used for the chat completion.
no setterinherited
- object → String
-
The object type, which is always
chat.completion
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceTier → ServiceTier?
-
The service tier used for processing the request. This field is only included if the
service_tier
parameter is specified in the request.no setterinherited - systemFingerprint → String?
-
This fingerprint represents the backend configuration that the model runs with.
no setterinherited
- usage → CompletionUsage?
-
Usage statistics for the completion request.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_CreateChatCompletionResponse value)) → TResult -
Available on CreateChatCompletionResponse, provided by the CreateChatCompletionResponsePatterns extension
Aswitch
-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_CreateChatCompletionResponse value)?) → TResult? -
Available on CreateChatCompletionResponse, provided by the CreateChatCompletionResponsePatterns extension
A variant ofmap
that fallback to returningnull
. -
maybeMap<
TResult extends Object?> (TResult $default(_CreateChatCompletionResponse value)?, {required TResult orElse()}) → TResult -
Available on CreateChatCompletionResponse, provided by the CreateChatCompletionResponsePatterns extension
A variant ofmap
that fallback to returningorElse
. -
maybeWhen<
TResult extends Object?> (TResult $default(String? id, List< ChatCompletionResponseChoice> choices, int created, String model, ServiceTier? serviceTier, String? systemFingerprint, String object, CompletionUsage? usage)?, {required TResult orElse()}) → TResult -
Available on CreateChatCompletionResponse, provided by the CreateChatCompletionResponsePatterns extension
A variant ofwhen
that fallback to anorElse
callback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this CreateChatCompletionResponse to a JSON map.
inherited
-
toMap(
) → Map< String, dynamic> - Map representation of object (not serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → String? - Perform validations on the schema property values
-
when<
TResult extends Object?> (TResult $default(String? id, List< ChatCompletionResponseChoice> choices, int created, String model, ServiceTier? serviceTier, String? systemFingerprint, String object, CompletionUsage? usage)) → TResult -
Available on CreateChatCompletionResponse, provided by the CreateChatCompletionResponsePatterns extension
Aswitch
-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String? id, List< ChatCompletionResponseChoice> choices, int created, String model, ServiceTier? serviceTier, String? systemFingerprint, String object, CompletionUsage? usage)?) → TResult? -
Available on CreateChatCompletionResponse, provided by the CreateChatCompletionResponsePatterns extension
A variant ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
propertyNames
→ const List<
String> - List of all property names of schema