skeleton ui is ready
Browse files
app.py
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from src.main import load_app
|
| 2 |
+
|
| 3 |
+
if __name__ == "__main__":
|
| 4 |
+
load_app()
|
src/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (133 Bytes). View file
|
|
|
src/__pycache__/main.cpython-312.pyc
ADDED
|
Binary file (897 Bytes). View file
|
|
|
src/main.py
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
from src.ui.load import LoadStreamlitUI
|
| 5 |
+
|
| 6 |
+
def load_app():
|
| 7 |
+
"""
|
| 8 |
+
Load the Streamlit application.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
ui = LoadStreamlitUI()
|
| 12 |
+
user_input = ui.load_ui()
|
| 13 |
+
|
| 14 |
+
if not user_input:
|
| 15 |
+
st.error("Failed to load the UI. Please check your configuration.")
|
| 16 |
+
return
|
| 17 |
+
|
| 18 |
+
if st.session_state.isFetchButtonClicked:
|
| 19 |
+
user_message = st.session_state.timeframe
|
| 20 |
+
|
| 21 |
+
else:
|
| 22 |
+
user_message = st.text_input("Enter your message:")
|
| 23 |
+
|
src/ui/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (136 Bytes). View file
|
|
|
src/ui/__pycache__/config.cpython-312.pyc
ADDED
|
Binary file (2.38 kB). View file
|
|
|
src/ui/__pycache__/load.cpython-312.pyc
ADDED
|
Binary file (3.93 kB). View file
|
|
|
src/ui/load.py
CHANGED
|
@@ -8,4 +8,64 @@ from src.ui.config import LoadConfig
|
|
| 8 |
class LoadStreamlitUI:
|
| 9 |
def __init__(self):
|
| 10 |
self.config = LoadConfig()
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
class LoadStreamlitUI:
|
| 9 |
def __init__(self):
|
| 10 |
self.config = LoadConfig()
|
| 11 |
+
self.user_controls = {}
|
| 12 |
+
|
| 13 |
+
def initialize_session(self):
|
| 14 |
+
return {
|
| 15 |
+
'current_step': 'requirements',
|
| 16 |
+
'requirements': "",
|
| 17 |
+
'user_stories': "",
|
| 18 |
+
'po_feedback': "",
|
| 19 |
+
'generated_code': "",
|
| 20 |
+
'review_feedback': "",
|
| 21 |
+
'decision': None,
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def load_ui(self):
|
| 26 |
+
st.set_page_config(page_title=" 🤖" + self.config.get_title(), page_icon=":robot_face:", layout="wide")
|
| 27 |
+
st.header(" 🤖" + self.config.get_title())
|
| 28 |
+
st.session_state.timeframe = ''
|
| 29 |
+
st.session_state.IsFetchbuttonClicked = False
|
| 30 |
+
st.session_state.IsSDLC = False
|
| 31 |
+
|
| 32 |
+
with st.sidebar:
|
| 33 |
+
|
| 34 |
+
llm_options = self.config.get_llm_options()
|
| 35 |
+
|
| 36 |
+
# LLM Selection
|
| 37 |
+
self.user_controls['Selected LLM'] = st.selectbox('Select LLM', llm_options)
|
| 38 |
+
|
| 39 |
+
if self.user_controls['Selected LLM'] == 'Groq':
|
| 40 |
+
# Groq Model Selection
|
| 41 |
+
groq_models = self.config.get_groq_models()
|
| 42 |
+
self.user_controls['Selected Model'] = st.selectbox('Select Groq Model', groq_models)
|
| 43 |
+
|
| 44 |
+
self.user_controls['API Key'] = st.text_input('Enter Groq API Key', type='password')
|
| 45 |
+
|
| 46 |
+
if not self.user_controls['API Key']:
|
| 47 |
+
st.warning('⛔ Please enter a valid Groq API key to proceed ⛔. If you don\'t have an API key, please visit https://console.groq.com to create one.')
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
if self.user_controls['Selected LLM'] == 'OpenAI':
|
| 51 |
+
# OpenAI Model Selection
|
| 52 |
+
openai_models = self.config.get_openai_models()
|
| 53 |
+
self.user_controls['Selected Model'] = st.selectbox('Select OpenAI Model', openai_models)
|
| 54 |
+
|
| 55 |
+
self.user_controls['API Key'] = st.text_input('Enter OpenAI API Key', type='password')
|
| 56 |
+
|
| 57 |
+
if not self.user_controls['API Key']:
|
| 58 |
+
st.warning('⛔ Please enter a valid OpenAI API key to proceed ⛔. If you don\'t have an API key, please visit https://platform.openai.com/account/api-keys to create one.')
|
| 59 |
+
|
| 60 |
+
use_case = self.config.get_use_case()
|
| 61 |
+
|
| 62 |
+
# Use Case Selection
|
| 63 |
+
self.user_controls['Selected Use Case'] = st.selectbox('Select Use Case', use_case)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
if 'state' not in st.session_state:
|
| 67 |
+
st.session_state.state = self.initialize_session()
|
| 68 |
+
|
| 69 |
+
return self.user_controls
|
| 70 |
+
|
| 71 |
+
|