Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -196,4 +196,35 @@ if prompt := st.chat_input("Chatta con BonsiAI..."):
|
|
196 |
|
197 |
st.session_state.history.append([prompt, full_response])
|
198 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
199 |
-
st.success('Generazione Completata')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
st.session_state.history.append([prompt, full_response])
|
198 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
199 |
+
st.success('Generazione Completata')
|
200 |
+
|
201 |
+
|
202 |
+
'''
|
203 |
+
API_URL = 'AKfycbwFYvyUDMhOi1MrHyPeZidtmSOvqE-2LTmXsn5dnkHKMZYrdDKIpu5jYExLvRFesCAD/exec'
|
204 |
+
|
205 |
+
if 'loaded_data' not in st.session_state:
|
206 |
+
st.session_state.loaded_data = False
|
207 |
+
|
208 |
+
if not st.session_state.loaded_data:
|
209 |
+
options = requests.get(API_URL+ '?Parametro=prompt').json()
|
210 |
+
st.session_state.options = options
|
211 |
+
st.session_state.loaded_data = True
|
212 |
+
|
213 |
+
st.markdown("# Impostazioni Prompt")
|
214 |
+
st.session_state.selected_option_key = st.selectbox('Azione', list(st.session_state.options.keys()) + ['Personalizzata'])
|
215 |
+
st.session_state.selected_option = st.session_state.options.get(st.session_state.selected_option_key, {})
|
216 |
+
st.session_state.systemRole = st.session_state.selected_option.get('systemRole', '')
|
217 |
+
st.session_state.systemRole = st.text_area("Descrizione", st.session_state.systemRole)
|
218 |
+
st.session_state.systemStyle = st.session_state.selected_option.get('systemStyle', '')
|
219 |
+
st.session_state.systemStyle = st.text_area("Stile", st.session_state.systemStyle)
|
220 |
+
|
221 |
+
st.session_state.instruction = st.session_state.selected_option.get('instruction', '')
|
222 |
+
st.session_state.rag_enabled = st.session_state.selected_option.get('tipo', '')=='RAG'
|
223 |
+
if st.session_state.selected_option_key == 'Decreti':
|
224 |
+
st.session_state.top_k = st.slider(label="Documenti da ricercare", min_value=1, max_value=20, value=4, disabled=not st.session_state.rag_enabled)
|
225 |
+
st.session_state.decreti_escludere = st.multiselect(
|
226 |
+
'Decreti da escludere',
|
227 |
+
['23.10.2 destinazione risorse residue pnrr DGR 1051-2023_Destinazione risorse PNRR Duale.pdf', '23.10.25 accompagnatoria Circolare Inail assicurazione.pdf', '23.10.26 circolare Inail assicurazione.pdf', '23.10.3 FAQ in attesa di avviso_.pdf', '23.11.2 avviso 24_24 Decreto 17106-2023 Approvazione Avviso IeFP 2023-2024.pdf', '23.5.15 decreto linee inclusione x enti locali.pdf', '23.6.21 Circolare+esplicativa+DGR+312-2023.pdf', '23.7.3 1° Decreto R.L. 23_24 .pdf', '23.9 Regolamento_prevenzione_bullismo_e_cyberbullismo__Centro_Bonsignori.pdf', '23.9.1 FAQ inizio anno formativo.pdf', '23.9.15 DECRETO VERIFICHE AMMINISTR 15-09-23.pdf', '23.9.4 modifica decreto GRS.pdf', '23.9.8 Budget 23_24.pdf', '24.10.2022 DECRETO loghi N.15176.pdf', 'ALLEGATO C_Scheda Supporti al funzionamento.pdf', 'ALLEGATO_ B_ Linee Guida.pdf', 'ALLEGATO_A1_PEI_INFANZIA.pdf', 'ALLEGATO_A2_PEI_PRIMARIA.pdf', 'ALLEGATO_A3_PEI_SEC_1_GRADO.pdf', 'ALLEGATO_A4_PEI_SEC_2_GRADO.pdf', 'ALLEGATO_C_1_Tabella_Fabbisogni.pdf', 'Brand+Guidelines+FSE+.pdf', 'Decreto 20797 del 22-12-2023_Aggiornamento budget PNRR.pdf', 'Decreto 20874 del 29-12-2023 Avviso IeFP PNRR 2023-2024_file unico.pdf'],
|
228 |
+
[])
|
229 |
+
st.markdown("---")
|
230 |
+
'''
|