pub struct Subagent<F: ToolFactory, N: SubagentNotifier> {
system_prompt: String,
llama_url: String,
model_name: String,
tool_factory: F,
notifier: N,
concurrency: Option<Arc<Semaphore>>,
}Expand description
Delegate tasks to subagents.
Fields§
§system_prompt: StringSystem prompt pushed into every subagent conversation.
llama_url: Stringllama-server base URL (e.g. “http://127.0.0.1:8080”).
model_name: StringModel name to use (from the parent’s ClientState).
tool_factory: FFactory producing the tool set for each subagent.
notifier: NNotify e.g. a UI of changes in subagents
concurrency: Option<Arc<Semaphore>>Limits the number of subagents that may run in parallel; None means unlimited.
Implementations§
Trait Implementations§
Source§impl<F: ToolFactory, N: SubagentNotifier> CallableTool for Subagent<F, N>
impl<F: ToolFactory, N: SubagentNotifier> CallableTool for Subagent<F, N>
Source§async fn execute(
&self,
parent: &Agent,
params: SubagentParams,
) -> Result<SubagentResult>
async fn execute( &self, parent: &Agent, params: SubagentParams, ) -> Result<SubagentResult>
Execute a tool call.
Source§impl<F: Debug + ToolFactory, N: Debug + SubagentNotifier> Debug for Subagent<F, N>
impl<F: Debug + ToolFactory, N: Debug + SubagentNotifier> Debug for Subagent<F, N>
Source§impl<F: ToolFactory, N: SubagentNotifier> Tool for Subagent<F, N>
impl<F: ToolFactory, N: SubagentNotifier> Tool for Subagent<F, N>
Source§fn description(&self) -> Option<String>
fn description(&self) -> Option<String>
Tool description, if any
Source§fn execute_unparsed<'a>(
&'a self,
agent: &'a Agent,
arguments: &'a str,
) -> Pin<Box<dyn Future<Output = Result<String>> + 'a>>
fn execute_unparsed<'a>( &'a self, agent: &'a Agent, arguments: &'a str, ) -> Pin<Box<dyn Future<Output = Result<String>> + 'a>>
Execute this tool, arguments given in JSON format (unparsed)
Source§impl<F: ToolFactory, N: SubagentNotifier> ToolState for Subagent<F, N>
impl<F: ToolFactory, N: SubagentNotifier> ToolState for Subagent<F, N>
Source§type ParamType = SubagentParams
type ParamType = SubagentParams
Associated parameter type.
Source§type ResultType = SubagentResult
type ResultType = SubagentResult
Associated return type.
Auto Trait Implementations§
impl<F, N> Freeze for Subagent<F, N>
impl<F, N> RefUnwindSafe for Subagent<F, N>where
F: RefUnwindSafe,
N: RefUnwindSafe,
impl<F, N> Send for Subagent<F, N>
impl<F, N> Sync for Subagent<F, N>where
N: Sync,
impl<F, N> Unpin for Subagent<F, N>
impl<F, N> UnsafeUnpin for Subagent<F, N>where
F: UnsafeUnpin,
N: UnsafeUnpin,
impl<F, N> UnwindSafe for Subagent<F, N>where
F: UnwindSafe,
N: UnwindSafe,
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