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
Is there a way for the chat() function in the pandasai library to return image responses in a way that they can be displayed directly on a Streamlit app without triggering a download?
I'm currently developing a Streamlit application that utilizes the pandasai library for data analysis. When I use the chat() function to generate image responses, it results in the images being downloaded instead of being displayed on the page. My goal is to have these images shown directly in the app interface for better user experience.
Here’s a snippet of my code:
import pandas as pd
from pandasai import SmartDataframe
from langchain_groq.chat_models import ChatGroq
import os
import streamlit as st
# groq
llm = ChatGroq(model_name="llama3-70b-8192", api_key=os.environ["GROQ_API_KEY"])
# Streamlit app setup
st.title("Data Analysis with SmartDataframe")
df = pd.read_excel('data.xlsx')
df = SmartDataframe(df, config={"llm": llm})
st.write("Smart Dataframe")
# User input for chat command
user_input = st.text_input("Enter your command:")
if user_input: # Check if user input is provided
response = df.chat(user_input) # Get response from SmartDataframe
# Assuming response is an image URL or path
st.image(response, use_container_width=True) # This line triggers the download
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Is there a way for the chat() function in the pandasai library to return image responses in a way that they can be displayed directly on a Streamlit app without triggering a download?
I'm currently developing a Streamlit application that utilizes the pandasai library for data analysis. When I use the chat() function to generate image responses, it results in the images being downloaded instead of being displayed on the page. My goal is to have these images shown directly in the app interface for better user experience.
Here’s a snippet of my code:
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: