CompletionLogprobs class abstract

The probabilities on the logprobs most likely tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.

Available extensions
Annotations
  • @freezed

Constructors

CompletionLogprobs.new({@JsonKey(name: 'text_offset', includeIfNull: false) List<int>? textOffset, @JsonKey(name: 'token_logprobs', includeIfNull: false) List<double?>? tokenLogprobs, @JsonKey(includeIfNull: false) List<String>? tokens, @JsonKey(name: 'top_logprobs', includeIfNull: false) List<Map<String, double>?>? topLogprobs})
Factory constructor for CompletionLogprobs
const
factory
CompletionLogprobs.fromJson(Map<String, dynamic> json)
Object construction from a JSON representation
factory

Properties

copyWith → $CompletionLogprobsCopyWith<CompletionLogprobs>
Create a copy of CompletionLogprobs with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textOffset List<int>?
The offset of the token from the beginning of the prompt.
no setterinherited
tokenLogprobs List<double?>?
The log probabilities of tokens in the completion.
no setterinherited
tokens List<String>?
The tokens generated by the model converted back to text.
no setterinherited
topLogprobs List<Map<String, double>?>?
The log probabilities of the logprobs most likely tokens.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_CompletionLogprobs value)) → TResult

Available on CompletionLogprobs, provided by the CompletionLogprobsPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_CompletionLogprobs value)?) → TResult?

Available on CompletionLogprobs, provided by the CompletionLogprobsPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_CompletionLogprobs value)?, {required TResult orElse()}) → TResult

Available on CompletionLogprobs, provided by the CompletionLogprobsPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(List<int>? textOffset, List<double?>? tokenLogprobs, List<String>? tokens, List<Map<String, double>?>? topLogprobs)?, {required TResult orElse()}) → TResult

Available on CompletionLogprobs, provided by the CompletionLogprobsPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this CompletionLogprobs 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(List<int>? textOffset, List<double?>? tokenLogprobs, List<String>? tokens, List<Map<String, double>?>? topLogprobs)) → TResult

Available on CompletionLogprobs, provided by the CompletionLogprobsPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(List<int>? textOffset, List<double?>? tokenLogprobs, List<String>? tokens, List<Map<String, double>?>? topLogprobs)?) → TResult?

Available on CompletionLogprobs, provided by the CompletionLogprobsPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

propertyNames → const List<String>
List of all property names of schema