Solshine commited on
Commit
2af25d4
·
verified ·
1 Parent(s): 5eb1f01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -137,24 +137,25 @@ def launch_bot():
137
 
138
  st.audio(sound_file)
139
 
140
- agree = st.checkbox('Escalate this response to Premium')
141
 
142
  if agree:
143
- Print('OpenAI, Oh Great!')
144
  with st.chat_message("assistant"):
145
- with st.spinner("Thinking..."):
 
146
  # Change this to include OpenAI_API key
147
  # Function to get the assistant's response
148
- completion = openai.ChatCompletion.create(
149
- model="gpt-3.5-turbo",
150
- messages=[
151
- {"role": "system", "content": "You are a helpful Natural Farming assistant with extensive experience in accessible science and technical writing, and the heart of a teacher."},
152
- {"role": "user", "content": prompt3}
153
- ]
154
- )
155
-
156
- response = completion.choices[0].message
157
- st.write(response)
158
 
159
  message = {"role": "assistant", "content": response}
160
  st.session_state.messages.append(message)
 
137
 
138
  st.audio(sound_file)
139
 
140
+ agree = st.checkbox('Upgrade to Premium!')
141
 
142
  if agree:
143
+ Print('Escalated to Premium!')
144
  with st.chat_message("assistant"):
145
+ st.link_button("Sign up for Premium", "https://www.patreon.com/CopyleftCultivarsNonprofit")
146
+ # with st.spinner("Thinking..."):
147
  # Change this to include OpenAI_API key
148
  # Function to get the assistant's response
149
+ # completion = openai.ChatCompletion.create(
150
+ # model="gpt-3.5-turbo",
151
+ # messages=[
152
+ # {"role": "system", "content": "You are a helpful Natural Farming assistant with extensive experience in accessible science and technical writing, and the heart of a teacher."},
153
+ # {"role": "user", "content": prompt3}
154
+ # ]
155
+ # )
156
+
157
+ # response = completion.choices[0].message
158
+ # st.write(response)
159
 
160
  message = {"role": "assistant", "content": response}
161
  st.session_state.messages.append(message)