#[non_exhaustive]pub enum Signal<State, Action = String, Outcome = String> {
PreAct {
state: State,
},
PostAct {
experience: Experience<State, Action, Outcome>,
},
EpisodeFinish {
episode_id: String,
experiences: Vec<Experience<State, Action, Outcome>>,
},
Intervention {
state: State,
action: Action,
reason: String,
},
Feedback {
experience: Experience<State, Action, Outcome>,
score: f64,
},
}Expand description
The only five lifecycle signals accepted by a v1 runtime boundary.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PreAct
Read memory and ask the bridge to coordinate the next action.
Fields
§
state: StateCurrent state supplied by the host.
PostAct
Record an executed result and make it available to training.
Fields
§
experience: Experience<State, Action, Outcome>The completed state/action/outcome fact.
EpisodeFinish
Close an episode and trigger episode-level evaluation or learning.
Fields
§
experiences: Vec<Experience<State, Action, Outcome>>Experiences belonging to the completed episode.
Intervention
Apply an audited, boundary-checked human or rule intervention.
Fields
§
state: StateState at which the intervention was requested.
§
action: ActionAction or policy value affected by the intervention.
Feedback
Accept an external evaluation as a learning signal, not a self-evaluation.
Fields
§
experience: Experience<State, Action, Outcome>Experience being evaluated.
Trait Implementations§
Source§impl<'de, State, Action, Outcome> Deserialize<'de> for Signal<State, Action, Outcome>
impl<'de, State, Action, Outcome> Deserialize<'de> for Signal<State, Action, Outcome>
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<State: PartialEq, Action: PartialEq, Outcome: PartialEq> PartialEq for Signal<State, Action, Outcome>
impl<State: PartialEq, Action: PartialEq, Outcome: PartialEq> PartialEq for Signal<State, Action, Outcome>
impl<State: PartialEq, Action: PartialEq, Outcome: PartialEq> StructuralPartialEq for Signal<State, Action, Outcome>
Auto Trait Implementations§
impl<State, Action, Outcome> Forget for Signal<State, Action, Outcome>
impl<State, Action, Outcome> Freeze for Signal<State, Action, Outcome>where
State: Freeze,
Action: Freeze,
Outcome: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Experience<State, Action, Outcome>>: Freeze,
impl<State, Action, Outcome> Move for Signal<State, Action, Outcome>
impl<State, Action, Outcome> RefUnwindSafe for Signal<State, Action, Outcome>
impl<State, Action, Outcome> Send for Signal<State, Action, Outcome>
impl<State, Action, Outcome> Sync for Signal<State, Action, Outcome>
impl<State, Action, Outcome> Unpin for Signal<State, Action, Outcome>
impl<State, Action, Outcome> UnsafeUnpin for Signal<State, Action, Outcome>where
State: UnsafeUnpin,
Action: UnsafeUnpin,
Outcome: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Experience<State, Action, Outcome>>: UnsafeUnpin,
impl<State, Action, Outcome> UnwindSafe for Signal<State, Action, Outcome>
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