Yara Kyrychenko commited on
Commit
bf91c0c
Β·
1 Parent(s): 5ff66b8

update text

Browse files
Files changed (1) hide show
  1. app.py +17 -12
app.py CHANGED
@@ -98,7 +98,7 @@ def setup_messages():
98
  st.session_state.messages = [{ "role": "system", "content": st.session_state.system_message}]
99
  st.session_state.convo_start_time = datetime.now()
100
 
101
- client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key=st.secrets["OPENROUTER_API_KEY"])
102
 
103
  ### App interface
104
  with st.sidebar:
@@ -107,22 +107,25 @@ with st.sidebar:
107
  {"β˜‘" if st.session_state.submitted else "☐"} **Step 1. Complete a form**
108
 
109
  {"β˜‘" if len(st.session_state.messages) > 0 else "☐"} **Step 2. Type in the chat box to start a conversation**""")
110
- st.success("Ask, request, or talk to the model about something that you consider **politically polarizing** or something that people from different US political parties would disagree about it.", icon='🎯')
 
 
 
111
 
112
  st.markdown(f"""
113
- ❗ Do not share any personal information (e.g., name or address). Do not use AI tools to generate your responses; write them yourself.
114
 
115
- ⚠️ You must respond **at least 5 times** before you will see a *Finish* button. You can continue before submitting, but **you must finish and enter your chatbot code into the survey to recieve compensation**.
116
 
117
  ❗ If you encounter any technical issues, please let us know. It might sometimes take 30 seconds or more to generate a response, so please be patient.
118
 
119
- {"β˜‘" if st.session_state.inserted > 1 else "☐"} **Step 3. Use the *Finish* button to get your chatbot code**
120
 
121
- ⚠️ Do not forget to copy & paste your chatbot code!
122
 
123
  β†Ί You can always return to this panel by clicking the arrow on the top left.
124
 
125
- {"πŸŽ‰ **All done! Please enter your code in the survey and press *Next*.**" if st.session_state.inserted > 1 else ""}
126
  """)
127
  if st.session_state.gotit == False or st.session_state.submitted == False:
128
  st.session_state.gotit = st.button("Let's start!", key=None, help=None, use_container_width=True)
@@ -185,13 +188,15 @@ elif st.session_state.submitted == False:
185
  pass
186
 
187
  elif st.session_state.inserted > 1:
188
- st.markdown("## Copy your code!")
189
- st.markdown('**Your chatbot code is:**')
190
- st.markdown(f'## {st.session_state.user_id}')
191
- st.markdown('**Please copy the code and enter it into the survey field below.**')
192
 
193
  elif prompt := st.chat_input("Ask a polarizing question..."):
194
 
 
 
195
  st.session_state.messages.append({"role": "user", "content": prompt})
196
  with st.chat_message("user"):
197
  st.markdown(prompt)
@@ -225,7 +230,7 @@ elif prompt := st.chat_input("Ask a polarizing question..."):
225
  if len(st.session_state.messages) > 10 or st.session_state.max_messages == len(st.session_state.messages):
226
  columns = st.columns((1,1,1))
227
  with columns[2]:
228
- if st.button("Finish",use_container_width=True):
229
  keys = ["inserted", "messages", "convo_start_time"]
230
 
231
  st.session_state.user_data.update({key: st.session_state[key] for key in keys})
 
98
  st.session_state.messages = [{ "role": "system", "content": st.session_state.system_message}]
99
  st.session_state.convo_start_time = datetime.now()
100
 
101
+ client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=st.secrets["OPENROUTER_API_KEY"])
102
 
103
  ### App interface
104
  with st.sidebar:
 
107
  {"β˜‘" if st.session_state.submitted else "☐"} **Step 1. Complete a form**
108
 
109
  {"β˜‘" if len(st.session_state.messages) > 0 else "☐"} **Step 2. Type in the chat box to start a conversation**""")
110
+
111
+ st.success("Ask, request, or talk to the chatbot about something you consider **politically polarizing** or something that people from different US political parties might disagree about.", icon='🎯')
112
+
113
+ st.markdown("πŸ“– Some example topics include gun laws, abortion, and immigration.")
114
 
115
  st.markdown(f"""
116
+ ⚠️ You must respond **at least 5 times** before you will see a *Submit Interaction* button. You can continue before submitting, but **you must Submit Interaction and enter your chatbot word to proceed with the survey**.
117
 
118
+ ❗ Do not share any personal information (e.g., name or address). Do not use AI tools to generate your responses; write them yourself.
119
 
120
  ❗ If you encounter any technical issues, please let us know. It might sometimes take 30 seconds or more to generate a response, so please be patient.
121
 
122
+ {"β˜‘" if st.session_state.inserted > 1 else "☐"} **Step 3. Use the *Submit Interaction* button to get your chatbot word**
123
 
124
+ ⚠️ Do not forget to copy & paste your chatbot WORD!
125
 
126
  β†Ί You can always return to this panel by clicking the arrow on the top left.
127
 
128
+ {"πŸŽ‰ **All done! Please enter your WORD in the survey and press *Next*.**" if st.session_state.inserted > 1 else ""}
129
  """)
130
  if st.session_state.gotit == False or st.session_state.submitted == False:
131
  st.session_state.gotit = st.button("Let's start!", key=None, help=None, use_container_width=True)
 
188
  pass
189
 
190
  elif st.session_state.inserted > 1:
191
+ st.markdown("## Copy your WORD!")
192
+ st.markdown('**Your chatbot WORD is:**')
193
+ st.markdown(f'## POTATOES')
194
+ st.markdown('**Please copy the WORD and enter it into the survey field below.**')
195
 
196
  elif prompt := st.chat_input("Ask a polarizing question..."):
197
 
198
+ st.success("Ask, request, or talk to the chatbot about something you consider **politically polarizing** or something that people from different US political parties might disagree about it.", icon='🎯')
199
+
200
  st.session_state.messages.append({"role": "user", "content": prompt})
201
  with st.chat_message("user"):
202
  st.markdown(prompt)
 
230
  if len(st.session_state.messages) > 10 or st.session_state.max_messages == len(st.session_state.messages):
231
  columns = st.columns((1,1,1))
232
  with columns[2]:
233
+ if st.button("Submit Interaction",use_container_width=True):
234
  keys = ["inserted", "messages", "convo_start_time"]
235
 
236
  st.session_state.user_data.update({key: st.session_state[key] for key in keys})