The community member is encountering an AttributeError: 'str' object has no attribute 'chat' when using the agent.chat() method. They have verified that the agent object is of type llama_index.agent.react.base.ReActAgent. The community members provide the full traceback, which indicates the issue is with the self._llm attribute. After further investigation, the community member resolves the issue by setting up the LLM for the agent as described in the documentation, using llama_index.llms import OpenAI and llm = OpenAI(model="gpt-3.5-turbo-0613").
Hi, hope this helps: Traceback (most recent call last): File "/Users/nana/llama_mj/queryenginetool.py", line 54, in <module> response = agent.chat("¿Cuál es el nombre del presidente de los Estados Unidos?") File "/Users/nana/venv/lib/python3.10/site-packages/llama_index/agent/react/base.py", line 157, in chat chat_response = self._llm.chat(input_chat) AttributeError: 'str' object has no attribute 'chat'
Upon revision after your response, I noticed I hadn't set it up like in the docs. Works after modifying with llama_index.llms import OpenAI llm = OpenAI(model="gpt-3.5-turbo-0613"). Thank you for your help!