pub struct LLMResult {
pub generations: Vec<Vec<Generation>>,
pub llm_output: HashMap<String, Value>,
}
Expand description
A result containing multiple generations
Fields§
§generations: Vec<Vec<Generation>>
The generations
llm_output: HashMap<String, Value>
Result metadata
Implementations§
Source§impl LLMResult
impl LLMResult
Sourcepub fn new(generations: Vec<Vec<Generation>>) -> Self
pub fn new(generations: Vec<Vec<Generation>>) -> Self
Create a new LLM result
Sourcepub fn new_with_output(
generations: Vec<Vec<Generation>>,
llm_output: HashMap<String, Value>,
) -> Self
pub fn new_with_output( generations: Vec<Vec<Generation>>, llm_output: HashMap<String, Value>, ) -> Self
Create a new LLM result with metadata
Sourcepub fn first_text(&self) -> Option<&str>
pub fn first_text(&self) -> Option<&str>
Get the first generation text
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LLMResult
impl<'de> Deserialize<'de> for LLMResult
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
Source§impl Serializable for LLMResult
impl Serializable for LLMResult
Source§fn is_serializable() -> bool
fn is_serializable() -> bool
Check if this object is serializable Read more
Source§fn to_json_pretty(&self) -> Result<String>
fn to_json_pretty(&self) -> Result<String>
Serialize this object to a pretty-printed JSON string
Source§fn to_dict(&self) -> Result<HashMap<String, Value>>
fn to_dict(&self) -> Result<HashMap<String, Value>>
Serialize this object to a dictionary (HashMap)
impl StructuralPartialEq for LLMResult
Auto Trait Implementations§
impl Freeze for LLMResult
impl RefUnwindSafe for LLMResult
impl Send for LLMResult
impl Sync for LLMResult
impl Unpin for LLMResult
impl UnwindSafe for LLMResult
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