sainkan commited on
Commit
17ba82d
·
verified ·
1 Parent(s): aedf732

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -3,9 +3,15 @@ import anthropic
3
  import os
4
  from dotenv import load_dotenv
5
 
 
 
 
6
  # API keys
7
  claude_api_key = os.getenv("ANTHROPIC_API_KEY")
8
- print(f"Claude API Key: {claude_api_key}") # Debugging line
 
 
 
9
 
10
  # Initialize Claude AI client
11
  client = anthropic.Anthropic(api_key=claude_api_key)
 
3
  import os
4
  from dotenv import load_dotenv
5
 
6
+ # Load environment variables from .env file
7
+ load_dotenv()
8
+
9
  # API keys
10
  claude_api_key = os.getenv("ANTHROPIC_API_KEY")
11
+ if claude_api_key is None:
12
+ raise ValueError("Claude API Key is not set. Please check your .env file.")
13
+
14
+ print(f"Claude API Key: {claude_api_key}") # Debugging line to check if the key is loaded
15
 
16
  # Initialize Claude AI client
17
  client = anthropic.Anthropic(api_key=claude_api_key)