Skip to main content

LLMRequestWithTools

Struct LLMRequestWithTools 

Source
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>

Source

pub const fn request(&self) -> &LLMRequest

Returns the inner request.

Source

pub const fn tools(&mut self) -> &mut Tools

Returns the tool registry.

Source

pub fn into_parts(self) -> (LLMRequest, &'tools mut Tools)

Breaks into components.

Source

pub async fn call_tool( &mut self, name: &str, args_json: &str, ) -> Result<ToolResult>

Invokes a registered tool by name.

§Errors

Returns an error if tool is not found or the tool call fails.

Trait Implementations§

Source§

impl<'tools> Debug for LLMRequestWithTools<'tools>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.