Spaces:
Sleeping
Sleeping
Update API key handling to use Hugging Face secrets
Browse files- src/streamlit_app.py +11 -11
src/streamlit_app.py
CHANGED
@@ -288,15 +288,15 @@ if st.session_state.current_voice:
|
|
288 |
]
|
289 |
)
|
290 |
else:
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
|
301 |
ai_response = message.content[0].text
|
302 |
st.markdown(ai_response)
|
@@ -344,7 +344,7 @@ if st.session_state.current_voice:
|
|
344 |
if st.session_state.in_reflection:
|
345 |
if st.button("Start New Conversation", use_container_width=True):
|
346 |
st.session_state.in_reflection = False
|
347 |
-
|
348 |
st.session_state.somatic_journal = []
|
349 |
st.session_state.current_voice = None
|
350 |
st.rerun()
|
@@ -392,7 +392,7 @@ if st.session_state.in_reflection:
|
|
392 |
if st.button("Complete Reflection", use_container_width=True):
|
393 |
st.session_state.in_reflection = False
|
394 |
st.session_state.debrief_stage = 0
|
395 |
-
|
396 |
|
397 |
# Optional note-taking area
|
398 |
st.markdown("### Your Notes")
|
|
|
288 |
]
|
289 |
)
|
290 |
else:
|
291 |
+
message = c.messages.create(
|
292 |
+
model="claude-3-opus-20240229",
|
293 |
+
max_tokens=1000,
|
294 |
+
system=st.session_state.system_message,
|
295 |
+
messages=[
|
296 |
+
{"role": msg["role"], "content": msg["content"]}
|
297 |
+
for msg in st.session_state.messages
|
298 |
+
]
|
299 |
+
)
|
300 |
|
301 |
ai_response = message.content[0].text
|
302 |
st.markdown(ai_response)
|
|
|
344 |
if st.session_state.in_reflection:
|
345 |
if st.button("Start New Conversation", use_container_width=True):
|
346 |
st.session_state.in_reflection = False
|
347 |
+
st.session_state.messages = []
|
348 |
st.session_state.somatic_journal = []
|
349 |
st.session_state.current_voice = None
|
350 |
st.rerun()
|
|
|
392 |
if st.button("Complete Reflection", use_container_width=True):
|
393 |
st.session_state.in_reflection = False
|
394 |
st.session_state.debrief_stage = 0
|
395 |
+
st.rerun()
|
396 |
|
397 |
# Optional note-taking area
|
398 |
st.markdown("### Your Notes")
|