Replies: 1 comment
|
When bypass_multi_tools_limit=True is enabled, the underlying implementation switches over to DiscoveryEngineSearchTool, which doesn't expose the same _build_vertex_ai_search_config hook. To achieve a dynamic, state-based filter with DiscoveryEngineSearchTool, you can subclass it and override its configuration builder method (or customize how it handles the search request parameters at runtime using the ReadonlyContext). Here is an example approach you can use: Python class DynamicDiscoveryEngineSearchTool(DiscoveryEngineSearchTool): Alternatively, if your version of the tool builds the search request dynamically per tool execution, you can also wrap the tool call to inject the context state right before execution. Hope this helps point you in the right direction! |
Uh oh!
There was an error while loading. Please reload this page.
I need to be able to create a dynamic filter for my VertexAiSearchTool.
The docs for VertexAiSearchTool show how to do this:
However, when using bypass_multi_tools_limit=True the VertexAiSearchTool class gets swapped out at runtime for DiscoveryEngineSearchTool, which doesn't support the _build_vertex_ai_search_config override.
How can I use a state/user specific filter together with VertexAiSearchTool and bypass_multi_tools_limit=True?
All reactions