pub struct CreateCompletionResponse {
pub id: String,
pub choices: Vec<CreateCompletionResponseChoice>,
pub created: i64,
pub model: String,
pub system_fingerprint: Option<String>,
pub usage: Option<CompletionUsage>,
}
Expand description
Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).
Fields§
§id: String
A unique identifier for the completion.
choices: Vec<CreateCompletionResponseChoice>
The list of completion choices the model generated for the input prompt.
created: i64
The Unix timestamp (in seconds) of when the completion was created.
model: String
The model used for completion.
system_fingerprint: Option<String>
This fingerprint represents the backend configuration that the model runs with.
Can be used in conjunction with the seed
request parameter to understand when backend changes have been made that might impact determinism.
usage: Option<CompletionUsage>
Implementations§
Source§impl CreateCompletionResponse
impl CreateCompletionResponse
Sourcepub fn builder() -> CreateCompletionResponseBuilder<((), (), (), (), (), ())>
pub fn builder() -> CreateCompletionResponseBuilder<((), (), (), (), (), ())>
Create a builder for building CreateCompletionResponse
.
On the builder, call .id(...)
, .choices(...)
, .created(...)
, .model(...)
, .system_fingerprint(...)
(optional), .usage(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of CreateCompletionResponse
.
Trait Implementations§
Source§impl Clone for CreateCompletionResponse
impl Clone for CreateCompletionResponse
Source§fn clone(&self) -> CreateCompletionResponse
fn clone(&self) -> CreateCompletionResponse
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CreateCompletionResponse
impl Debug for CreateCompletionResponse
Source§impl<'de> Deserialize<'de> for CreateCompletionResponse
impl<'de> Deserialize<'de> for CreateCompletionResponse
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl PartialEq for CreateCompletionResponse
impl PartialEq for CreateCompletionResponse
Source§fn eq(&self, other: &CreateCompletionResponse) -> bool
fn eq(&self, other: &CreateCompletionResponse) -> bool
self
and other
values to be equal, and is used by ==
.