Waflon commited on
Commit
e58a867
·
verified ·
1 Parent(s): 2f1430c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -8,11 +8,11 @@ st.set_page_config(layout="wide")
8
  if 'historial' not in st.session_state:
9
  st.session_state['historial'] = ['Hola soy tu asistente del dia de hoy, en que te puedo ayudar']
10
 
11
- def get_data():
12
  return st.session_state["historial"]
13
 
14
- def add_data(value: str):
15
- st.session_state["historial"] = value
16
 
17
 
18
  os.environ["OPENAI_API_KEY"] = st.secrets['OPENAI_API_KEY'] # agregada en la config de hugginface
@@ -25,6 +25,8 @@ tmp_button = st.button("CLICK")
25
  chain = get_chain(st.secrets['OPENAI_API_KEY'])
26
  if tmp_button: #Esperar al boton
27
  out = chain.invoke(pregunta)
 
 
28
  st.write(f"<p style='text-align: right;style='text-size: 30px; background-color: yellow;color: black;'>{out['query']}</p>", unsafe_allow_html=True)
29
  #st.rerun() #Restart app
30
  else:
 
8
  if 'historial' not in st.session_state:
9
  st.session_state['historial'] = ['Hola soy tu asistente del dia de hoy, en que te puedo ayudar']
10
 
11
+ def get_historial():
12
  return st.session_state["historial"]
13
 
14
+ def add_historial(value: str):
15
+ st.session_state["historial"].append(value)
16
 
17
 
18
  os.environ["OPENAI_API_KEY"] = st.secrets['OPENAI_API_KEY'] # agregada en la config de hugginface
 
25
  chain = get_chain(st.secrets['OPENAI_API_KEY'])
26
  if tmp_button: #Esperar al boton
27
  out = chain.invoke(pregunta)
28
+ print(out)
29
+ print(get_historial())
30
  st.write(f"<p style='text-align: right;style='text-size: 30px; background-color: yellow;color: black;'>{out['query']}</p>", unsafe_allow_html=True)
31
  #st.rerun() #Restart app
32
  else: