Skip to main content

JudgmentModel

Trait JudgmentModel 

Source
pub trait JudgmentModel: Send + Sync {
    // Required method
    fn decide<'life0, 'async_trait>(
        &'life0 self,
        state: Value,
        questions: BTreeMap<String, Question>,
    ) -> Pin<Box<dyn Future<Output = Result<Decisions, JudgmentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn endpoint_host(&self) -> Option<String> { ... }
    fn model_id(&self) -> Option<String> { ... }
}
Expand description

A calibrated-judgment model: one batched call answering runtime-defined questions about one shared state.

Required Methods§

Source

fn decide<'life0, 'async_trait>( &'life0 self, state: Value, questions: BTreeMap<String, Question>, ) -> Pin<Box<dyn Future<Output = Result<Decisions, JudgmentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ask every question in questions about state in a single call.

Provided Methods§

Source

fn endpoint_host(&self) -> Option<String>

Host of the endpoint this model calls, for the review report. None when unknown (fakes) or unparseable.

Source

fn model_id(&self) -> Option<String>

The model id this judge is configured to ask, for audit records when the provider never reported one. None when unknown (fakes).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§