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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run locally to contribute #1125

Open
jackwalkin opened this issue Apr 19, 2024 · 8 comments
Open

Unable to run locally to contribute #1125

jackwalkin opened this issue Apr 19, 2024 · 8 comments

Comments

@jackwalkin
Copy link

System Info

master branch (2.0.34)
Using Python 3.11
Package installation (I have tried both approaches):

  • poetry install --all-extras --with dev
  • pip install .

馃悰 Describe the bug

I can get pandasai working via pip install pandasai using the PANDASAI_API_KEY however when I use the same API key but use the poetry local installation:
poetry install --all-extras --with dev

I get the following error when I run sdf.chat("message"):

  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/pipelines/chat/generate_chat_pipeline.py", line 307, in run
    output = (self.code_generation_pipeline | self.code_execution_pipeline).run(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/pipelines/pipeline.py", line 137, in run
    raise e
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/pipelines/pipeline.py", line 101, in run
    step_output = logic.execute(
                  ^^^^^^^^^^^^^^
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/pipelines/chat/code_generator.py", line 33, in execute
    code = pipeline_context.config.llm.generate_code(input, pipeline_context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/llm/base.py", line 200, in generate_code
    response = self.call(instruction, context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/llm/bamboo_llm.py", line 18, in call
    response = self._session.post("/llm/chat", json=data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/helpers/request.py", line 37, in post
    return self.make_request("POST", path, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jwalkinshaw/GenAI/Testing_others/Random testing/pandas/pandas-ai/pandasai/helpers/request.py", line 71, in make_request
    raise PandasAIApiCallError(data["message"])
pandasai.exceptions.PandasAIApiCallError: Unable to generate LLM response.```




**For reference the error code does not occur during installation it is at the end of this code**




```python 
import pandas as pd
from pandasai import SmartDataframe
import os

os.environ['PANDASAI_API_KEY'] ="XXXX"

df = pd.DataFrame({
    "country": [
        "United States",
        "United Kingdom",
        "France",
        "Germany",
        "Italy",
        "Spain",
        "Canada",
        "Australia",
        "Japan",
        "China",
    ],
    "gdp": [
        19294482071552,
        2891615567872,
        2411255037952,
        3435817336832,
        1745433788416,
        1181205135360,
        1607402389504,
        1490967855104,
        4380756541440,
        14631844184064,
    ],
    "happiness_index": [6.94, 7.16, 6.66, 7.07, 6.38, 6.4, 7.23, 7.22, 5.87, 5.12],
})

sdf = SmartDataframe(df,config={"verbose": True})
sdf.chat("Return the top 5 countries by GDP")

Has anyone come across this issue? Am I doing something incorrectly?

@pkdhirasaria
Copy link

pkdhirasaria commented Apr 23, 2024

I'm facing the same error, it was working before for me with pip install pandasai, but it's not working now.

@NEHA0901-US
Copy link

I am facing this same issue.

@wllbll
Copy link

wllbll commented Apr 28, 2024

counter the same issue with pandas installed with pip, pandasai version 2.0.36 , python version 3.10.13

@silasoli
Copy link

I tried here, it didn't work, but thank you very much, I'm trying to create a "chat" for the user to talk to their csv, but these version issues in Python make everything so difficult

@ssling0817
Copy link

ssling0817 commented May 16, 2024

Does anyone find the solution? I am facing the same issue.
The same code worked yesterday but fails today.
The version I used is pandasai 2.0.40, python version 3.10.12.

@gventuri
Copy link
Collaborator

@ssling0817 can you try to pull the latest update and try again? Let me know

@ssling0817
Copy link

I think it works in 2.0.42. Thank you!

@silasoli
Copy link

I think it works in 2.0.42. Thank you!

Thanks for this, I'll test it

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

No branches or pull requests

7 participants