client.py
- Pfad:
/var/www/scripts/pipeline/analyzers/client.py - Namespace: pipeline
- Zeilen: 26 | Größe: 650 Bytes
- Geändert: 2025-12-25 13:58:50 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Dependencies 4
- use sys
- use config.ANTHROPIC_API_KEY
- use db.db
- use anthropic
Funktionen 1
-
get_anthropic_client()Zeile 13
Code
"""
API Client - Anthropic client initialization.
"""
import sys
sys.path.insert(0, "/var/www/scripts/pipeline")
from config import ANTHROPIC_API_KEY
from db import db
def get_anthropic_client():
"""Get Anthropic API client."""
try:
import anthropic
if ANTHROPIC_API_KEY:
db.log("INFO", "Using Anthropic API (Claude)")
return anthropic.Anthropic(api_key=ANTHROPIC_API_KEY)
else:
db.log("WARNING", "No Anthropic API key found, falling back to Ollama")
except ImportError:
db.log("WARNING", "anthropic package not installed, falling back to Ollama")
return None