Find answers from the community

J
Juampi
Offline, last seen 3 months ago
Joined September 25, 2024
Hi guys! We are trying to make a chatbot using openAI (gpt4o) and llama-index for RAG. We already defined some function tools and created the OpenAIAgent, but every time we try to stream the response of the agent to any input text, we recieve the raise of the following exception:
"2024-06-25 16:35:14,002 - root - ERROR - models/chatbot. An error occurred while streaming the answer to Buenas
Error: list index out of range (chatbot.py:174) "

We cannot figure out why there is a list index out of range error. Maybe with the handling of the chat history? Any help you can give us will be welcome! Thanks!
7 comments
J
L
Tool not found, please double check:

Hi! I'm having an error that i have no clue how to make an approach to. I have already defined some tools for the agent that were working fine, but i don't why there is one of them (which were working fine too) that now gives me the following message in console:
2024-07-05 17:42:19,697 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK" (_client.py:1026)
2024-07-05 17:42:21,130 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" (_client.py:1026)
=== Calling Function ===
Calling function: save_payment_promise_for_debt with args: {"debt_id":"a8487f7d-8154-4ead-b401-faa64005a6f6","year":2024,"month":7,"day":11}
Tool with name save_payment_promise_for_debt not found, please double check.
========================

Does anyone have an idea what can be the cause of this error? If i see the code when the tool is added to the agent, there are no compilation errors and even when i ctrl+click the name of the method, it redirects me fine to it's declaration, so i don't know where to start debugging. This is how i append it to the tools list, which is the same way i do it for the rest of tools that are working fine:
self.tools.append(FunctionTool.from_defaults(fn=self.payment_tools.save_payment_promise_for_debt))

I don't know why i have the feeling that the answer to my problem could be something so simple as a spelling error, but i cannot see it and i'm getting frustrated xd so thanks in advance to anyone that can giive me a hand with this 🙂

Update: now it's happening with randomly any tool. Sometimes they work, sometimes they dont. If you need any info pls tell me, because i'm not understanding what is happening xd
5 comments
J
L
Trouble debugging agent turns:
3 comments
J
L