pub struct ReasoningTotals {
pub records: usize,
pub consultations_completed: usize,
pub consultations_failed: usize,
pub independent_reviewers: usize,
pub input_tokens: u64,
pub output_tokens: u64,
}Expand description
Totals over the records of the derived task: counts, reviewers and reported tokens.
Independent reviewers are distinct advisors with at least one completed consultation; token counts are summed only from what adapters reported, never estimated.
use majordomus_cli::reasoning::state::{derive, ReasoningTotals};
use majordomus_cli::reasoning::store::Loaded;
let answer = |plan: &str| {
json!({
"kind": "consultation", "plan": plan, "advisor": "alpha", "status": "completed",
"conclusion": "A", "stance": "supports",
"usage": { "input_tokens": 100, "output_tokens": 20 },
})
};
let mut loaded = Loaded::default();
loaded.records.push(rec("consultation-1", 1, answer("plan-a")));
loaded.records.push(rec("consultation-2", 2, answer("plan-b")));
let totals: ReasoningTotals = derive(&loaded, None).totals;
assert_eq!(totals.consultations_completed, 2);
assert_eq!(totals.independent_reviewers, 1, "one advisor, however often asked");
assert_eq!((totals.input_tokens, totals.output_tokens), (200, 40));Fields§
§records: usizeRecords.
consultations_completed: usizeConsultations that completed.
consultations_failed: usizeConsultations that did not.
independent_reviewers: usizeDistinct advisors that answered.
input_tokens: u64Input tokens the adapters reported.
output_tokens: u64Output tokens the adapters reported.
Trait Implementations§
Source§impl Clone for ReasoningTotals
impl Clone for ReasoningTotals
Source§fn clone(&self) -> ReasoningTotals
fn clone(&self) -> ReasoningTotals
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReasoningTotals
impl Debug for ReasoningTotals
Source§impl Default for ReasoningTotals
impl Default for ReasoningTotals
Source§fn default() -> ReasoningTotals
fn default() -> ReasoningTotals
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ReasoningTotals
impl<'de> Deserialize<'de> for ReasoningTotals
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 JsonSchema for ReasoningTotals
impl JsonSchema for ReasoningTotals
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ReasoningTotals
impl RefUnwindSafe for ReasoningTotals
impl Send for ReasoningTotals
impl Sync for ReasoningTotals
impl Unpin for ReasoningTotals
impl UnsafeUnpin for ReasoningTotals
impl UnwindSafe for ReasoningTotals
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