update functions
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import anthropic
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
client = anthropic.Anthropic(api_key=os.getenv("CLAUDE_API_KEY"))
|
||||
print("API Key loaded:", os.getenv("CLAUDE_API_KEY")[:20] + "..." if os.getenv("CLAUDE_API_KEY") else "NOT FOUND")
|
||||
|
||||
# Test the API
|
||||
try:
|
||||
response = client.messages.create(
|
||||
model="claude-3-5-sonnet-20241022",
|
||||
max_tokens=100,
|
||||
messages=[{"role": "user", "content": "Hello"}]
|
||||
)
|
||||
print("API test successful!")
|
||||
except Exception as e:
|
||||
print(f"API test failed: {e}")
|
||||
Reference in New Issue
Block a user