pub enum WorkResult {
Acted {
action_result: ActionResult,
state_delta: Option<WorkerStateDelta>,
},
Continuing {
progress: f32,
},
NeedsGuidance {
reason: String,
context: GuidanceContext,
},
Escalate {
reason: EscalationReason,
context: Option<String>,
},
Idle,
Done {
success: bool,
message: Option<String>,
},
}Expand description
Worker の実行結果
Variants§
Acted
自律的に行動した結果
Fields
§
action_result: ActionResultAction の実行結果
§
state_delta: Option<WorkerStateDelta>状態変更リクエスト(Runtime が Phase 6 でマージ)
Continuing
継続中(自分で判断して次Tickも続ける)
NeedsGuidance
ManagerAgent の判断を仰ぎたい
Escalate
Agent 自身が Escalation を要求(Manager への介入依頼)
Idle
待機中(やることがない、または他の Worker を待っている)
Done
タスク完了(Environment から done=true を受け取った)
Implementations§
Source§impl WorkResult
impl WorkResult
Sourcepub fn acted(action_result: ActionResult) -> Self
pub fn acted(action_result: ActionResult) -> Self
ActionResult から簡易的に Acted を生成(state_delta なし)
Sourcepub fn acted_with_delta(
action_result: ActionResult,
state_delta: WorkerStateDelta,
) -> Self
pub fn acted_with_delta( action_result: ActionResult, state_delta: WorkerStateDelta, ) -> Self
ActionResult と state_delta から Acted を生成
Sourcepub fn done_success(message: impl Into<String>) -> Self
pub fn done_success(message: impl Into<String>) -> Self
成功で完了
Sourcepub fn done_failure(message: impl Into<String>) -> Self
pub fn done_failure(message: impl Into<String>) -> Self
失敗で完了
Sourcepub fn env_success(message: impl Into<String>) -> Self
pub fn env_success(message: impl Into<String>) -> Self
Environment からの成功結果
Sourcepub fn env_success_with_data(
_message: impl Into<String>,
data: impl Into<String>,
) -> Self
pub fn env_success_with_data( _message: impl Into<String>, data: impl Into<String>, ) -> Self
Environment からの成功結果(データ付き)
Sourcepub fn env_success_structured(data: Value) -> Self
pub fn env_success_structured(data: Value) -> Self
Environment からの成功結果(構造化データ付き)
Sourcepub fn env_success_with_discoveries(
_message: impl Into<String>,
data: impl Into<String>,
discovered_targets: Vec<String>,
) -> Self
pub fn env_success_with_discoveries( _message: impl Into<String>, data: impl Into<String>, discovered_targets: Vec<String>, ) -> Self
Environment からの成功結果(発見したターゲット付き)
Search 系アクションで使用。discovered_targets は ExploMap で 新しいノードとして展開される。
Sourcepub fn env_failure(message: impl Into<String>) -> Self
pub fn env_failure(message: impl Into<String>) -> Self
Environment からの失敗結果
Sourcepub fn unsupported(action_name: &str) -> Self
pub fn unsupported(action_name: &str) -> Self
未サポートアクション
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkResult
impl RefUnwindSafe for WorkResult
impl Send for WorkResult
impl Sync for WorkResult
impl Unpin for WorkResult
impl UnwindSafe for WorkResult
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> 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