pub enum EmbedResponse {
Embeddings {
id: String,
embeddings: Vec<Vec<f32>>,
dimensions: u32,
model: String,
usage: EmbedUsage,
backend: String,
},
Error {
id: String,
code: EmbedErrorCode,
message: String,
},
}Expand description
Re-exports of the embed wire types per ADR 0017. Embed lives on
the third inferd socket (separate from v1 and v2); the
proto types are re-exported here so consumers don’t need a separate
inferd-proto dep.
One frame on the embed response stream.
Always terminal — there are exactly two outcomes, success
(Embeddings) or failure (Error). The connection stays open for
the next request.
Variants§
Embeddings
Successful embedding result.
Fields
§
embeddings: Vec<Vec<f32>>One vector per input string, in the same order as the
request’s input. Inner vectors all share the same
dimensions length.
§
usage: EmbedUsageToken-count usage.
Error
Failure terminal frame.
Implementations§
Trait Implementations§
Source§impl Clone for EmbedResponse
impl Clone for EmbedResponse
Source§fn clone(&self) -> EmbedResponse
fn clone(&self) -> EmbedResponse
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 Debug for EmbedResponse
impl Debug for EmbedResponse
Source§impl<'de> Deserialize<'de> for EmbedResponse
impl<'de> Deserialize<'de> for EmbedResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EmbedResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EmbedResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EmbedResponse
impl PartialEq for EmbedResponse
Source§fn eq(&self, other: &EmbedResponse) -> bool
fn eq(&self, other: &EmbedResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EmbedResponse
impl Serialize for EmbedResponse
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 EmbedResponse
Auto Trait Implementations§
impl Freeze for EmbedResponse
impl RefUnwindSafe for EmbedResponse
impl Send for EmbedResponse
impl Sync for EmbedResponse
impl Unpin for EmbedResponse
impl UnsafeUnpin for EmbedResponse
impl UnwindSafe for EmbedResponse
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