pub struct UtteranceFormat {
pub instruction: String,
pub tool: Tool,
pub time: Option<f64>,
pub embedding: Option<Vec<f64>>,
/* private fields */
}Fields§
§instruction: String§tool: Tool§time: Option<f64>§embedding: Option<Vec<f64>>Implementations§
Source§impl UtteranceFormat
impl UtteranceFormat
pub fn new(instruction: &str, time: Option<f64>) -> Self
pub fn clone(&self) -> Self
pub fn answer(&mut self, response: String)
pub async fn llm( &mut self, authorization: &CredentialsOrApiKey, model: Text, options: LlmOptions, ) -> Result<TextResponse>
pub fn get_response(&self) -> Option<String>
pub fn to_json(&self) -> Value
Sourcepub fn to_vector(&self) -> Vec<f64>
pub fn to_vector(&self) -> Vec<f64>
Returns the unit-normalized embedding. The caller MUST have populated
embedding first (via embed() or the research agent’s extraction
pipeline), otherwise this returns an empty vector and the field is
excluded from the rank check. Embedding-less utterances cannot
participate in dedup.
pub async fn embed( &mut self, authorization: &CredentialsOrApiKey, model: Embedding, ) -> Result<()>
pub fn distance(a: &UtteranceFormat, b: &UtteranceFormat) -> Result<f64>
pub fn tool(time: Option<f64>) -> Tool
Auto Trait Implementations§
impl !RefUnwindSafe for UtteranceFormat
impl !UnwindSafe for UtteranceFormat
impl Forget for UtteranceFormat
impl Freeze for UtteranceFormat
impl Send for UtteranceFormat
impl Sync for UtteranceFormat
impl Unpin for UtteranceFormat
impl UnsafeUnpin for UtteranceFormat
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