jostlebot commited on
Commit
da921f3
·
1 Parent(s): e35a397

fix: Simplify Anthropic client initialization and downgrade package version

Browse files
Files changed (3) hide show
  1. app.py +1 -4
  2. requirements.txt +1 -1
  3. src/streamlit_app.py +1 -4
app.py CHANGED
@@ -46,10 +46,7 @@ try:
46
  st.stop()
47
 
48
  # Initialize client with API key from environment
49
- client = Anthropic(
50
- api_key=api_key,
51
- base_url="https://api.anthropic.com"
52
- )
53
  st.write("Debug: Successfully created Anthropic client")
54
 
55
  except Exception as e:
 
46
  st.stop()
47
 
48
  # Initialize client with API key from environment
49
+ client = Anthropic(api_key=api_key)
 
 
 
50
  st.write("Debug: Successfully created Anthropic client")
51
 
52
  except Exception as e:
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  streamlit>=1.32.0
2
- anthropic==0.8.0
3
  python-dotenv>=1.0.0
4
  # openai>=1.0.0 # Replaced with anthropic
5
  # pyttsx3==2.98 # No longer needed
 
1
  streamlit>=1.32.0
2
+ anthropic==0.7.4
3
  python-dotenv>=1.0.0
4
  # openai>=1.0.0 # Replaced with anthropic
5
  # pyttsx3==2.98 # No longer needed
src/streamlit_app.py CHANGED
@@ -10,10 +10,7 @@ st.set_page_config(page_title="Practice Difficult Conversations", page_icon="
10
  # Initialize Anthropic client
11
  try:
12
  api_key = st.secrets["anthropic_key"]
13
- anthropic = Anthropic(
14
- api_key=api_key,
15
- base_url="https://api.anthropic.com"
16
- )
17
  except Exception as e:
18
  st.error("""
19
  ⚠️ API key error. This could be because:
 
10
  # Initialize Anthropic client
11
  try:
12
  api_key = st.secrets["anthropic_key"]
13
+ anthropic = Anthropic(api_key=api_key)
 
 
 
14
  except Exception as e:
15
  st.error("""
16
  ⚠️ API key error. This could be because: