pub struct HttpRequestTool { /* private fields */ }Expand description
Tool for making HTTP requests
Implementations§
Source§impl HttpRequestTool
impl HttpRequestTool
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new HTTP request tool.
Prefer Self::new_with_config when running inside the Bamboo server so
the request client can honor proxy settings from the hot-reloadable config.
Sourcepub fn new_with_config(config: Arc<RwLock<Config>>) -> Self
pub fn new_with_config(config: Arc<RwLock<Config>>) -> Self
Create a new HTTP request tool backed by the shared, hot-reloadable config.
Sourcepub async fn execute_request(
&self,
args: HttpRequestArgs,
) -> Result<HttpResponse, String>
pub async fn execute_request( &self, args: HttpRequestArgs, ) -> Result<HttpResponse, String>
Execute an HTTP request
Trait Implementations§
Source§impl Default for HttpRequestTool
impl Default for HttpRequestTool
Source§impl Tool for HttpRequestTool
impl Tool for HttpRequestTool
fn name(&self) -> &str
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description for LLM.
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON Schema for tool parameters.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with given arguments.
Source§fn execute_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
_ctx: ToolExecutionContext<'life1>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
_ctx: ToolExecutionContext<'life1>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with a streaming-capable context. Read more
Source§fn to_schema(&self) -> ToolSchema
fn to_schema(&self) -> ToolSchema
Convert tool to LLM-compatible schema. Read more
Auto Trait Implementations§
impl Freeze for HttpRequestTool
impl !RefUnwindSafe for HttpRequestTool
impl Send for HttpRequestTool
impl Sync for HttpRequestTool
impl Unpin for HttpRequestTool
impl UnsafeUnpin for HttpRequestTool
impl !UnwindSafe for HttpRequestTool
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