pub struct AgentExecutor { /* private fields */ }Expand description
An Executor that runs an SupportsAgentRun over the incoming conversation and
appends the agent’s reply. Rust analogue of AgentExecutor.
Implementations§
Source§impl AgentExecutor
impl AgentExecutor
Sourcepub fn new(
id: impl Into<String>,
agent: Arc<dyn SupportsAgentRun>,
) -> AgentExecutor
pub fn new( id: impl Into<String>, agent: Arc<dyn SupportsAgentRun>, ) -> AgentExecutor
Wrap agent as an executor with the given id.
Sourcepub fn with_output(self, emit_output: bool) -> AgentExecutor
pub fn with_output(self, emit_output: bool) -> AgentExecutor
When set, the executor yields the running conversation as a workflow
output. Unless Self::with_also_send is also set, this replaces
forwarding the conversation downstream (the pre-designation default:
a pipeline’s terminal executor only yields, it has nothing downstream
to send to).
Sourcepub fn with_also_send(self, also_send: bool) -> AgentExecutor
pub fn with_also_send(self, also_send: bool) -> AgentExecutor
When set, the executor forwards the conversation downstream via
WorkflowContext::send_message even if Self::with_output is
also set (rather than the exclusive-or default). Needed whenever an
interior (non-terminal) participant is designated as an output or
intermediate-output source and must still hand the conversation to
the next stage / the fan-in barrier.