pub struct StreamTranslationState {
pub source: Option<FormatId>,
pub target: Option<FormatId>,
pub model: Option<String>,
pub message_id: Option<String>,
pub target_model: Option<String>,
pub target_message_id: Option<String>,
pub saw_message_start: bool,
pub emitted_message_start: bool,
pub finished: bool,
pub errored: bool,
pub usage: Usage,
/* private fields */
}Expand description
Mutable state accumulated while translating one streaming response.
Fields§
§source: Option<FormatId>§target: Option<FormatId>§model: Option<String>Model name observed on the source provider stream.
message_id: Option<String>Message/response ID observed on the source provider stream.
target_model: Option<String>Model that served the call, exposed to the client in place of the id the
source stream reported. None falls back to Self::model.
target_message_id: Option<String>Optional message/response ID the target stream should expose to the client.
saw_message_start: bool§emitted_message_start: bool§finished: bool§errored: boolSet once an in-band error event was emitted; the encoder then emits nothing further.
usage: UsageImplementations§
Trait Implementations§
Source§impl Clone for StreamTranslationState
impl Clone for StreamTranslationState
Source§fn clone(&self) -> StreamTranslationState
fn clone(&self) -> StreamTranslationState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamTranslationState
impl Debug for StreamTranslationState
Source§impl Default for StreamTranslationState
impl Default for StreamTranslationState
Source§fn default() -> StreamTranslationState
fn default() -> StreamTranslationState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StreamTranslationState
impl<'de> Deserialize<'de> for StreamTranslationState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StreamTranslationState
impl PartialEq for StreamTranslationState
Source§impl Serialize for StreamTranslationState
impl Serialize for StreamTranslationState
impl StructuralPartialEq for StreamTranslationState
Auto Trait Implementations§
impl Freeze for StreamTranslationState
impl RefUnwindSafe for StreamTranslationState
impl Send for StreamTranslationState
impl Sync for StreamTranslationState
impl Unpin for StreamTranslationState
impl UnsafeUnpin for StreamTranslationState
impl UnwindSafe for StreamTranslationState
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