We're Hiring!
Whitepaper
Docs
Sign In
Tool
Tool
Chat with CSV
Last Updated
a year ago
Created
a year ago
Tool ID
chat_with_csv
Creator
@ajayrajc
Downloads
4.4K+
Get
Sponsored by Open WebUI Inc.
We are hiring!
Shape the way humanity engages with
intelligence
.
Description
Importing the csv file and intergerate with PandasAI to implement data analysis on csv files
README
No README available
Tool Code
Show
class Tool: def __init__(self,csv_file): self.df=pd.read_csv(csv_file) def chat_with_csv(self,query): """ This function will take the data frame from taken init file and pass it to interact with pandasAI """ from pandasai.llm.local_llm import LocalLLM import pandas as pd from pandasai import SmartDataframe # Initialize LocalLLM with Meta Llama 3 model llm = LocalLLM( api_base="http://localhost:11434/v1", model="llama3.1") # Initialize SmartDataframe with DataFrame and LLM configuration pandas_ai = SmartDataframe(self.df, config={"llm": llm}) # Chat with the DataFrame using the provided query result = pandas_ai.chat(query) return result