mirror of
https://github.com/LukeHagar/log10go.git
synced 2025-12-06 04:20:12 +00:00
73 lines
2.3 KiB
Go
73 lines
2.3 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
package components
|
|
|
|
type TopLogprobs struct {
|
|
// The token.
|
|
Token string `json:"token"`
|
|
// The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
|
|
Logprob float64 `json:"logprob"`
|
|
// 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.
|
|
Bytes []int64 `json:"bytes"`
|
|
}
|
|
|
|
func (o *TopLogprobs) GetToken() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Token
|
|
}
|
|
|
|
func (o *TopLogprobs) GetLogprob() float64 {
|
|
if o == nil {
|
|
return 0.0
|
|
}
|
|
return o.Logprob
|
|
}
|
|
|
|
func (o *TopLogprobs) GetBytes() []int64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Bytes
|
|
}
|
|
|
|
type ChatCompletionTokenLogprob struct {
|
|
// The token.
|
|
Token string `json:"token"`
|
|
// The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
|
|
Logprob float64 `json:"logprob"`
|
|
// 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.
|
|
Bytes []int64 `json:"bytes"`
|
|
// 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.
|
|
TopLogprobs []TopLogprobs `json:"top_logprobs"`
|
|
}
|
|
|
|
func (o *ChatCompletionTokenLogprob) GetToken() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Token
|
|
}
|
|
|
|
func (o *ChatCompletionTokenLogprob) GetLogprob() float64 {
|
|
if o == nil {
|
|
return 0.0
|
|
}
|
|
return o.Logprob
|
|
}
|
|
|
|
func (o *ChatCompletionTokenLogprob) GetBytes() []int64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Bytes
|
|
}
|
|
|
|
func (o *ChatCompletionTokenLogprob) GetTopLogprobs() []TopLogprobs {
|
|
if o == nil {
|
|
return []TopLogprobs{}
|
|
}
|
|
return o.TopLogprobs
|
|
}
|