pub struct Episode {
pub id: EpisodeId,
pub learn_model: String,
pub task_id: Option<TaskId>,
pub group_id: Option<GroupId>,
pub context: EpisodeContext,
pub outcome: Outcome,
pub metadata: EpisodeMetadata,
}Expand description
Episode - 学習の基本単位(汎用実装)
Swarmの「経験」を表現する。LearnModel によって Record[] から構築され、 TrainingData 生成の元となる。
§Note
これは汎用の Episode 実装。学習対象ごとに最適化した Episode が必要な場合は、
EpisodeTrait を実装した新しい型を定義すること。
Fields§
§id: EpisodeId一意識別子
learn_model: Stringどの LearnModel で生成されたか(e.g., “ngram-5”, “worker_task”)
task_id: Option<TaskId>Task ID(どのタスクの Episode か)
group_id: Option<GroupId>Group ID(DPO 学習での比較グループ)
context: EpisodeContextコンテキスト(LLM呼び出し + アクション履歴)
outcome: Outcome結果(LearnModel が判定)
metadata: EpisodeMetadataメタデータ
Implementations§
Source§impl Episode
impl Episode
Sourcepub fn builder() -> EpisodeBuilder
pub fn builder() -> EpisodeBuilder
Builder を取得
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
成功したかどうか
Sourcepub fn get_task_id(&self) -> Option<TaskId>
pub fn get_task_id(&self) -> Option<TaskId>
Task ID を取得(context の最初の ActionRecord から、または直接設定された値)
Sourcepub fn get_group_id(&self) -> Option<GroupId>
pub fn get_group_id(&self) -> Option<GroupId>
Group ID を取得(context の最初の ActionRecord から、または直接設定された値)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Episode
impl<'de> Deserialize<'de> for Episode
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 EpisodeTrait for Episode
impl EpisodeTrait for Episode
Source§fn learn_model_name(&self) -> &str
fn learn_model_name(&self) -> &str
対応する LearnModel 名
Source§fn scenario_name(&self) -> Option<&str>
fn scenario_name(&self) -> Option<&str>
シナリオ名(あれば)
Source§fn is_success(&self) -> bool
fn is_success(&self) -> bool
成功したかどうか
Source§impl From<&Episode> for EpisodeMeta
impl From<&Episode> for EpisodeMeta
Auto Trait Implementations§
impl Freeze for Episode
impl RefUnwindSafe for Episode
impl Send for Episode
impl Sync for Episode
impl Unpin for Episode
impl UnwindSafe for Episode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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