Sinaptik-AI / pandas-ai

Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
https://pandas-ai.com
Other
12.75k stars 1.23k forks source link

no working: Passing name and description for a dataframe #1056

Closed KEAI404 closed 3 months ago

KEAI404 commented 6 months ago

System Info

pandasai:2.0.19 python:3.10.12

🐛 Describe the bug

I set name and description, but found that the name and description were still null in the prompt. df = SmartDataframe(df, name="data name xxx", description="include xxx ", config={"llm": lm_studio_llm} ) response = df.chat("Which country has the highest gdp?") image

SweetyKhut commented 5 months ago

@KEAI404 Hello, I am facing the same issue. The name and description are not getting passed and showing null in the pandasai.logs file.

image

did you find the solution or has any other method worked for you?

gventuri commented 5 months ago

@SweetyKhut can you share the code that you are using?

SweetyKhut commented 5 months ago

@gventuri Yes this is the tutorial code which i am using

import pandas as pd from pandasai.connectors import PandasConnector from pandasai import SmartDataframe,SmartDatalake from pandasai.llm import OpenAI

llm = OpenAI(api_token="###")

users_df = pd.DataFrame( { "id": [1, 2, 3, 4, 5], "name": ["John", "Emma", "Liam", "Olivia", "William"] } ) users = SmartDataframe(users_df, name="users", description="Lorem ipsum",config={"llm": llm})

photos_df = pd.DataFrame( { "id": [31, 32, 33, 34, 35], "user_id": [1, 1, 2, 4, 5] } ) photos = SmartDataframe(photos_df, name="photos", description="Lorem ipsum",config={"llm": llm})

lake = SmartDatalake([users, photos], config={"llm": llm}) print(lake.chat("How many photos has been uploaded by Emma?")) print(lake.last_code_executed)

I also tried for with only smartdataframe like this

df = SmartDataframe(df, name="My DataFrame", description="Brief description of what the dataframe contains")

but still getting passed as null

KEAI404 commented 5 months ago

@SweetyKhut Unfortunately, several methods have been tried without success.