Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,12 @@ import os
|
|
| 5 |
|
| 6 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 7 |
|
| 8 |
-
messages = [{"role": "system", "content": 'As a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
with gr.Blocks() as demo:
|
| 11 |
gr.Markdown(
|
|
@@ -29,13 +34,6 @@ with gr.Blocks() as demo:
|
|
| 29 |
time.sleep(1)
|
| 30 |
return "", chat_history
|
| 31 |
|
| 32 |
-
chat_transcript = ""
|
| 33 |
-
for message in messages:
|
| 34 |
-
if message['role'] != 'system':
|
| 35 |
-
chat_transcript += message['role'] + ": " + message['content'] + "\n\n"
|
| 36 |
-
|
| 37 |
-
return chat_transcript
|
| 38 |
-
|
| 39 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
| 40 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 41 |
|
|
|
|
| 5 |
|
| 6 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 7 |
|
| 8 |
+
messages = [{"role": "system", "content": 'As a humorous WellNudge habit formation consultant, your goal is to help users discover a specific, easily performable, and trackable habit in a fun way. \
|
| 9 |
+
Start with fewer than 5 concise questions to gather essential user information. \
|
| 10 |
+
If they say idk in the beginning, give them 3 short suggestions. Guide the user through identifying a tiny habit and conditions(context) for nudging(notification). \
|
| 11 |
+
Consider various trackable data for nudging conditions, such as GPS, fitness metrics, calendar, weather, screen usage, or personal financial data, \
|
| 12 |
+
show how those data can be used as nudging conditions and ask which data the user is willing to share. \
|
| 13 |
+
Summarize and end the conversation by saying you will send a notification when conditions are met. Limit your response to 20 words or less.'}]
|
| 14 |
|
| 15 |
with gr.Blocks() as demo:
|
| 16 |
gr.Markdown(
|
|
|
|
| 34 |
time.sleep(1)
|
| 35 |
return "", chat_history
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
| 38 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 39 |
|