forked from 0xWheatyz/SPARC
feat: add LLM integration for patent analysis
Implemented LLMAnalyzer class using Anthropic's Claude API for: - Single patent content analysis - Portfolio-wide analysis across multiple patents - Configurable API key management via environment variables Key features: - Uses Claude 3.5 Sonnet for high-quality analysis - Structured prompts for innovation assessment - Token limits optimized per use case (1024 for single, 2048 for portfolio) - Analyzes: innovation quality, market potential, strategic direction Updated config.py to support ANTHROPIC_API_KEY environment variable. Added comprehensive test suite (6 tests) covering: - Initialization from config and direct API key - Single patent analysis - Portfolio analysis - Token limit validation All 19 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -1,6 +1,14 @@
|
||||
# Handle all of the configurations and secrets
|
||||
"""Configuration and secrets management.
|
||||
|
||||
Loads environment variables from .env file for API keys and other secrets.
|
||||
"""
|
||||
from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# SerpAPI key for patent search
|
||||
api_key = os.getenv("API_KEY")
|
||||
|
||||
# Anthropic API key for LLM analysis
|
||||
anthropic_api_key = os.getenv("ANTHROPIC_API_KEY")
|
||||
|
||||
Reference in New Issue
Block a user