Spaces:
Running
Running
File size: 3,080 Bytes
98b8ff7 b0540b3 98b8ff7 b0540b3 98b8ff7 5110d54 98b8ff7 a75702e 98b8ff7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
import streamlit as st
from configfile import Config # Import the Config class
import os
class LoadStreamlitUI:
def __init__(self):
self.config = Config() # Create a Config instance
self.user_controls = {}
def load_streamlit_ui(self):
st.set_page_config(page_title= "π€ " + self.config.get_page_title(), layout="wide")
st.header("π€ " + self.config.get_page_title())
with st.sidebar:
# Get options from config
llm_options = self.config.get_llm_options()
usecase_options = self.config.get_usecase_options()
# LLM selection
self.user_controls["selected_llm"] = st.selectbox("Select LLM", llm_options)
if self.user_controls["selected_llm"] == 'Groq':
# Model selection
model_options = self.config.get_groq_model_options()
self.user_controls["selected_groq_model"] = st.selectbox("Select Model", model_options)
# API key input
self.user_controls["GROQ_API_KEY"] = st.session_state["GROQ_API_KEY"] = st.text_input("API Key",
type="password")
# Use case selection
self.user_controls["selected_usecase"] = st.selectbox("Select Usecases", usecase_options)
if self.user_controls["selected_usecase"] =="Chatbot with Tool":
# API key input
os.environ["TAVILY_API_KEY"] = self.user_controls["TAVILY_API_KEY"] = st.session_state["TAVILY_API_KEY"] = st.text_input("TAVILY API KEY",
type="password")
# Use agent description about role
# self.user_controls['agent_descriptions'] = st.text_input("Enter the description about an agent",placeholder='eg. You are a helpful assistant that always responds in a polite, upbeat and positive manner.')
# st.session_state["chat_with_history"] = st.sidebar.toggle("Chat With History")
# self.user_controls['num_history_responses'] = 0
# if st.session_state["chat_with_history"]:
# self.user_controls['num_history_responses'] = st.number_input("Enter number of history include from last chat",placeholder="eg. 1",step=1)
if self.user_controls['selected_usecase'] == "Appointment Receptionist":
col1, col2 = st.columns(2)
with col1:
st.subheader("Appointment Manager")
with col2:
st.subheader("Appointments")
elif self.user_controls['selected_usecase']=="Custome Support":
st.set_page_config(layout='wide', page_title='Flower Shop Chatbot', page_icon='π')
return self.user_controls
|