pub struct HttpAgentProvider<A: HttpAgentAdapter> { /* private fields */ }Expand description
Generic HTTP provider that wraps any HttpAgentAdapter.
Implements AgentProvider by delegating request construction and response
parsing to the adapter while handling the HTTP transport, timeout, and
agentic execution loop.
When a ToolRegistry is attached via with_tools,
the provider runs a multi-turn agentic loop: executing tool calls locally
and feeding results back to the model until it produces a final response
(or hits max_turns / max_budget_usd limits).
Without a registry, the provider behaves as single-turn (backward-compatible).
Implementations§
Source§impl<A: HttpAgentAdapter> HttpAgentProvider<A>
impl<A: HttpAgentAdapter> HttpAgentProvider<A>
Sourcepub fn with_tools(self, registry: ToolRegistry) -> Self
pub fn with_tools(self, registry: ToolRegistry) -> Self
Attach a tool registry to enable multi-turn agentic execution.
When tools are registered, the provider will:
- Include the tools in every request (OpenAI
toolsformat). - Execute tool calls returned by the model.
- Loop until the model produces a final response or limits are hit.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Override the request timeout.
Trait Implementations§
Source§impl<A: HttpAgentAdapter> AgentProvider for HttpAgentProvider<A>
impl<A: HttpAgentAdapter> AgentProvider for HttpAgentProvider<A>
Source§fn invoke<'a>(&'a self, config: &'a AgentConfig) -> InvokeFuture<'a>
fn invoke<'a>(&'a self, config: &'a AgentConfig) -> InvokeFuture<'a>
Execute a single agent invocation with the given configuration. Read more
Source§fn invoke_with_logs<'a>(
&'a self,
config: &'a AgentConfig,
log_sink: Arc<dyn LogSink>,
) -> InvokeFuture<'a>
fn invoke_with_logs<'a>( &'a self, config: &'a AgentConfig, log_sink: Arc<dyn LogSink>, ) -> InvokeFuture<'a>
Execute an agent invocation with real-time log streaming. Read more
Auto Trait Implementations§
impl<A> Freeze for HttpAgentProvider<A>where
A: Freeze,
impl<A> !RefUnwindSafe for HttpAgentProvider<A>
impl<A> Send for HttpAgentProvider<A>
impl<A> Sync for HttpAgentProvider<A>
impl<A> Unpin for HttpAgentProvider<A>where
A: Unpin,
impl<A> UnsafeUnpin for HttpAgentProvider<A>where
A: UnsafeUnpin,
impl<A> !UnwindSafe for HttpAgentProvider<A>
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