Yea exactly.
We don't want to override the way each tool decides to parse the user message + history?
- You could ovrride this by making your own custom tool
from typing import Any
from llama_index.tools import BaseTool, FunctionTool
query_engine = index.as_query_engine()
def query_tool(query_str: str) -> Any:
"""[TOOL DESCRIPTION]"""
new_query_str = parse_query_str(query_str)
return query_engine.query(new_query_str)
query_tool = FunctionTool.from_defaults(fn=query_tool)
agent = OpenAIAgent.from_tools([query_tool], llm=llm, verbose=True)
Here, the tool name is the function name, and tool description is the docstring