pub struct NumericalFormat {
pub instruction: String,
pub tool: Tool,
pub usage: String,
pub bounds: Option<Bounds>,
/* private fields */
}Fields§
§instruction: String§tool: Tool§usage: StringHow to answer with tool, read after the instruction.
bounds: Option<Bounds>Implementations§
Source§impl NumericalFormat
impl NumericalFormat
pub fn new(instruction: &str, bounds: Option<Bounds>) -> Self
pub fn clone(&self) -> Self
pub fn answer(&mut self, response: f64)
pub async fn llm( &mut self, authorization: &CredentialsOrApiKey, model: Text, options: LlmOptions, ) -> Result<TextResponse>
pub fn get_response(&self) -> Option<f64>
pub fn to_json(&self) -> Value
Sourcepub fn to_vector(&self) -> Vec<f64>
pub fn to_vector(&self) -> Vec<f64>
Encode the scalar as a 2-dim unit vector [x, 1] / sqrt(x²+1). Direct
unit-norm on a 1-dim scalar would collapse to just the sign and discard
magnitude; the 2-dim wrap preserves magnitude as the vector’s angle so
two identical scalars yield identical unit vectors and different scalars
yield distinguishable directions.
pub fn compare(a: f64, b: f64) -> f64
pub fn distance(a: &NumericalFormat, b: &NumericalFormat) -> f64
pub fn tool() -> Tool
pub fn usage(bounds: Option<Bounds>) -> String
Auto Trait Implementations§
impl !RefUnwindSafe for NumericalFormat
impl !UnwindSafe for NumericalFormat
impl Forget for NumericalFormat
impl Freeze for NumericalFormatwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Schema>: Freeze,
*const LeafNode<String, Schema> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Schema)>>: Freeze,
PhantomData<String>: Freeze,
*const Schema is !null: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
*const ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>>: Freeze,
impl Move for NumericalFormat
impl Send for NumericalFormatwhere
RawVecInner: Send,
NodeRef<Owned, String, Schema, LeafOrInternal>: Send,
BoxRaw<(String, Schema)>: Send,
BoxRaw<Schema>: Send,
RawTable<usize>: Send,
Arc<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>: Send,
impl Sync for NumericalFormatwhere
RawVecInner: Sync,
NodeRef<Owned, String, Schema, LeafOrInternal>: Sync,
BoxRaw<(String, Schema)>: Sync,
BoxRaw<Schema>: Sync,
RawTable<usize>: Sync,
Arc<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>: Sync,
impl Unpin for NumericalFormat
impl UnsafeUnpin for NumericalFormatwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Schema>: UnsafeUnpin,
*const LeafNode<String, Schema> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Schema)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const Schema is !null: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>>: UnsafeUnpin,
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