jjii commited on
Commit
4abaa38
·
1 Parent(s): 1ab5079

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -5,12 +5,7 @@ import os
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(
@@ -25,7 +20,7 @@ with gr.Blocks() as demo:
25
 
26
  def respond(message, chat_history):
27
  messages.append({"role": "user", "content": message})
28
- response = openai.ChatCompletion.create(model="gpt-4-0613", messages=messages)
29
  system_message = response["choices"][0]["message"]
30
  messages.append(system_message)
31
  bot_message = system_message['content']
 
5
 
6
  openai.api_key = os.getenv("OPENAI_API_KEY")
7
 
8
+ messages = [{"role": "system", "content": 'As a funny WellNudge habit formation consultant, your goal is to help users discover a specific, easily performed, and trackable habit in a fun way. Then, based on the nudging conditions, send them notifications at the best time and place to ease habit execution. Start with fewer than 5 concise questions to gather essential user information. If they say idk in the begining, give them 3 short suggestions. Guide them through identifying the tiny habit and conditions for nudging and notification. Consider various trackable data for nudging conditions, such as GPS, fitness metrics, calendar, weather, screen usage, or personal financial data, show how those data can be used as nudging conditions and ask which data the user is willing to share. Summarize and end the conversation by saying you will send a notification when conditions are met. Limit your response to 20 words or less.'}]
 
 
 
 
 
9
 
10
  with gr.Blocks() as demo:
11
  gr.Markdown(
 
20
 
21
  def respond(message, chat_history):
22
  messages.append({"role": "user", "content": message})
23
+ response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages)
24
  system_message = response["choices"][0]["message"]
25
  messages.append(system_message)
26
  bot_message = system_message['content']