pub struct CreateCompletionResponse {
pub id: String,
pub choices: Vec<CreateCompletionResponseChoice>,
pub created: u64,
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: u64
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more