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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save charts in Agent - Pandasai 3.0.0b11 #1618

Open
ananhari opened this issue Feb 17, 2025 · 0 comments
Open

Save charts in Agent - Pandasai 3.0.0b11 #1618

ananhari opened this issue Feb 17, 2025 · 0 comments

Comments

@ananhari
Copy link

System Info

I'm using agent in pandasai 3.0.0b11 beta version with custom llm to generate SQL query and then pandas code to plot.

I tried both with Windows 11 and WSL2

But not sure where to send the path and I was get error saying expected plot path.

Config is no longer valid parameter for agent in beta version.. Here is the sample code as well

🐛 Describe the bug

I'm using agent in pandasai 3.0.0b11 beta version with custom llm to generate SQL query and then pandas code to plot.

I tried both with Windows 11 and WSL2.

But not sure where to send the path and I was get error saying expected plot path.

Config is no longer valid parameter for agent in beta version.. Here is the sample code as well

    custom_llm = testllm(model=selected_llm)
    smart_df = SmartDataframe(df)
	smart_df.save_charts = r'/home/test/work/projects/Projects/Integrations/plot.png'
    agent = Agent(smart_df)
    agent._state.config.llm = custom_llm
    try:
        response = agent.chat(question)
    except NoResultFoundError as e:
        logging.error("No result returned. Generated code was: %s", agent._state.last_code_generated)
        raise e
    return response)

plt.grid(True)
result = {'type': 'plot', 'value': None}
ERROR:root:Error during agent.chat: Invalid output: Expected a plot save path str but received an incompatible type.

    raise InvalidOutputValueMismatch(
pandasai.exceptions.InvalidOutputValueMismatch: Invalid output: Expected a plot save path str but received an incompatible type.
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

1 participant