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

TypeError: GoogleGemini._generate_text() takes 2 positional arguments but 3 were given #979

Closed
Umar-cs opened this issue Mar 1, 2024 · 1 comment 路 Fixed by #980
Closed

Comments

@Umar-cs
Copy link

Umar-cs commented Mar 1, 2024

System Info

OS: Windows 11
Python version: 3.10
The current version of pandasai being used: 2.0.2

馃悰 Describe the bug

Getting type error while using GoogleGemini but working fine with GooglePalm.

Read CSV file

import pandas as pd
from pandasai import SmartDataframe
from pandasai.llm.google_gemini import GoogleGemini
file_path = "D:\csv\dataset.csv"
df = pd.read_csv(file_path)

Prompt input

prompt = input("Enter your prompt: ")

Create LLM and PandasAI objects

llm = GoogleGemini(api_key=api_token)
pandas_ai = SmartDataframe(df, config={"llm": llm, "verbose": True})

Generate output based on the prompt

if prompt:
try:
result = pandas_ai.chat(prompt)
print(result)
except KeyError as e:
print(f"Error: {e}. Unable to retrieve result.")
else:
print("Please enter a prompt.")

Screenshot 2024-03-02 000423
Unfortunately, I was not able to answer your question, because of the following error:

GoogleGemini._generate_text() takes 2 positional arguments but 3 were given```
@mspronesti
Copy link
Contributor

Hi there @Umar-cs, I've just opened #980 to patch this. Please give it a shot and let me know :)

To test the version of my PR:

git clone -b fix/gemini https://github.com/mspronesti/pandas-ai
cd pandas-ai
pip install .

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.

2 participants