pub struct OpenAiChatStreamCodec;Expand description
Stream codec for OpenAI Chat Completions chunks.
Trait Implementations§
Source§impl StreamCodec for OpenAiChatStreamCodec
impl StreamCodec for OpenAiChatStreamCodec
Source§fn decode_event(
&self,
state: &mut StreamTranslationState,
event: &Value,
) -> Vec<LlmResponseChunk>
fn decode_event( &self, state: &mut StreamTranslationState, event: &Value, ) -> Vec<LlmResponseChunk>
Decodes one provider event into zero or more neutral events.
Source§fn encode_event(
&self,
state: &mut StreamTranslationState,
event: LlmResponseChunk,
) -> Vec<Value>
fn encode_event( &self, state: &mut StreamTranslationState, event: LlmResponseChunk, ) -> Vec<Value>
Encodes one neutral event into zero or more provider events.
Source§fn finish(&self, state: &mut StreamTranslationState) -> Vec<Value>
fn finish(&self, state: &mut StreamTranslationState) -> Vec<Value>
Emits any terminal provider events needed after the source stream ends. Read more
Source§fn observe_replayed_event(
&self,
state: &mut StreamTranslationState,
_raw: &Value,
normalized: Vec<LlmResponseChunk>,
)
fn observe_replayed_event( &self, state: &mut StreamTranslationState, _raw: &Value, normalized: Vec<LlmResponseChunk>, )
Advances encoder state after an exact same-format event replay. Read more
Auto Trait Implementations§
impl Freeze for OpenAiChatStreamCodec
impl RefUnwindSafe for OpenAiChatStreamCodec
impl Send for OpenAiChatStreamCodec
impl Sync for OpenAiChatStreamCodec
impl Unpin for OpenAiChatStreamCodec
impl UnsafeUnpin for OpenAiChatStreamCodec
impl UnwindSafe for OpenAiChatStreamCodec
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