pub struct VertexAnthropicCodec { /* private fields */ }Expand description
Stateless codec for Anthropic Claude routed through GCP Vertex AI.
Implementations§
Trait Implementations§
Source§impl Clone for VertexAnthropicCodec
impl Clone for VertexAnthropicCodec
Source§fn clone(&self) -> VertexAnthropicCodec
fn clone(&self) -> VertexAnthropicCodec
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 Codec for VertexAnthropicCodec
impl Codec for VertexAnthropicCodec
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable codec identifier —
"anthropic-messages",
"openai-chat", etc. Used in logs and metrics tags.Source§fn capabilities(&self, model: &str) -> Capabilities
fn capabilities(&self, model: &str) -> Capabilities
Capability surface the codec advertises for the given model. Codecs
vary by model (small models lacking vision, etc.).
Source§fn auto_output_strategy(&self, model: &str) -> OutputStrategy
fn auto_output_strategy(&self, model: &str) -> OutputStrategy
Resolve
OutputStrategy::Auto to the codec’s preferred
dispatch shape for model. Called once at codec-construction
time per request — never per-delta or per-retry, so the
resolved strategy is part of the SessionGraph event log’s
deterministic-replay surface. Read moreSource§fn encode(&self, request: &ModelRequest) -> Result<EncodedRequest>
fn encode(&self, request: &ModelRequest) -> Result<EncodedRequest>
Encode IR → wire body for a one-shot (non-streaming) call.
Implementors push warnings onto the returned
EncodedRequest::warnings for any IR field they had to drop or
coerce.Source§fn encode_streaming(&self, request: &ModelRequest) -> Result<EncodedRequest>
fn encode_streaming(&self, request: &ModelRequest) -> Result<EncodedRequest>
Encode IR → wire body for a streaming call. Default impl delegates
to
encode and marks the request as streaming; codecs that need a
different body shape (e.g. stream: true field) or extra headers
(e.g. Accept: text/event-stream) override.Source§fn decode_stream<'a>(
&'a self,
bytes: BoxByteStream<'a>,
warnings_in: Vec<ModelWarning>,
) -> BoxDeltaStream<'a>
fn decode_stream<'a>( &'a self, bytes: BoxByteStream<'a>, warnings_in: Vec<ModelWarning>, ) -> BoxDeltaStream<'a>
Decode an incremental byte stream → IR
StreamDelta stream. Read moreSource§fn decode(
&self,
body: &[u8],
warnings_in: Vec<ModelWarning>,
) -> Result<ModelResponse>
fn decode( &self, body: &[u8], warnings_in: Vec<ModelWarning>, ) -> Result<ModelResponse>
Decode wire body → IR.
warnings_in are the encode-time warnings
that should be carried forward into ModelResponse::warnings so the
caller sees the full advisory list in one place.Source§fn extract_rate_limit(&self, headers: &HeaderMap) -> Option<RateLimitSnapshot>
fn extract_rate_limit(&self, headers: &HeaderMap) -> Option<RateLimitSnapshot>
Extract a
RateLimitSnapshot from response headers, if the
vendor exposes rate-limit state in headers. Default returns
None — codecs whose providers publish rate-limit headers
override this and parse them.Source§impl Debug for VertexAnthropicCodec
impl Debug for VertexAnthropicCodec
Source§impl Default for VertexAnthropicCodec
impl Default for VertexAnthropicCodec
Source§fn default() -> VertexAnthropicCodec
fn default() -> VertexAnthropicCodec
Returns the “default value” for a type. Read more
impl Copy for VertexAnthropicCodec
Auto Trait Implementations§
impl Freeze for VertexAnthropicCodec
impl RefUnwindSafe for VertexAnthropicCodec
impl Send for VertexAnthropicCodec
impl Sync for VertexAnthropicCodec
impl Unpin for VertexAnthropicCodec
impl UnsafeUnpin for VertexAnthropicCodec
impl UnwindSafe for VertexAnthropicCodec
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