vmalapaka commited on
Commit
7336a59
·
verified ·
1 Parent(s): 66ec391

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -16
app.py CHANGED
@@ -25,22 +25,13 @@ container = st.container()
25
 
26
 
27
  with container:
28
- user_input = st.text_area("Your question goes here:", key='input', height=100)
29
- submit_button = st.form_submit_button(label='Send')
30
-
31
- if submit_button:
32
- st.session_state['messages'].append(user_input)
33
- model_response=getresponse(user_input,st.session_state['API_Key'])
34
- st.session_state['messages'].append(model_response)
35
-
36
-
37
- with response_container:
38
- for i in range(len(st.session_state['messages'])):
39
- if (i % 2) == 0:
40
- message(st.session_state['messages'][i], is_user=True, key=str(i) + '_user')
41
- else:
42
- message(st.session_state['messages'][i], key=str(i) + '_AI')
43
-
44
 
45
  llm = ChatOpenAI(
46
  temperature=0,
 
25
 
26
 
27
  with container:
28
+ with st.form(key="my_form", clear_on_submit = True)
29
+ user_input = st.text_area("Your question goes here:", key='input', height=100)
30
+ submit_button = st.form_submit_button(label='Send')
31
+
32
+
33
+ with response_container:
34
+ st.write("Response Container")
 
 
 
 
 
 
 
 
 
35
 
36
  llm = ChatOpenAI(
37
  temperature=0,