pub struct MainAgentLoopParams {
pub config: AgentLoopConfig,
pub shared: AgentLoopSharedState,
pub messages: Vec<ChatMessage>,
pub system_prompt_fn: Arc<dyn Fn() -> Option<String> + Send + Sync>,
pub tx: Sender<StreamMsg>,
pub tool_result_rx: Receiver<ToolResultMsg>,
}Expand description
run_main_agent_loop 的参数集合(将 6 个独立参数封装为单一结构体)
Fields§
§config: AgentLoopConfigAgent loop 的静态配置
Agent loop 的共享状态(Arc 引用,跨线程共享)
messages: Vec<ChatMessage>初始消息列表
system_prompt_fn: Arc<dyn Fn() -> Option<String> + Send + Sync>动态 system prompt 构建函数
tx: Sender<StreamMsg>流式消息发送通道
tool_result_rx: Receiver<ToolResultMsg>工具执行结果接收通道
Auto Trait Implementations§
impl !Freeze for MainAgentLoopParams
impl !RefUnwindSafe for MainAgentLoopParams
impl Send for MainAgentLoopParams
impl !Sync for MainAgentLoopParams
impl Unpin for MainAgentLoopParams
impl UnsafeUnpin for MainAgentLoopParams
impl !UnwindSafe for MainAgentLoopParams
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.