pub enum Response {
Status {
id: String,
status: String,
},
Token {
id: String,
content: String,
},
Done {
id: String,
content: String,
usage: Usage,
stop_reason: StopReason,
backend: String,
},
Error {
id: String,
code: ErrorCode,
message: String,
},
}Expand description
Re-exports from inferd-proto so consumers don’t need a separate
inferd-proto dep for the wire types. The proto crate IS the
version-pin contract for protocol compatibility — inferd-client 0.2 always uses inferd-proto 0.2.
One frame on the response NDJSON stream.
Variant fields map directly to the wire shape documented in
docs/protocol-v1.md §“Response stream”.
Variants§
Status
Lifecycle transition not tied to token output. id is "admin" for
status broadcast on the admin socket; otherwise the request id.
Fields
Token
One incremental generated token.
Done
Terminal frame for a successful generation.
Fields
§
stop_reason: StopReasonWhy generation stopped.
Error
Terminal frame for a failed generation.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Response, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Response, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Response
impl Serialize for Response
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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