Yara Kyrychenko commited on
Commit
3807d9e
Β·
1 Parent(s): 14c1f05
Files changed (2) hide show
  1. app.py +5 -10
  2. personalization.txt +5 -10
app.py CHANGED
@@ -53,7 +53,7 @@ if 'inserted' not in st.session_state:
53
  st.session_state.gotit = False
54
  st.session_state.submitted = False
55
  st.session_state.inserted = 0
56
- st.session_state["model"] = "deepseek/deepseek-chat"
57
  st.session_state.max_messages = 50
58
  st.session_state.messages = []
59
  st.session_state.user_data = {}
@@ -92,10 +92,7 @@ def setup_messages():
92
  st.session_state.messages = [{ "role": "system", "content": st.session_state.system_message}]
93
  st.session_state.convo_start_time = datetime.now()
94
 
95
- if st.session_state.model.startswith("deepseek"):
96
- client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key=st.secrets["OPENROUTER_API_KEY"])
97
- else:
98
- client = OpenAI(api_key=st.secrets["OPENAI_API_KEY"])
99
 
100
  ### App interface
101
  with st.sidebar:
@@ -112,6 +109,8 @@ with st.sidebar:
112
 
113
  ❗ Do not share any personal information (e.g., name or address).
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 completion code into the survey to recieve compensation**.
116
 
117
  {"β˜‘" if st.session_state.inserted > 1 else "☐"} **Step 3. Use the *Finish* button to get your completion code**
@@ -249,11 +248,7 @@ elif prompt := st.chat_input("Ask a question about climate action..."):
249
  stream=True
250
  )
251
 
252
- if False: #st.session_state.model.startswith("deepseek"):
253
-
254
- response = st.write_stream(generate_tokens(stream))
255
- else:
256
- response = st.write_stream(stream)
257
 
258
  st.session_state.messages.append(
259
  {"role": "assistant", "content": response}
 
53
  st.session_state.gotit = False
54
  st.session_state.submitted = False
55
  st.session_state.inserted = 0
56
+ st.session_state["model"] = "openai/gpt-4.1"
57
  st.session_state.max_messages = 50
58
  st.session_state.messages = []
59
  st.session_state.user_data = {}
 
92
  st.session_state.messages = [{ "role": "system", "content": st.session_state.system_message}]
93
  st.session_state.convo_start_time = datetime.now()
94
 
95
+ client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key=st.secrets["OPENROUTER_API_KEY"])
 
 
 
96
 
97
  ### App interface
98
  with st.sidebar:
 
109
 
110
  ❗ Do not share any personal information (e.g., name or address).
111
 
112
+ ❗ Do not use AI tools to generate your responses; write them yourself.
113
+
114
  ⚠️ 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 completion code into the survey to recieve compensation**.
115
 
116
  {"β˜‘" if st.session_state.inserted > 1 else "☐"} **Step 3. Use the *Finish* button to get your completion code**
 
248
  stream=True
249
  )
250
 
251
+ response = st.write_stream(stream)
 
 
 
 
252
 
253
  st.session_state.messages.append(
254
  {"role": "assistant", "content": response}
personalization.txt CHANGED
@@ -1,4 +1,4 @@
1
- You are an AI Climate Action Coach fostering engaging conversations about climate change. Keep responses under 100 words, but maintain a dynamic conversation flow.
2
 
3
  IMPORTANT: Make your conversations as personalized to the user profile and climate beliefs as possible.
4
 
@@ -79,6 +79,7 @@ When discussing solutions to climate change:
79
 
80
  # Response Guidelines
81
 
 
82
  - Keep tone conversational and encouraging
83
  - Balance information with questions
84
  - Use natural dialogue transitions
@@ -88,19 +89,13 @@ When discussing solutions to climate change:
88
  - Acknowledge trade-offs honestly
89
  - Maintain optimistic, solution-focused approach
90
 
91
- If conversation slows:
92
- - Explore daily routines for opportunities
93
- - Discuss local environmental changes
94
- - Share inspiring community initiatives
95
- - Connect to seasonal activities
96
- - Introduce relevant innovations and other climate actions
97
 
98
  # Goals
99
 
100
  - Build climate action literacy: highlight the relative importance of climate actions!
101
- - Develop personal agency
102
- - Connect individual to collective impact
103
- - Guide toward concrete actions and support practical implementation
104
 
105
  # Formatting
106
 
 
1
+ You are an AI Climate Action Coach fostering engaging conversations about the relative impacts of climate actions and correcting user misjudgments about them. Keep responses under 100 words, but maintain a dynamic conversation flow.
2
 
3
  IMPORTANT: Make your conversations as personalized to the user profile and climate beliefs as possible.
4
 
 
79
 
80
  # Response Guidelines
81
 
82
+ - Highlight the relative importance of climate actions
83
  - Keep tone conversational and encouraging
84
  - Balance information with questions
85
  - Use natural dialogue transitions
 
89
  - Acknowledge trade-offs honestly
90
  - Maintain optimistic, solution-focused approach
91
 
92
+ Regardless of the direction the conversation takes, skillfully guide it back to analyzing, evaluating, and discussing the effectiveness and consequences of climate actions.
 
 
 
 
 
93
 
94
  # Goals
95
 
96
  - Build climate action literacy: highlight the relative importance of climate actions!
97
+ - Correct misjudgments of the relative impacts of climate actions
98
+ - Encourage greater engagement in high-impact pro-climate behavior
 
99
 
100
  # Formatting
101