pub struct ChatToClaudeStream { /* private fields */ }Implementations§
Source§impl ChatToClaudeStream
impl ChatToClaudeStream
pub fn new( context: ChatToClaudeContext, flow: IdentityFlow, limits: StreamLimits, ) -> Result<Self, TransformError>
pub fn new_with_policy( context: ChatToClaudeContext, flow: IdentityFlow, limits: StreamLimits, policy: TargetIdPolicy, ) -> Result<Self, TransformError>
pub fn identities(&self) -> &IdentityFlow
pub fn push( &mut self, chunk: ChatCompletionChunk, ) -> Result<Converted<Vec<StreamEvent>>, TransformError>
pub fn push_done(&mut self) -> Result<(), TransformError>
pub fn finish(self) -> Result<StreamEnd<StreamEvent>, TransformError>
Sourcepub fn finish_with_usage(
self,
facts: Option<Usage>,
) -> Result<StreamEnd<StreamEvent>, TransformError>
pub fn finish_with_usage( self, facts: Option<Usage>, ) -> Result<StreamEnd<StreamEvent>, TransformError>
Actual final usage may be supplied when the Chat provider omits usage.
Trait Implementations§
Source§impl StreamBridge for ChatToClaudeStream
impl StreamBridge for ChatToClaudeStream
type NativeEvent = ChatCompletionChunk
type ClientEvent = StreamEvent
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 ChatToClaudeStream
impl RefUnwindSafe for ChatToClaudeStream
impl Send for ChatToClaudeStream
impl Sync for ChatToClaudeStream
impl Unpin for ChatToClaudeStream
impl UnsafeUnpin for ChatToClaudeStream
impl UnwindSafe for ChatToClaudeStream
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