pub struct LiveStreamTranslator { /* private fields */ }Implementations§
Source§impl LiveStreamTranslator
impl LiveStreamTranslator
pub fn new(message_id: impl Into<String>, model: impl Into<String>) -> Self
pub fn with_estimated_input_tokens( message_id: impl Into<String>, model: impl Into<String>, estimated_input_tokens: u64, ) -> Self
pub fn accept( &mut self, payload: &Value, traffic: Option<&TrafficCapture>, ) -> Result<Vec<u8>, String>
pub fn is_finished(&self) -> bool
pub fn has_semantic_output(&self) -> bool
pub fn ping_chunk(&mut self, traffic: Option<&TrafficCapture>) -> Vec<u8> ⓘ
pub fn finish_after_closed_completed_tool_call( &mut self, traffic: Option<&TrafficCapture>, ) -> Vec<u8> ⓘ
pub fn error_chunk( &mut self, message: &str, error_type: &str, traffic: Option<&TrafficCapture>, ) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for LiveStreamTranslator
impl RefUnwindSafe for LiveStreamTranslator
impl Send for LiveStreamTranslator
impl Sync for LiveStreamTranslator
impl Unpin for LiveStreamTranslator
impl UnsafeUnpin for LiveStreamTranslator
impl UnwindSafe for LiveStreamTranslator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more