pub struct GeminiFileSearchTool { /* private fields */ }Available on crate feature
tools only.Expand description
Gemini built-in file search tool.
Implementations§
Source§impl GeminiFileSearchTool
impl GeminiFileSearchTool
Sourcepub fn new(
file_search_store_names: impl IntoIterator<Item = impl Into<String>>,
) -> GeminiFileSearchTool
pub fn new( file_search_store_names: impl IntoIterator<Item = impl Into<String>>, ) -> GeminiFileSearchTool
Create a new GeminiFileSearchTool with the given store names.
Trait Implementations§
Source§impl BypassMultiToolsLimit for GeminiFileSearchTool
Bypass support: convert the built-in Gemini File Search tool into a
function-calling tool so it can be used alongside custom function tools
under the Gemini Interactions API.
impl BypassMultiToolsLimit for GeminiFileSearchTool
Bypass support: convert the built-in Gemini File Search tool into a function-calling tool so it can be used alongside custom function tools under the Gemini Interactions API.
The converted tool declares a query: string function schema and performs
the document search by delegating to an internal single-turn agent (an
LlmAgent configured with GeminiFileSearchTool and a Gemini model).
§Example
ⓘ
use adk_tool::{BypassMultiToolsLimit, GeminiFileSearchTool};
use std::sync::Arc;
// `file_search_agent` is an LlmAgent with GeminiFileSearchTool + a Gemini model.
let tool = GeminiFileSearchTool::new(["my-store"])
.with_bypass_multi_tools_limit(Arc::new(file_search_agent));
assert!(!tool.is_builtin());Source§fn bypass_name(&self) -> String
fn bypass_name(&self) -> String
The function-tool name surfaced to the model after bypass conversion. Read more
Source§fn bypass_description(&self) -> String
fn bypass_description(&self) -> String
The function-tool description surfaced to the model.
Source§fn bypass_parameters_schema(&self) -> Value
fn bypass_parameters_schema(&self) -> Value
The JSON Schema for the bypass function’s parameters.
Source§fn bypass_query_field(&self) -> String
fn bypass_query_field(&self) -> String
The argument field that carries the natural-language query forwarded to
the internal agent (e.g.
"query" for search, "url" for URL context).Source§fn with_bypass_multi_tools_limit(self, agent: Arc<dyn Agent>) -> Arc<dyn Tool> ⓘ
fn with_bypass_multi_tools_limit(self, agent: Arc<dyn Agent>) -> Arc<dyn Tool> ⓘ
Convert this built-in tool into a function-calling
BypassBuiltinTool
so it can coexist with custom function tools under the Interactions API. Read moreSource§impl Clone for GeminiFileSearchTool
impl Clone for GeminiFileSearchTool
Source§fn clone(&self) -> GeminiFileSearchTool
fn clone(&self) -> GeminiFileSearchTool
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeminiFileSearchTool
impl Debug for GeminiFileSearchTool
Source§impl Tool for GeminiFileSearchTool
impl Tool for GeminiFileSearchTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a human-readable description of what this tool does.
Source§fn is_builtin(&self) -> bool
fn is_builtin(&self) -> bool
Indicates whether this tool is a built-in server-side tool (e.g.,
google_search, url_context). Read moreSource§fn declaration(&self) -> Value
fn declaration(&self) -> Value
Returns the tool declaration that should be exposed to model providers. Read more
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
_ctx: Arc<dyn ToolContext>,
_args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
GeminiFileSearchTool: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
_ctx: Arc<dyn ToolContext>,
_args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
GeminiFileSearchTool: 'async_trait,
Executes the tool with the given context and arguments.
Source§fn enhanced_description(&self) -> String
fn enhanced_description(&self) -> String
Returns an enhanced description that may include additional notes.
For long-running tools, this includes a warning not to call the tool
again if it has already returned a pending status.
Default implementation returns the base description.
Source§fn is_long_running(&self) -> bool
fn is_long_running(&self) -> bool
Indicates whether the tool is a long-running operation.
Long-running tools typically return a task ID immediately and
complete the operation asynchronously.
Source§fn parameters_schema(&self) -> Option<Value>
fn parameters_schema(&self) -> Option<Value>
Returns the JSON Schema for this tool’s parameters, if any.
Source§fn response_schema(&self) -> Option<Value>
fn response_schema(&self) -> Option<Value>
Returns the JSON Schema for this tool’s response, if any.
Source§fn required_scopes(&self) -> &[&str]
fn required_scopes(&self) -> &[&str]
Returns the scopes required to execute this tool. Read more
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Indicates whether this tool performs no side effects.
Read-only tools may be executed concurrently in Auto mode.
Source§fn is_concurrency_safe(&self) -> bool
fn is_concurrency_safe(&self) -> bool
Indicates whether this tool is safe for concurrent execution.
Used by the Parallel strategy to validate dispatch safety.
Auto Trait Implementations§
impl Freeze for GeminiFileSearchTool
impl RefUnwindSafe for GeminiFileSearchTool
impl Send for GeminiFileSearchTool
impl Sync for GeminiFileSearchTool
impl Unpin for GeminiFileSearchTool
impl UnsafeUnpin for GeminiFileSearchTool
impl UnwindSafe for GeminiFileSearchTool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ScopeToolExt for Twhere
T: Tool,
impl<T> ScopeToolExt for Twhere
T: Tool,
Source§fn with_scope_guard(
self,
resolver: impl ScopeResolver + 'static,
) -> ScopedTool<Self>
fn with_scope_guard( self, resolver: impl ScopeResolver + 'static, ) -> ScopedTool<Self>
Wrap this tool with scope enforcement using the given resolver.
Source§impl<T> ToolExt for Twhere
T: Tool,
impl<T> ToolExt for Twhere
T: Tool,
Source§fn with_access_control(self, ac: Arc<AccessControl>) -> ProtectedTool<Self>
fn with_access_control(self, ac: Arc<AccessControl>) -> ProtectedTool<Self>
Wrap this tool with access control.
Source§fn with_access_control_and_audit(
self,
ac: Arc<AccessControl>,
audit: Arc<dyn AuditSink>,
) -> ProtectedTool<Self>
fn with_access_control_and_audit( self, ac: Arc<AccessControl>, audit: Arc<dyn AuditSink>, ) -> ProtectedTool<Self>
Wrap this tool with access control and audit logging.