You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MACOS Sonoma 14.4.1
Python Version 3.11.7
Pandasai Version 2.0.37
🐛 Describe the bug
Imports
from pandasai import Agent, SmartDataframe
import os
import streamlit as st
import pandas as pd
Code
defLLM_Analysis(pandas_csv):
#Present the max, min, range, mean, and mode in a streamlit table with two columnsst.markdown("> LLM Analysis")
os.environ["PANDASAI_API_KEY"] ="MY_API_KEY"df=pd.DataFrame(pandas_csv)
df=SmartDataframe(df, config={"verbose": True})
df.chat("Give me a short summary of the dataset.")
This is a minimal version of the code, where a simple pandas csv read df is passed:
read_csv=pd.read_csv(uploaded_file)
Error Message
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/pipelines/chat/generate_chat_pipeline.py", line 307, in run
output = (self.code_generation_pipeline | self.code_execution_pipeline).run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/pipelines/pipeline.py", line 137, in run
raise e
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/pipelines/pipeline.py", line 101, in run
step_output = logic.execute(
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/pipelines/chat/code_generator.py", line 33, in execute
code = pipeline_context.config.llm.generate_code(input, pipeline_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/llm/base.py", line 200, in generate_code
response = self.call(instruction, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/llm/bamboo_llm.py", line 18, in call
response = self._session.post("/llm/chat", json=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/helpers/request.py", line 37, in post
return self.make_request("POST", path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandasai/helpers/request.py", line 71, in make_request
raise PandasAIApiCallError(data["message"])
pandasai.exceptions.PandasAIApiCallError: Unable to generate LLM response.
Log file
2024-05-13 06:30:25 [INFO] Question: Give me a short summary of the dataset.
2024-05-13 06:30:25 [INFO] Running PandasAI with bamboo_llm LLM...
2024-05-13 06:30:25 [INFO] Prompt ID: 19bf8ed5-4015-40d1-8102-2f6d2169ac0c
2024-05-13 06:30:25 [INFO] Executing Pipeline: GenerateChatPipeline
2024-05-13 06:30:25 [INFO] Executing Step 0: ValidatePipelineInput
2024-05-13 06:30:25 [INFO] Executing Step 1: CacheLookup
2024-05-13 06:30:25 [INFO] Executing Step 2: PromptGeneration
2024-05-13 06:30:26 [INFO] Querying without using training data.
2024-05-13 06:30:26 [INFO] Querying without using training docs.
2024-05-13 06:30:26 [INFO] Using prompt: <dataframe>
dfs[0]:2371x8
Date,Salinity (ppt),DissolvedOxygen (mg/L),pH,SecchiDepth (m),WaterDepth (m),WaterTemp (C),AirTemp (C)
1991-05-20,,,6.5,0.53,0.53,7.5,15.2
2011-01-04,8.0,11.1,7.4,0.22,1.1,,30.4
,4.5,10.8,,,,24.5,-1.111111111
</dataframe>
Update this initial code:
```python
# TODO: import the required dependencies
import pandas as pd
# Write code here
# Declare result var:
type (possible values "string", "number", "dataframe", "plot"). Examples: { "type": "string", "value": f"The highest salary is {highest_salary}." } or { "type": "number", "value": 125 } or { "type": "dataframe", "value": pd.DataFrame({...}) } or { "type": "plot", "value": "temp_chart.png" }
### QUERY
Give me a short summary of the dataset.
Variable `dfs: list[pd.DataFrame]` is already declared.
At the end, declare "result" variable as a dictionary of type and value.
If you are asked to plot a chart, use "matplotlib" for charts, save as png.
Generate python code and return full updated code:
2024-05-13 06:30:26 [INFO] Executing Step 3: CodeGenerator
2024-05-13 06:30:27 [ERROR] Pipeline failed on step 3: Unable to generate LLM response.
The text was updated successfully, but these errors were encountered:
System Info
MACOS Sonoma 14.4.1
Python Version 3.11.7
Pandasai Version 2.0.37
🐛 Describe the bug
Imports
Code
This is a minimal version of the code, where a simple pandas csv read df is passed:
Error Message
Log file
The text was updated successfully, but these errors were encountered: