import streamlit as st class Sidebar: MODEL_OPTIONS = ["gpt-3.5-turbo", "gpt-4"] TEMPERATURE_MIN_VALUE = 0.0 TEMPERATURE_MAX_VALUE = 1.0 TEMPERATURE_DEFAULT_VALUE = 0.0 TEMPERATURE_STEP = 0.01 @staticmethod def about(): about = st.sidebar.expander("πŸ€–Info") sections = [ "#### CSV-ChatBotis an AI chatbot with interactive memory features designed to help users discuss CSV data in a more intuitive way. πŸ“„", "#### It uses a large language model to provide users with seamless, contextual, natural language interactions to better understand CSV data.. 🌐", "#### [Langchain](https://github.com/hwchase17/langchain), [OpenAI](https://platform.openai.com/docs/models/gpt-3-5) [Streamlit](https://github.com/streamlit/streamlit)⚑", "#### Source code : [RustX/ChatBot-CSV](https://github.com/RustX2802/CSV-ChatBot)", ] for section in sections: about.write(section) @staticmethod def reset_chat_button(): if st.button("Reset chat"): st.session_state["reset_chat"] = True st.session_state.setdefault("reset_chat", False) def model_selector(self): model = st.selectbox(label="Model ", options=self.MODEL_OPTIONS) st.session_state["model"] = model def temperature_slider(self): temperature = st.slider( label="Temperature ", min_value=self.TEMPERATURE_MIN_VALUE, max_value=self.TEMPERATURE_MAX_VALUE, value=self.TEMPERATURE_DEFAULT_VALUE, step=self.TEMPERATURE_STEP, ) st.session_state["temperature"] = temperature def csv_agent_button(self): st.session_state.setdefault("show_csv_agent", False) if st.sidebar.button("CSV Agent"): st.session_state["show_csv_agent"] = not st.session_state["show_csv_agent"] def show_options(self): with st.sidebar.expander("πŸ› οΈ Tools ", expanded=False): self.reset_chat_button() self.csv_agent_button() self.model_selector() self.temperature_slider() st.session_state.setdefault("model", self.MODEL_OPTIONS[0]) st.session_state.setdefault("temperature", self.TEMPERATURE_DEFAULT_VALUE)