TopLogprob
ChatResult.swift:43struct TopLogprob
struct TopLogprob
s6OpenAI10ChatResultV6ChoiceV0E8LogprobsV0C22CompletionTokenLogprobV03TopI0V
What are these?3ZQJE
import OpenAI
struct ChatCompletionTokenLogprob
struct ChatResult
struct Choice
struct ChoiceLogprobs
init(from decoder: any Decoder) throws
let bytes: [Int]?
A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null
if there is no bytes representation for the token.
let logprob: Double
The log probability of this token.
let token: String
The token.
let topLogprobs: [TopLogprob]
List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs
returned.
enum CodingKeys
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
init(from decoder: any Decoder) throws
let bytes: [Int]?
A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null
if there is no bytes representation for the token.
let logprob: Double
The log probability of this token.
let token: String
The token.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.