pub struct ResponsesToChatStream { /* private fields */ }Expand description
Each push returns only newly emitted target chunks. Source item/part order is retained when concurrent Responses messages feed Chat’s single content field.
Implementations§
Source§impl ResponsesToChatStream
impl ResponsesToChatStream
pub fn new(flow: IdentityFlow, limits: StreamLimits) -> Self
pub fn new_with_policy( flow: IdentityFlow, limits: StreamLimits, policy: TargetIdPolicy, ) -> Result<Self, TransformError>
pub fn identities(&self) -> &IdentityFlow
pub fn push( &mut self, event: StreamEvent, ) -> Result<Converted<Vec<ChatCompletionChunk>>, TransformError>
pub fn finish(self) -> Result<StreamEnd<ChatCompletionChunk>, TransformError>
Trait Implementations§
Source§impl FanoutBridge for ResponsesToChatStream
impl FanoutBridge for ResponsesToChatStream
fn reserve( &mut self, role: IdentityRole, ids: &BTreeSet<String>, ) -> Result<(), TransformError>
Source§impl StreamBridge for ResponsesToChatStream
impl StreamBridge for ResponsesToChatStream
type NativeEvent = StreamEvent
type ClientEvent = ChatCompletionChunk
type NativeRequest = GenerateContentRequestBody
type ClientRequest = GenerateContentRequestBody
fn identities(&self) -> &IdentityFlow
fn push( &mut self, event: Self::NativeEvent, ) -> Result<Converted<Vec<Self::ClientEvent>>, TransformError>
fn finish(self) -> Result<BridgeEnd<Self::ClientEvent>, TransformError>
fn push_done(&mut self) -> Result<(), TransformError>
Auto Trait Implementations§
impl Freeze for ResponsesToChatStream
impl RefUnwindSafe for ResponsesToChatStream
impl Send for ResponsesToChatStream
impl Sync for ResponsesToChatStream
impl Unpin for ResponsesToChatStream
impl UnsafeUnpin for ResponsesToChatStream
impl UnwindSafe for ResponsesToChatStream
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