Fix 404 error: Update model from deprecated claude-3-opus to claude-sonnet-4
Browse filesThe claude-3-opus-20240229 model is no longer available, causing 404 errors.
Updated all model references to claude-sonnet-4-20250514.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- app.py +3 -3
- src/streamlit_app.py +4 -4
app.py
CHANGED
|
@@ -223,7 +223,7 @@ else:
|
|
| 223 |
})
|
| 224 |
|
| 225 |
response = client.messages.create(
|
| 226 |
-
model="claude-
|
| 227 |
messages=formatted_messages,
|
| 228 |
max_tokens=1024
|
| 229 |
)
|
|
@@ -327,7 +327,7 @@ Tone: Warm, precise, emotionally attuned. Do not overuse praise, avoid pathologi
|
|
| 327 |
try:
|
| 328 |
# Get the initial response using the system message as a parameter
|
| 329 |
response = client.messages.create(
|
| 330 |
-
model="claude-
|
| 331 |
system=debrief_system_message,
|
| 332 |
messages=[{"role": "user", "content": "Please help me process this conversation."}],
|
| 333 |
max_tokens=1000
|
|
@@ -361,7 +361,7 @@ Tone: Warm, precise, emotionally attuned. Do not overuse praise, avoid pathologi
|
|
| 361 |
with st.spinner("Reflecting..."):
|
| 362 |
try:
|
| 363 |
response = client.messages.create(
|
| 364 |
-
model="claude-
|
| 365 |
system=debrief_system_message,
|
| 366 |
messages=[
|
| 367 |
{"role": "user", "content": msg["content"]}
|
|
|
|
| 223 |
})
|
| 224 |
|
| 225 |
response = client.messages.create(
|
| 226 |
+
model="claude-sonnet-4-20250514",
|
| 227 |
messages=formatted_messages,
|
| 228 |
max_tokens=1024
|
| 229 |
)
|
|
|
|
| 327 |
try:
|
| 328 |
# Get the initial response using the system message as a parameter
|
| 329 |
response = client.messages.create(
|
| 330 |
+
model="claude-sonnet-4-20250514",
|
| 331 |
system=debrief_system_message,
|
| 332 |
messages=[{"role": "user", "content": "Please help me process this conversation."}],
|
| 333 |
max_tokens=1000
|
|
|
|
| 361 |
with st.spinner("Reflecting..."):
|
| 362 |
try:
|
| 363 |
response = client.messages.create(
|
| 364 |
+
model="claude-sonnet-4-20250514",
|
| 365 |
system=debrief_system_message,
|
| 366 |
messages=[
|
| 367 |
{"role": "user", "content": msg["content"]}
|
src/streamlit_app.py
CHANGED
|
@@ -57,7 +57,7 @@ try:
|
|
| 57 |
# Test the client
|
| 58 |
st.write("Debug: Testing API connection...")
|
| 59 |
test_response = anthropic.messages.create(
|
| 60 |
-
model="claude-
|
| 61 |
max_tokens=10,
|
| 62 |
messages=[{"role": "user", "content": "test"}]
|
| 63 |
)
|
|
@@ -147,7 +147,7 @@ if st.session_state.messages and not st.session_state.in_debrief and not st.sess
|
|
| 147 |
|
| 148 |
# Get initial debrief response
|
| 149 |
response = anthropic.messages.create(
|
| 150 |
-
model="claude-
|
| 151 |
max_tokens=1000,
|
| 152 |
messages=st.session_state.debrief_messages
|
| 153 |
)
|
|
@@ -181,7 +181,7 @@ if st.session_state.in_debrief:
|
|
| 181 |
with st.chat_message("assistant"):
|
| 182 |
with st.spinner("Reflecting..."):
|
| 183 |
response = anthropic.messages.create(
|
| 184 |
-
model="claude-
|
| 185 |
max_tokens=1000,
|
| 186 |
messages=st.session_state.debrief_messages
|
| 187 |
)
|
|
@@ -226,7 +226,7 @@ elif st.session_state.messages and not st.session_state.practice_complete:
|
|
| 226 |
st.write(f"Debug: Using API key starting with: {api_key[:10]}...")
|
| 227 |
|
| 228 |
response = anthropic.messages.create(
|
| 229 |
-
model="claude-
|
| 230 |
max_tokens=1000,
|
| 231 |
messages=st.session_state.messages
|
| 232 |
)
|
|
|
|
| 57 |
# Test the client
|
| 58 |
st.write("Debug: Testing API connection...")
|
| 59 |
test_response = anthropic.messages.create(
|
| 60 |
+
model="claude-sonnet-4-20250514",
|
| 61 |
max_tokens=10,
|
| 62 |
messages=[{"role": "user", "content": "test"}]
|
| 63 |
)
|
|
|
|
| 147 |
|
| 148 |
# Get initial debrief response
|
| 149 |
response = anthropic.messages.create(
|
| 150 |
+
model="claude-sonnet-4-20250514",
|
| 151 |
max_tokens=1000,
|
| 152 |
messages=st.session_state.debrief_messages
|
| 153 |
)
|
|
|
|
| 181 |
with st.chat_message("assistant"):
|
| 182 |
with st.spinner("Reflecting..."):
|
| 183 |
response = anthropic.messages.create(
|
| 184 |
+
model="claude-sonnet-4-20250514",
|
| 185 |
max_tokens=1000,
|
| 186 |
messages=st.session_state.debrief_messages
|
| 187 |
)
|
|
|
|
| 226 |
st.write(f"Debug: Using API key starting with: {api_key[:10]}...")
|
| 227 |
|
| 228 |
response = anthropic.messages.create(
|
| 229 |
+
model="claude-sonnet-4-20250514",
|
| 230 |
max_tokens=1000,
|
| 231 |
messages=st.session_state.messages
|
| 232 |
)
|