Find answers from the community

Home
Members
liamk-ultra
l
liamk-ultra
Offline, last seen 3 months ago
Joined September 25, 2024
When using the QueryEngineTool, is it possible to add additional parameters in addition to the query string (similar to how this is done with FunctionTool) so that ReAct agent calls it with separate parameters. For example, as a FunctionTool I have
def _search_events(query_string: str = None,
start: str = None,
end: str = None,
venue: str = None,
top_k: int = 25) -> str:
"""
Search for events by name, and
happening at a specified venue, and
occurring between start and end datetime.
One or more parameters are required.
Use this for requests that should get all events for a given set of parameters.
"""
[The code pre-filters the results with SQL based on venue and start values, then performs a vector search over the filtered events.]

search_events_tool = FunctionTool.from_defaults(fn=_search_events)

Basically, I'd like to convert the FunctionTool to a QueryEngineTool.
I'm not clear on how the start, end, and venue variables
a) will be indicated to the ReAct agent and
b) can be passed down to the QueryEngine and Retriever

The general idea is to use SQL to provide context which needs full/accurate data, but to use local vector search for stuff that doesn't, and then rerank the results
and send to the LLM.
2 comments
l
L