Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] CSV agent is not working with OpenAI ChatGPT #2341

Open
automaton82 opened this issue May 7, 2024 · 4 comments
Open

[BUG] CSV agent is not working with OpenAI ChatGPT #2341

automaton82 opened this issue May 7, 2024 · 4 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@automaton82
Copy link
Contributor

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:

  1. Create a chatflow and add a CSV agent node
  2. Use OpenAI ChatGPT Chat Model or LLM node, it's the same result for both
  3. Upload the attached csv file
  4. 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.

@HenryHengZJ
Copy link
Contributor

OpenAI suddenly gives the prefix python, so the whole code becomes:

import pandas as pd
```python
print(df["Company Name"])
` ` `

which causes error when trying to run on pyodide
image

@HenryHengZJ
Copy link
Contributor

so the solution is to do some regex check to get rid of the prefix

@HenryHengZJ HenryHengZJ added bug Something isn't working enhancement New feature or request labels May 7, 2024
@toi500
Copy link

toi500 commented May 9, 2024

@HenryHengZJ

It looks like the same issue I just reported with the Airtable Agent.

#2364

@Hariharan1828
Copy link
Contributor

Hariharan1828 commented May 11, 2024

I would like to take up this issue, planning to implement the changes in the ChatflowPool, kindly assign me @HenryHengZJ. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants