Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -137,24 +137,25 @@ def launch_bot():
|
|
| 137 |
|
| 138 |
st.audio(sound_file)
|
| 139 |
|
| 140 |
-
agree = st.checkbox('
|
| 141 |
|
| 142 |
if agree:
|
| 143 |
-
Print('
|
| 144 |
with st.chat_message("assistant"):
|
| 145 |
-
|
|
|
|
| 146 |
# Change this to include OpenAI_API key
|
| 147 |
# Function to get the assistant's response
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 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)
|