pub struct ActionDef {
pub name: String,
pub description: String,
pub category: ActionCategory,
pub groups: Vec<String>,
pub params: Vec<ParamDef>,
pub example: Option<String>,
pub param_variants: Option<ParamVariants>,
}Expand description
Action 定義
Fields§
§name: StringAction 名
description: String説明(LLM プロンプト用)
category: ActionCategoryカテゴリ(探索空間への影響)
groups: Vec<String>所属 Group
params: Vec<ParamDef>パラメータ定義
example: Option<String>出力例(LLM プロンプト用 JSON 形式)
param_variants: Option<ParamVariants>パラメータバリアント(ExplorationSpace で自動展開)
例: Move アクションで direction に対して [“north”, “south”, “east”, “west”] を指定すると、 ExplorationSpace が後続ノード展開時に 4 つのバリアントを生成する。
param_key: パラメータ名(例: “target”, “direction”)variants: 取り得る値のリスト
Implementations§
Source§impl ActionDef
impl ActionDef
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Sourcepub fn param_variants(
self,
key: impl Into<String>,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn param_variants( self, key: impl Into<String>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Sourcepub fn category(self, category: ActionCategory) -> Self
pub fn category(self, category: ActionCategory) -> Self
カテゴリを設定
Sourcepub fn node_expand(self) -> Self
pub fn node_expand(self) -> Self
NodeExpand カテゴリに設定(新しい探索対象を発見する Action)
Sourcepub fn node_state_change(self) -> Self
pub fn node_state_change(self) -> Self
NodeStateChange カテゴリに設定(既存 Node の状態を遷移させる Action)
Sourcepub fn required_param(
self,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn required_param( self, name: impl Into<String>, description: impl Into<String>, ) -> Self
必須パラメータを追加
Sourcepub fn optional_param(
self,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn optional_param( self, name: impl Into<String>, description: impl Into<String>, ) -> Self
オプションパラメータを追加
Sourcepub fn has_any_group(&self, groups: &[&str]) -> bool
pub fn has_any_group(&self, groups: &[&str]) -> bool
指定した Group のいずれかに所属しているか
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ActionDef
impl RefUnwindSafe for ActionDef
impl Send for ActionDef
impl Sync for ActionDef
impl Unpin for ActionDef
impl UnwindSafe for ActionDef
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