openai_struct/models/chat_completion_token_logprob.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https:///platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https:///github.com/swagger-api/swagger-codegen.git
9 */
10
11#[allow(unused_imports)]
12use serde_json::Value;
13
14/// # on openapi.yaml
15///
16/// ```yaml
17/// ChatCompletionTokenLogprob:
18/// type: object
19/// properties:
20/// token:
21/// description: The token.
22/// type: string
23/// logprob:
24/// description:
25/// The log probability of this token, if it is within the top 20 most
26/// likely tokens. Otherwise, the value `-9999.0` is used to signify
27/// that the token is very unlikely.
28/// type: number
29/// bytes:
30/// description:
31/// A list of integers representing the UTF-8 bytes representation of
32/// the token. Useful in instances where characters are represented by
33/// multiple tokens and their byte representations must be combined to
34/// generate the correct text representation. Can be `null` if there is
35/// no bytes representation for the token.
36/// type: array
37/// items:
38/// type: integer
39/// nullable: true
40/// top_logprobs:
41/// description:
42/// List of the most likely tokens and their log probability, at this
43/// token position. In rare cases, there may be fewer than the number of
44/// requested `top_logprobs` returned.
45/// type: array
46/// items:
47/// type: object
48/// properties:
49/// token:
50/// description: The token.
51/// type: string
52/// logprob:
53/// description:
54/// The log probability of this token, if it is within the top 20 most
55/// likely tokens. Otherwise, the value `-9999.0` is used to
56/// signify that the token is very unlikely.
57/// type: number
58/// bytes:
59/// description:
60/// A list of integers representing the UTF-8 bytes representation of
61/// the token. Useful in instances where characters are
62/// represented by multiple tokens and their byte representations
63/// must be combined to generate the correct text representation.
64/// Can be `null` if there is no bytes representation for the
65/// token.
66/// type: array
67/// items:
68/// type: integer
69/// nullable: true
70/// required:
71/// - token
72/// - logprob
73/// - bytes
74/// required:
75/// - token
76/// - logprob
77/// - bytes
78/// - top_logprobs
79/// ```
80#[derive(Debug, Serialize, Deserialize)]
81pub struct ChatCompletionTokenLogprob {
82 /// 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.
83 #[serde(rename = "bytes")]
84 pub bytes: Vec<i32>,
85 /// 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.
86 #[serde(rename = "logprob")]
87 pub logprob: f32,
88 /// The token.
89 #[serde(rename = "token")]
90 pub token: String,
91 /// 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.
92 #[serde(rename = "top_logprobs")]
93 pub top_logprobs: Vec<crate::models::ChatCompletionTokenLogprobTopLogprobs>,
94}