pub struct ChatToGeminiStream { /* private fields */ }Expand description
Text is emitted immediately. Function arguments remain bounded strings until their choice finishes because Gemini requires one complete JSON object.
Implementations§
Source§impl ChatToGeminiStream
impl ChatToGeminiStream
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, chunk: ChatCompletionChunk, ) -> Result<Converted<Vec<GenerateContentResponseBody>>, TransformError>
pub fn push_done(&mut self) -> Result<(), TransformError>
pub fn finish( self, ) -> Result<StreamEnd<GenerateContentResponseBody>, TransformError>
Trait Implementations§
Source§impl StreamBridge for ChatToGeminiStream
impl StreamBridge for ChatToGeminiStream
type NativeEvent = ChatCompletionChunk
type ClientEvent = GenerateContentResponseBody
type NativeRequest = GenerateContentRequestBody
type ClientRequest = GenerateContentRequestBody
fn identities(&self) -> &IdentityFlow
fn push( &mut self, event: Self::NativeEvent, ) -> Result<Converted<Vec<Self::ClientEvent>>, TransformError>
fn push_done(&mut self) -> Result<(), TransformError>
fn finish(self) -> Result<BridgeEnd<Self::ClientEvent>, TransformError>
Auto Trait Implementations§
impl Freeze for ChatToGeminiStream
impl RefUnwindSafe for ChatToGeminiStream
impl Send for ChatToGeminiStream
impl Sync for ChatToGeminiStream
impl Unpin for ChatToGeminiStream
impl UnsafeUnpin for ChatToGeminiStream
impl UnwindSafe for ChatToGeminiStream
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