Spaces:
Sleeping
Sleeping
Upload 15 files
Browse files
app.py
CHANGED
|
@@ -1,14 +1,13 @@
|
|
| 1 |
from frontend_pages import st
|
| 2 |
from frontend_pages.ConfigPage import ConfigPage
|
| 3 |
from frontend_pages.ChatModelPage import ChatModelPage
|
| 4 |
-
from frontend_pages.Dashboard import Dashboard
|
| 5 |
|
| 6 |
|
| 7 |
-
PAGES = {
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
}
|
| 11 |
|
| 12 |
if __name__ == "__main__":
|
| 13 |
-
|
| 14 |
# PAGES["Chat with AI Model"]().render()
|
|
|
|
| 1 |
from frontend_pages import st
|
| 2 |
from frontend_pages.ConfigPage import ConfigPage
|
| 3 |
from frontend_pages.ChatModelPage import ChatModelPage
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
+
# PAGES = {
|
| 7 |
+
# "Dashboard": ChatModelPage,
|
| 8 |
+
# # "Configurazione": ConfigPage,
|
| 9 |
+
# }
|
| 10 |
|
| 11 |
if __name__ == "__main__":
|
| 12 |
+
ChatModelPage().render()
|
| 13 |
# PAGES["Chat with AI Model"]().render()
|
frontend_pages/ChatModelPage.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from . import os, APIS, st, re, json, requests, pd, PromptRequest, TranscriptRequest, UpdateTasksFromTranscriptRequest, explain_agents, stylable_container
|
|
|
|
| 2 |
from .BasePage import BasePage
|
| 3 |
|
| 4 |
from .modals import (
|
|
@@ -121,6 +122,20 @@ class ChatModelPage(BasePage):
|
|
| 121 |
super().__init__()
|
| 122 |
self.model = None
|
| 123 |
self.router_agent = RouterAgent()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
def render(self):
|
| 126 |
st.title("Dashboard")
|
|
|
|
| 1 |
from . import os, APIS, st, re, json, requests, pd, PromptRequest, TranscriptRequest, UpdateTasksFromTranscriptRequest, explain_agents, stylable_container
|
| 2 |
+
from APIModules.ObjectModels.Task import Task
|
| 3 |
from .BasePage import BasePage
|
| 4 |
|
| 5 |
from .modals import (
|
|
|
|
| 122 |
super().__init__()
|
| 123 |
self.model = None
|
| 124 |
self.router_agent = RouterAgent()
|
| 125 |
+
with st.sidebar:
|
| 126 |
+
initial_state_from_json : dict = st.session_state.get("INITIAL_STATE", {})
|
| 127 |
+
if st.button("use_preloaded_state"):
|
| 128 |
+
with open("initial_state.json") as f:
|
| 129 |
+
initial_state_from_json : dict = json.load(f)
|
| 130 |
+
st.session_state.INITIAL_STATE = initial_state_from_json
|
| 131 |
+
st.rerun()
|
| 132 |
+
initial_team_members = st.session_state.get('team')
|
| 133 |
+
if not initial_team_members:st.session_state.team = initial_state_from_json.get('team', ["Alessio", "Joy", "Nicola C", "Nicola D", "Dragosh"])
|
| 134 |
+
initial_tasks = st.session_state.get('tasks')
|
| 135 |
+
if not initial_tasks:st.session_state.tasks = [Task(**task).model_dump() for task in initial_state_from_json.get('tasks', [])]
|
| 136 |
+
initial_assignments = st.session_state.get('assignments')
|
| 137 |
+
if not initial_tasks:st.session_state.assignments = initial_state_from_json.get('assignments', {})
|
| 138 |
+
|
| 139 |
|
| 140 |
def render(self):
|
| 141 |
st.title("Dashboard")
|
frontend_pages/Dashboard.py
CHANGED
|
@@ -4,6 +4,8 @@ from .BasePage import BasePage
|
|
| 4 |
from .modals import get_base64_image, create_call_modal, upload_call_modal_and_actions
|
| 5 |
|
| 6 |
class Dashboard(BasePage):
|
|
|
|
|
|
|
| 7 |
def render(self):
|
| 8 |
st.title("Dashboard")
|
| 9 |
self.sidebar_elements()
|
|
|
|
| 4 |
from .modals import get_base64_image, create_call_modal, upload_call_modal_and_actions
|
| 5 |
|
| 6 |
class Dashboard(BasePage):
|
| 7 |
+
|
| 8 |
+
|
| 9 |
def render(self):
|
| 10 |
st.title("Dashboard")
|
| 11 |
self.sidebar_elements()
|
frontend_pages/__pycache__/ChatModelPage.cpython-312.pyc
CHANGED
|
Binary files a/frontend_pages/__pycache__/ChatModelPage.cpython-312.pyc and b/frontend_pages/__pycache__/ChatModelPage.cpython-312.pyc differ
|
|
|