pub struct ToolAgent { /* private fields */ }Expand description
Tool-calling build analysis agent.
Wraps an LLM client and a shared PoB parser. Each call to respond
runs a ReAct loop: the LLM decides which tools to call, the agent
executes them via the parser, and the results are fed back until
the LLM produces a final answer.
Implementations§
Source§impl ToolAgent
impl ToolAgent
pub fn new( llm: ChatGptClient, parser: Arc<PobParser>, trade: Option<TradeClient>, ) -> Self
Sourcepub fn respond(
&self,
build_xml: &[u8],
message: &str,
history: Vec<ChatMessage>,
) -> impl Stream<Item = Result<AgentEvent, LlmError>> + Send
pub fn respond( &self, build_xml: &[u8], message: &str, history: Vec<ChatMessage>, ) -> impl Stream<Item = Result<AgentEvent, LlmError>> + Send
Stream a response to a user question about the given build.
build_xml is the raw PoB XML export. The agent loads it into PoB
on each tool call so queries always reflect the full build.
Auto Trait Implementations§
impl Freeze for ToolAgent
impl !RefUnwindSafe for ToolAgent
impl Send for ToolAgent
impl Sync for ToolAgent
impl Unpin for ToolAgent
impl UnsafeUnpin for ToolAgent
impl !UnwindSafe for ToolAgent
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 more