pub struct LLMRequestWithTools<'tools> { /* private fields */ }Expand description
Legacy request builder that supports mutable tool registry.
This is provided for backwards compatibility with providers that handle tool execution internally (built-in tools).
Implementations§
Source§impl<'tools> LLMRequestWithTools<'tools>
impl<'tools> LLMRequestWithTools<'tools>
Sourcepub const fn request(&self) -> &LLMRequest
pub const fn request(&self) -> &LLMRequest
Returns the inner request.
Sourcepub fn into_parts(self) -> (LLMRequest, &'tools mut Tools)
pub fn into_parts(self) -> (LLMRequest, &'tools mut Tools)
Breaks into components.
Sourcepub async fn call_tool(
&mut self,
name: &str,
args_json: &str,
cx: ToolContext,
) -> Result<ToolResult>
pub async fn call_tool( &mut self, name: &str, args_json: &str, cx: ToolContext, ) -> Result<ToolResult>
Invokes a registered tool by name, running it with cx as its
ToolContext.
§Errors
Returns an error if tool is not found or the tool call fails.
Trait Implementations§
Auto Trait Implementations§
impl<'tools> !RefUnwindSafe for LLMRequestWithTools<'tools>
impl<'tools> !UnwindSafe for LLMRequestWithTools<'tools>
impl<'tools> Freeze for LLMRequestWithTools<'tools>
impl<'tools> Send for LLMRequestWithTools<'tools>
impl<'tools> Sync for LLMRequestWithTools<'tools>
impl<'tools> Unpin for LLMRequestWithTools<'tools>
impl<'tools> UnsafeUnpin for LLMRequestWithTools<'tools>
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