pub struct LlmResponse {
pub id: Option<String>,
pub model: Option<String>,
pub outputs: Vec<ResponseOutput>,
pub usage: Usage,
pub extensions: ProviderExtensions,
pub preservation: PreservationMetadata,
}Expand description
Normalized response representation shared by Switchyard components.
Fields§
§id: Option<String>§model: Option<String>§outputs: Vec<ResponseOutput>§usage: Usage§extensions: ProviderExtensions§preservation: PreservationMetadataImplementations§
Source§impl LlmResponse
impl LlmResponse
Sourcepub fn first_output(&self) -> Option<&ResponseOutput>
pub fn first_output(&self) -> Option<&ResponseOutput>
Returns the first output item when a response has any output.
Trait Implementations§
Source§impl Clone for LlmResponse
impl Clone for LlmResponse
Source§fn clone(&self) -> LlmResponse
fn clone(&self) -> LlmResponse
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 LlmResponse
impl Debug for LlmResponse
Source§impl Default for LlmResponse
impl Default for LlmResponse
Source§fn default() -> LlmResponse
fn default() -> LlmResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LlmResponse
impl<'de> Deserialize<'de> for LlmResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LlmResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LlmResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LlmResponse
impl PartialEq for LlmResponse
Source§impl Serialize for LlmResponse
impl Serialize for LlmResponse
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 LlmResponse
Auto Trait Implementations§
impl Freeze for LlmResponse
impl RefUnwindSafe for LlmResponse
impl Send for LlmResponse
impl Sync for LlmResponse
impl Unpin for LlmResponse
impl UnsafeUnpin for LlmResponse
impl UnwindSafe for LlmResponse
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