pub struct AnthropicMessagesStreamCodec;Expand description
Stream codec for Anthropic Messages events.
Trait Implementations§
Source§impl StreamCodec for AnthropicMessagesStreamCodec
impl StreamCodec for AnthropicMessagesStreamCodec
Source§fn is_terminal_event(&self, event: &Value) -> bool
fn is_terminal_event(&self, event: &Value) -> bool
Returns whether a JSON event establishes stream completion.
Source§fn sse_done_is_terminal(&self) -> bool
fn sse_done_is_terminal(&self) -> bool
Returns whether the SSE
[DONE] marker establishes stream completion. Read moreSource§fn stamp_streamed_response_model(&self, event: &mut Value, served_model: &str)
fn stamp_streamed_response_model(&self, event: &mut Value, served_model: &str)
Overrides the model reported by an encoded or preserved event. Read more
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 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 AnthropicMessagesStreamCodec
impl RefUnwindSafe for AnthropicMessagesStreamCodec
impl Send for AnthropicMessagesStreamCodec
impl Sync for AnthropicMessagesStreamCodec
impl Unpin for AnthropicMessagesStreamCodec
impl UnsafeUnpin for AnthropicMessagesStreamCodec
impl UnwindSafe for AnthropicMessagesStreamCodec
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