feat: Modernize package with ES modules and improve error handling

- Update to ES modules syntax throughout the codebase
- Add fileURLToPath and dirname imports to handle __dirname in ES modules
- Upgrade Anthropic SDK from 0.10.0 to 0.39.0
- Fix JSON parsing to handle responses wrapped in Markdown code blocks
- Improve documentation with clearer installation instructions
- Add important notes about ES modules and SDK requirements
- Update environment examples with API key format and model recommendations
- Include index.js in package files list
- Bump version to 1.0.2
This commit is contained in:
Eyal Toledano
2025-03-04 14:11:57 -05:00
parent 07648a1417
commit c72373d761
10 changed files with 100 additions and 51 deletions

View File

@@ -1,8 +1,8 @@
# API Keys (Required)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here # Format: sk-ant-api03-...
# Model Configuration
MODEL=claude-3-7-sonnet-20250219 # Specify which Claude model to use
MODEL=claude-3-7-sonnet-20250219 # Recommended models: claude-3-7-sonnet-20250219, claude-3-opus-20240229
MAX_TOKENS=4000 # Maximum tokens for model responses
TEMPERATURE=0.7 # Temperature for model responses (0.0-1.0)