pub struct DeltaReceiver<'a> {
pub receiver: Receiver<Result<ChatDelta, Error>>,
pub builder: &'a AiAgent,
pub deltas: Vec<ChatCompletionDelta>,
/* private fields */
}
Fields§
§receiver: Receiver<Result<ChatDelta, Error>>
§builder: &'a AiAgent
§deltas: Vec<ChatCompletionDelta>
Implementations§
Source§impl<'a> DeltaReceiver<'a>
impl<'a> DeltaReceiver<'a>
pub fn from( receiver: Receiver<Result<ChatDelta, Error>>, builder: &'a AiAgent, usage: usize, ) -> Self
pub async fn receive( &mut self, choice_index: i64, ) -> Result<Option<ChatCompletionDelta>>
pub async fn receive_content( &mut self, choice_index: i64, ) -> Result<Option<String>>
pub async fn receive_all(&mut self) -> Result<Option<ChatCompletionDelta>>
pub async fn construct_chat(&mut self) -> Result<Chat>
Auto Trait Implementations§
impl<'a> Freeze for DeltaReceiver<'a>
impl<'a> RefUnwindSafe for DeltaReceiver<'a>
impl<'a> Send for DeltaReceiver<'a>
impl<'a> Sync for DeltaReceiver<'a>
impl<'a> Unpin for DeltaReceiver<'a>
impl<'a> UnwindSafe for DeltaReceiver<'a>
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