Sakil commited on
Commit
ef90e0c
·
verified ·
1 Parent(s): 0cad2e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -29,6 +29,10 @@ def main():
29
  llm = Anthropic(temperature=0.0, model='claude-3-opus-20240229', api_key=api_key)
30
  query_engine = PandasQueryEngine(df=df, llm=llm, verbose=True)
31
 
 
 
 
 
32
  # Continous chat
33
  question = st.text_input("Ask a question about the data:")
34
  while True:
@@ -38,8 +42,8 @@ def main():
38
  st.markdown(f"**Response:** {response}")
39
 
40
  # For continuous chat
41
- st.text_input("Ask another question:", key="question")
42
- st.session_state.is_enter_pressed = False
43
 
44
  if st.session_state.is_enter_pressed:
45
  break
 
29
  llm = Anthropic(temperature=0.0, model='claude-3-opus-20240229', api_key=api_key)
30
  query_engine = PandasQueryEngine(df=df, llm=llm, verbose=True)
31
 
32
+ # Initialize session state
33
+ if "is_enter_pressed" not in st.session_state:
34
+ st.session_state.is_enter_pressed = False
35
+
36
  # Continous chat
37
  question = st.text_input("Ask a question about the data:")
38
  while True:
 
42
  st.markdown(f"**Response:** {response}")
43
 
44
  # For continuous chat
45
+ question = st.text_input("Ask another question:")
46
+ st.session_state.is_enter_pressed = st.button("Enter")
47
 
48
  if st.session_state.is_enter_pressed:
49
  break