pub struct AgentWorkerBuilder { /* private fields */ }Expand description
Fluent builder for an agent-aware Temporal Worker.
Required calls: AgentWorkerBuilder::new → AgentWorkerBuilder::llm
→ AgentWorkerBuilder::build_worker. Tools and queue name are
optional.
Implementations§
Source§impl AgentWorkerBuilder
impl AgentWorkerBuilder
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Start a new builder bound to an already-connected Temporal Client.
Sourcepub fn llm(self, llm: Arc<dyn LLMProvider>) -> Self
pub fn llm(self, llm: Arc<dyn LLMProvider>) -> Self
Required. The LLM provider used by the llm_chat activity.
Sourcepub fn tool(self, tool: Arc<dyn ToolT>) -> Self
pub fn tool(self, tool: Arc<dyn ToolT>) -> Self
Register a tool. Call once per tool the agent should be allowed to use.
Sourcepub fn queue(self, queue: impl Into<String>) -> Self
pub fn queue(self, queue: impl Into<String>) -> Self
Override the default task queue name ("agents").
Sourcepub fn build_worker(self, runtime: &CoreRuntime) -> Result<Worker, AgentError>
pub fn build_worker(self, runtime: &CoreRuntime) -> Result<Worker, AgentError>
Construct the Temporal worker with AgentWorkflow + AgentActivities
registered.
Panics if Self::llm was not called.
Auto Trait Implementations§
impl Freeze for AgentWorkerBuilder
impl !RefUnwindSafe for AgentWorkerBuilder
impl Send for AgentWorkerBuilder
impl Sync for AgentWorkerBuilder
impl Unpin for AgentWorkerBuilder
impl UnsafeUnpin for AgentWorkerBuilder
impl !UnwindSafe for AgentWorkerBuilder
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage