pub struct LearnedDependencyProvider { /* private fields */ }Expand description
学習済みアクション順序から DependencyGraph を生成する Provider
OfflineModel.action_order を使用して、LLM を呼ばずに即座にグラフを構築する。
アクション集合が一致しない場合は None を返し、LLM フォールバックさせる。
§Example
ⓘ
use swarm_engine_core::learn::offline::LearnedActionOrder;
use swarm_engine_core::exploration::LearnedDependencyProvider;
let order = LearnedActionOrder::new(
vec!["Grep".to_string(), "Read".to_string()], // discover
vec!["Restart".to_string()], // not_discover
&["Grep", "Read", "Restart"].map(String::from).to_vec(),
);
let provider = LearnedDependencyProvider::new(order);
let graph = provider.provide_graph("task", &actions);Implementations§
Source§impl LearnedDependencyProvider
impl LearnedDependencyProvider
Sourcepub fn new(action_order: LearnedActionOrder) -> Self
pub fn new(action_order: LearnedActionOrder) -> Self
新しい LearnedDependencyProvider を作成
Sourcepub fn action_order(&self) -> &LearnedActionOrder
pub fn action_order(&self) -> &LearnedActionOrder
学習済み順序を取得
Trait Implementations§
Source§impl Clone for LearnedDependencyProvider
impl Clone for LearnedDependencyProvider
Source§fn clone(&self) -> LearnedDependencyProvider
fn clone(&self) -> LearnedDependencyProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LearnedDependencyProvider
impl Debug for LearnedDependencyProvider
Source§impl DependencyGraphProvider for LearnedDependencyProvider
impl DependencyGraphProvider for LearnedDependencyProvider
Source§fn provide_graph(
&self,
task: &str,
available_actions: &[String],
) -> Option<DependencyGraph>
fn provide_graph( &self, task: &str, available_actions: &[String], ) -> Option<DependencyGraph>
タスクとアクション一覧から DependencyGraph を生成 Read more
Auto Trait Implementations§
impl Freeze for LearnedDependencyProvider
impl RefUnwindSafe for LearnedDependencyProvider
impl Send for LearnedDependencyProvider
impl Sync for LearnedDependencyProvider
impl Unpin for LearnedDependencyProvider
impl UnwindSafe for LearnedDependencyProvider
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