I have set up translation tools, data analysis tools, and knowledge query tools. I would like to know if the intelligent invocation of tools in the phidata framework is made by LLM based on contextual intelligent invocation, or according to the user’s choice of tool?
Hey @zgli, the choice of tool is intelligently made by the model of choice. The user only needs to give all the tools to the model required for the task. For example
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.tools.duckduckgo import DuckDuckGo
from phi.tools.yfinance import YFinanceTools
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[
DuckDuckGo(),
YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True),
],
markdown=True,
)
agent.cli_app(stream=True)
This is a simple cli example where we give the Agent a finance tool (YFinance) and a web search tool (DuckDuckGo). Now based on your query the Agent intelligently selects the tool and makes a call to give you the best result.