I am asking to prompt response text but it generates the response in table. I tried using like do not use table

Basically I am showing the total count in table. I am passing that table as data frame to generate the text.

import pandas as pd
from pandasai import SmartDataframe
from pandasai.llm import OpenAI
from pandasai.helpers.openai_info import get_openai_callback

llm = OpenAI(api_token="My key")
llm.model="gpt-4"

if value_counts_columns:
            if st.button("Generate Text"):
                if value_counts_list:
                    all_value_counts_df = pd.concat(value_counts_list, axis=0, ignore_index=True)
                    dfcount = SmartDataframe(all_value_counts_df, config={"llm": llm, "conversational": False})
                    st.write("### Description")
                    with st.spinner("Generating response..."):
                        response = dfcount.chat("write qualitative insight")
                        st.write(response)
                else:
                    st.write("No columns selected.")

Welcome!

Do you have an example of the output you’re getting and the output you want?

What system/user prompts are you using?

Might try GPT-4o… or even give it a one-shot example if it’s not too long to “pre-train” it with an additional user/assistant pair…

1 Like