import pandas as pd from pandasai.llm import GooglePalm from pandasai import PandasAI import streamlit as st import os import sys GOOGLE_PALM_API_TOKEN = os.getenv('GOOGLE_PALM_API_TOKEN') llm = GooglePalm(api_key=GOOGLE_PALM_API_TOKEN) pandas_ai = PandasAI(llm) ################################ ####### Display of data ######## ################################ # -- Streamlit Settings st.set_page_config(layout='wide') st.title("Talkoff Script") uploaded_file = st.file_uploader("Loan Details",type=["csv"]) if uploaded_file is not None: df = pd.read_csv(uploaded_file) st.write(df) txt_prompt = st.text_area("Enter Talkoff Script Prompt") if st.button("Generate"): if txt_prompt: st.write("AI is generating answer, please wait....") st.write(pandas_ai.run(df, prompt=txt_prompt)) else: st.write("Please enter Talkoff Script Prompt")