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

Do Q/A with csv agent and multiple txt files at the same time. #4423

Closed
tianshubao1 opened this issue May 9, 2023 · 7 comments · Fixed by #5009
Closed

Do Q/A with csv agent and multiple txt files at the same time. #4423

tianshubao1 opened this issue May 9, 2023 · 7 comments · Fixed by #5009

Comments

@tianshubao1
Copy link

Issue you'd like to raise.

I want to do Q/A with csv agent and multiple txt files at the same time. But I do not want to use csv loader and txt loader because they did not perform very well when handling cross file scenario. For example, the model needs to find answers from both the csv and txt file and then return the result.

How should I do it? I think I may need to create a custom agent.

Suggestion:

No response

@vowelparrot
Copy link
Contributor

You could try giving the agent access to a ReadFile tool and the CSV agent.

@tianshubao1
Copy link
Author

You could try giving the agent access to a ReadFile tool and the CSV agent.

Would you mind I ask how to do it?

@Mohammedvaraliya
Copy link

Yes yes you can do this, checkout this github repo where i am training my txt files and csv too

github repo url : https://github.com/Mohammedvaraliya/chatbot-with-custom-knowledge-testing

right now, you wont see any csv file on my context data directory, becuase i have tried to ask the question which was related to that csv file, the bot had respond me but not that much good, i would say, we have to format our csv in a right format, then only it will able to give accurate response

@tianshubao1
Copy link
Author

tianshubao1 commented May 11, 2023

Yes yes you can do this, checkout this github repo where i am training my txt files and csv too

github repo url : https://github.com/Mohammedvaraliya/chatbot-with-custom-knowledge-testing

right now, you wont see any csv file on my context data directory, becuase i have tried to ask the question which was related to that csv file, the bot had respond me but not that much good, i would say, we have to format our csv in a right format, then only it will able to give accurate response

Yes, when you involve csv, the question answering was not very good. That's the same problem I got. I was using csv loader and directoryloader.

@ViolaSongsy
Copy link

I tried using multiple tools and created an agent with those tools. The tools include dataframe tool and directoryloader tool. The answers were really good compared with directly asking the tool. Does anyone have ideas on how to improve this?

@tianshubao1
Copy link
Author

I tried using multiple tools and created an agent with those tools. The tools include dataframe tool and directoryloader tool. The answers were really good compared with directly asking the tool. Does anyone have ideas on how to improve this?

Would you mind sharing your code? Thanks

dev2049 pushed a commit that referenced this issue May 25, 2023
Add Multi-CSV/DF support in CSV and DataFrame Toolkits
* CSV and DataFrame toolkits now accept list of CSVs/DFs
* Add default prompts for many dataframes in `pandas_dataframe` toolkit

Fixes #1958
Potentially fixes #4423

## Testing
* Add single and multi-dataframe integration tests for
`pandas_dataframe` toolkit with permutations of `include_df_in_prompt`
* Add single and multi-CSV integration tests for csv toolkit
---------

Co-authored-by: Harrison Chase <[email protected]>
@alinayawar
Copy link

3
2

Actually, I am having an issue with the agent. When the agent finds the right Dataframe and columns then the agent should stop the observation but the agent still doing observation multiple times. I want the agent to just give the final answer with the right observation.

kindly suggest something how can I overcome this issue.

Undertone0809 pushed a commit to Undertone0809/langchain that referenced this issue Jun 19, 2023
…5009)

Add Multi-CSV/DF support in CSV and DataFrame Toolkits
* CSV and DataFrame toolkits now accept list of CSVs/DFs
* Add default prompts for many dataframes in `pandas_dataframe` toolkit

Fixes langchain-ai#1958
Potentially fixes langchain-ai#4423

## Testing
* Add single and multi-dataframe integration tests for
`pandas_dataframe` toolkit with permutations of `include_df_in_prompt`
* Add single and multi-CSV integration tests for csv toolkit
---------

Co-authored-by: Harrison Chase <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants