pub enum Format {
Numerical(NumericalFormat),
Vector(VectorFormat),
Categorical(CategoricalFormat),
Selection(SelectionFormat),
Utterance(UtteranceFormat),
}Expand description
A question’s answer shape. from_json returns whichever kind the JSON names.
Variants§
Numerical(NumericalFormat)
Vector(VectorFormat)
Categorical(CategoricalFormat)
Selection(SelectionFormat)
Utterance(UtteranceFormat)
Implementations§
Source§impl Format
impl Format
pub fn instruction(&self) -> &str
pub fn tool(&self) -> &Tool
Sourcepub fn answer(&mut self, response: Value)
pub fn answer(&mut self, response: Value)
Sets the answer from its JSON; a value of the wrong shape clears it.
pub fn to_json(&self) -> Value
Sourcepub fn to_vector(&self) -> Vec<f64>
pub fn to_vector(&self) -> Vec<f64>
Returns a unit-length numerical representation of the format’s current response. Used by the research agent’s per-scope rank-dedup matrix to detect linearly-dependent rows (duplicates). Concatenated across an entity’s atomic fields, the resulting vector is the row’s identifier.
Contract: all implementations return a vector with L2 norm == 1 when a response is present. If the response is missing or empty, an implementation may return a zero-length array; callers MUST skip such fields when concatenating (they correspond to optional / unfilled fields and are excluded from the rank check).
pub async fn llm( &mut self, authorization: &CredentialsOrApiKey, model: Text, options: LlmOptions, ) -> Result<TextResponse>
pub fn get_response(&self) -> Option<Value>
pub fn optional(format: &Format) -> Format
pub fn calculate_distance(a: &Format, b: &Format) -> Result<f64>
pub fn from_json(json: &Value) -> Result<Format>
Auto Trait Implementations§
impl !RefUnwindSafe for Format
impl !UnwindSafe for Format
impl Forget for Format
impl Freeze for Format
impl Move for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
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