pub struct WebSearchTool { /* private fields */ }Expand description
Client executor for the stable web_search tool contract.
Implementations§
Source§impl WebSearchTool
impl WebSearchTool
Sourcepub fn new(
provider: Arc<dyn SearchProvider>,
configured_options: WebSearchOptions,
) -> Self
pub fn new( provider: Arc<dyn SearchProvider>, configured_options: WebSearchOptions, ) -> Self
Creates a client search executor with static product domain policy.
Sourcepub fn spec() -> Result<ToolSpec, ToolSpecError>
pub fn spec() -> Result<ToolSpec, ToolSpecError>
Builds the portable client/hosted search tool contract.
§Errors
Returns an error only if the static contract violates tool bounds.
Sourcepub fn resource(&self) -> Result<ToolResource, ToolResourceError>
pub fn resource(&self) -> Result<ToolResource, ToolResourceError>
Returns the fixed external destination declared to policy before execution.
§Errors
Returns an error when a custom provider exposes an invalid destination.
Trait Implementations§
Source§impl Clone for WebSearchTool
impl Clone for WebSearchTool
Source§impl Debug for WebSearchTool
impl Debug for WebSearchTool
Source§impl ToolExecutor for WebSearchTool
impl ToolExecutor for WebSearchTool
Source§fn execute(
&self,
invocation: ValidatedToolInvocation,
cancellation: CancellationScope,
) -> BoxToolExecutionStream
fn execute( &self, invocation: ValidatedToolInvocation, cancellation: CancellationScope, ) -> BoxToolExecutionStream
Creates a lazy execution stream owned by the caller.
Source§fn preview(
&self,
_invocation: &ValidatedToolInvocation,
) -> Option<ToolPresentation>
fn preview( &self, _invocation: &ValidatedToolInvocation, ) -> Option<ToolPresentation>
Produces an optional, non-durable preview for one validated invocation. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for WebSearchTool
impl !UnwindSafe for WebSearchTool
impl Freeze for WebSearchTool
impl Send for WebSearchTool
impl Sync for WebSearchTool
impl Unpin for WebSearchTool
impl UnsafeUnpin for WebSearchTool
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