pub struct CreateCompletionResponse {
pub id: String,
pub object: String,
pub created: u64,
pub model: Model,
pub choices: Vec<CompletionChoice>,
pub usage: Option<CompletionUsage>,
}Expand description
The response returned by the OpenAI Completions API.
Contains generated choices plus optional usage metrics.
Fields§
§id: StringAn identifier fo this completion (e.g. "cmpl-xxxxxxxx").
object: StringThe object type, usually "text_completion".
created: u64The creation time in epoch seconds.
model: ModelThe model used for this request.
choices: Vec<CompletionChoice>A list of generated completions.
usage: Option<CompletionUsage>Token usage data (optional field).
Trait Implementations§
Source§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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CreateCompletionResponse
impl RefUnwindSafe for CreateCompletionResponse
impl Send for CreateCompletionResponse
impl Sync for CreateCompletionResponse
impl Unpin for CreateCompletionResponse
impl UnwindSafe for CreateCompletionResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more