pub struct ChatCompletionGeneric<C> {
pub id: String,
pub object: String,
pub created: u64,
pub model: String,
pub choices: Vec<C>,
pub usage: Option<Usage>,
}
Fields§
§id: String
§object: String
§created: u64
§model: String
§choices: Vec<C>
§usage: Option<Usage>
Implementations§
Source§impl<C> ChatCompletionGeneric<C>
impl<C> ChatCompletionGeneric<C>
pub fn builder( model: &str, messages: impl Into<Vec<ChatCompletionMessage>>, ) -> ChatCompletionBuilder
Source§impl ChatCompletionGeneric<ChatCompletionChoice>
impl ChatCompletionGeneric<ChatCompletionChoice>
pub async fn create(request: ChatCompletionRequest) -> ApiResponseOrError<Self>
Sourcepub async fn get(id: &str, credentials: Credentials) -> ApiResponseOrError<Self>
pub async fn get(id: &str, credentials: Credentials) -> ApiResponseOrError<Self>
Get a stored completion.
Source§impl ChatCompletionGeneric<ChatCompletionChoiceDelta>
impl ChatCompletionGeneric<ChatCompletionChoiceDelta>
pub async fn create( request: ChatCompletionRequest, ) -> Result<Receiver<Self>, CannotCloneRequestError>
Sourcepub fn merge(
&mut self,
other: ChatCompletionDelta,
) -> Result<(), ChatCompletionDeltaMergeError>
pub fn merge( &mut self, other: ChatCompletionDelta, ) -> Result<(), ChatCompletionDeltaMergeError>
Merges the input delta completion into self
.
Trait Implementations§
Source§impl<C: Clone> Clone for ChatCompletionGeneric<C>
impl<C: Clone> Clone for ChatCompletionGeneric<C>
Source§fn clone(&self) -> ChatCompletionGeneric<C>
fn clone(&self) -> ChatCompletionGeneric<C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<C: Debug> Debug for ChatCompletionGeneric<C>
impl<C: Debug> Debug for ChatCompletionGeneric<C>
Source§impl<'de, C> Deserialize<'de> for ChatCompletionGeneric<C>where
C: Deserialize<'de>,
impl<'de, C> Deserialize<'de> for ChatCompletionGeneric<C>where
C: Deserialize<'de>,
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
Source§impl From<ChatCompletionGeneric<ChatCompletionChoiceDelta>> for ChatCompletion
impl From<ChatCompletionGeneric<ChatCompletionChoiceDelta>> for ChatCompletion
Source§fn from(delta: ChatCompletionDelta) -> Self
fn from(delta: ChatCompletionDelta) -> Self
Converts to this type from the input type.
Source§impl<C: PartialEq> PartialEq for ChatCompletionGeneric<C>
impl<C: PartialEq> PartialEq for ChatCompletionGeneric<C>
impl<C: Eq> Eq for ChatCompletionGeneric<C>
impl<C> StructuralPartialEq for ChatCompletionGeneric<C>
Auto Trait Implementations§
impl<C> Freeze for ChatCompletionGeneric<C>
impl<C> RefUnwindSafe for ChatCompletionGeneric<C>where
C: RefUnwindSafe,
impl<C> Send for ChatCompletionGeneric<C>where
C: Send,
impl<C> Sync for ChatCompletionGeneric<C>where
C: Sync,
impl<C> Unpin for ChatCompletionGeneric<C>where
C: Unpin,
impl<C> UnwindSafe for ChatCompletionGeneric<C>where
C: UnwindSafe,
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