Ao tentar executar a função de busca do Tavily como no vídeo o LLM não está chamando a função e recebo este retorno:
Added user message to memory: Me retorne artigos científicos sobre o uso da inteligência artificial nas redes sociais que você encontrar na web === LLM Response === <function=search{"query": "artigos cientificos sobre inteligencia artificial nas redes sociais", "max_results": 10}
Enquanto que outras funções estão funcionando. Segue o código:
from llama_index.core.agent import FunctionCallingAgentWorker, AgentRunner
from llama_index.tools.tavily_research import TavilyToolSpec
from llama_index.llms.groq import Groq
from google.colab import userdata
from llama_index.core import Settings
groq = userdata.get('GROQ_API_KEY')
llm = Groq(model="llama-3.3-70b-versatile", api_key=groq)
Settings.llm = llm
tavily_key = userdata.get('tavily')
tavily_tool = TavilyToolSpec(api_key=tavily_key)
tools = tavily_tool.to_tool_list()
agent_worker = FunctionCallingAgentWorker.from_tools(tools)
agent = AgentRunner(agent_worker)
response = agent.chat("Me retorne artigos científicos sobre o uso da inteligência artificial nas redes sociais que você encontrar na web")
print(response)