pub struct StatsBody {
pub worker_kind: Option<String>,
pub model: Option<String>,
pub usage: Option<TokenUsage>,
pub num_turns: Option<u32>,
pub adapter_data: Option<Value>,
}Expand description
Request body for POST /v1/worker/stats — a worker’s self-reported
per-attempt stats (per-step run stats, operator axis). Every field
optional; an all-empty body is accepted and dropped.
Field-for-field the wire twin of mlua_swarm::store::trace::WorkerStats,
which is what the handler converts it into; the one difference is this
body’s worker_kind default of "operator". The property sets are
drift-locked by stats_body_schema_matches_worker_stats_property_set.
JsonSchema is derived because this body is hand-authored by worker
harness implementors, who read it from mse://api/http-endpoints.
Fields§
§worker_kind: Option<String>Worker kind label. Defaults to "operator" — this endpoint’s
primary caller is the WS-operator / SubAgent axis, whose spawn
path has no in-process fold site to attach stats at.
model: Option<String>The model that served the attempt, self-reported.
usage: Option<TokenUsage>Normalized token usage.
num_turns: Option<u32>Number of LLM turns the attempt ran.
adapter_data: Option<Value>Free-form worker-specific detail (size-capped on fold).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StatsBody
impl<'de> Deserialize<'de> for StatsBody
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>,
Source§impl JsonSchema for StatsBody
impl JsonSchema for StatsBody
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for StatsBody
impl RefUnwindSafe for StatsBody
impl Send for StatsBody
impl Sync for StatsBody
impl Unpin for StatsBody
impl UnsafeUnpin for StatsBody
impl UnwindSafe for StatsBody
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more