pub trait LlmResponseEncoder: Send + Sync {
// Required method
fn encode_response(&self, response: &AnnotatedLlmResponse) -> Result<Json>;
}Expand description
Additive encoder for materializing a normalized response in a provider wire format.
Existing response codecs remain decode-only. Components that perform cross-protocol dispatch can supply this companion trait without changing the managed observability pipeline.
Required Methods§
Sourcefn encode_response(&self, response: &AnnotatedLlmResponse) -> Result<Json>
fn encode_response(&self, response: &AnnotatedLlmResponse) -> Result<Json>
Encode a normalized response into the target provider’s buffered JSON representation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".