pub enum ChatResponse {
NonStreaming(Value),
Streaming(Box<dyn Stream<Item = Result<Bytes, UpstreamError>> + Send + Unpin>),
}Expand description
Chat-completion response — buffered JSON or byte stream.
A manual Debug impl is required because dyn Stream has no Debug;
the streaming arm is rendered with a placeholder that still identifies
the variant.
Variants§
NonStreaming(Value)
Full buffered body for non-streaming calls.
Streaming(Box<dyn Stream<Item = Result<Bytes, UpstreamError>> + Send + Unpin>)
Raw byte stream for streaming calls. The boxed trait object keeps the enum cheap to move and decouples callers from the concrete HTTP body type produced by the adapter.
Trait Implementations§
Source§impl Debug for ChatResponse
impl Debug for ChatResponse
Source§impl<'de> Deserialize<'de> for ChatResponse
impl<'de> Deserialize<'de> for ChatResponse
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
Auto Trait Implementations§
impl !RefUnwindSafe for ChatResponse
impl !Sync for ChatResponse
impl !UnwindSafe for ChatResponse
impl Freeze for ChatResponse
impl Send for ChatResponse
impl Unpin for ChatResponse
impl UnsafeUnpin for ChatResponse
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