[BUG] CSV agent is not working with OpenAI ChatGPT
automaton82 opened this issue · comments
Describe the bug
If you attempt to use the CSV agent with the attached public csv city data file, you get the following error:
Question: what cities are there
Response:
{'LatD': 'int64', ' "LatM"': 'int64', ' "LatS"': 'int64', ' "NS"': 'object', ' "LonD"': 'int64', ' "LonM"': 'int64', ' "LonS"': 'int64', ' "EW"': 'object', ' "City"': 'object', ' "State"': 'object'}
2024-05-06 19:54:32 [ERROR]: [server]: Error: Sorry, I'm unable to find answer for question: "what cities do you have" using following code: "df["City"].unique()"
Error: Sorry, I'm unable to find answer for question: "what cities do you have" using following code: "df["City"].unique()"
at CSV_Agents.run (C:\git\flowise\packages\components\dist\nodes\agents\CSVAgent\CSVAgent.js:165:23)
at async utilBuildChatflow (C:\git\flowise\packages\server\dist\utils\buildChatflow.js:232:15)
at async createInternalPrediction (C:\git\flowise\packages\server\dist\controllers\internal-predictions\index.js:7:29)
All questions will fail though.
CSV file: cities.csv
To Reproduce
Steps to reproduce the behavior:
- Create a chatflow and add a
CSV agent
node - Use OpenAI ChatGPT
Chat Model
orLLM
node, it's the same result for both - Upload the attached csv file
- Ask "what cities are there"
Expected behavior
This should work.
Setup
- Installation
pnpm start
- Flowise Version latest as of ef53286
- OS: Windows 11
- Browser all
Additional context
Aside from this problem, it also appears the uploaded file does not go into DISK BLOB storage. It goes into the database as base64. This behaviour is different than the CSV document loader which does go into DISK BLOB storage immediately when uploaded. Not sure if this is intended or not.
so the solution is to do some regex check to get rid of the prefix
I would like to take up this issue, planning to implement the changes in the ChatflowPool, kindly assign me @HenryHengZJ. Thanks in advance.