src.ai.providers.anthropic_provider module#
Anthropic Claude Provider for Marcus AI.
Implements semantic task analysis, dependency inference, and intelligent enhancement using Anthropic’s Claude models.
- class src.ai.providers.anthropic_provider.AnthropicProvider[source]#
Bases:
BaseLLMProviderAnthropic Claude provider for semantic AI analysis.
Uses Claude to provide intelligent task analysis, dependency inference, and project understanding while maintaining safety and reliability.
- __init__(api_key=None)[source]#
Initialize the Anthropic provider.
- Parameters:
api_key (
str|None) – Explicit Anthropic API key. If omitted, falls back toconfig.ai.anthropic_api_keythenCLAUDE_API_KEYenv var.ANTHROPIC_API_KEYis intentionally NOT consulted: setting it in the parent shell switches Claude Code from subscription billing to API billing, so Marcus usesCLAUDE_API_KEYto avoid interfering with Claude Code subprocesses Marcus spawns.- Raises:
ValueError – If no API key is provided and none is discoverable from config or
CLAUDE_API_KEY.- Return type:
None
- async analyze_task(task, context)[source]#
Analyze task semantics using Claude.
- Parameters:
- Return type:
- Returns:
Semantic analysis with intent, dependencies, and risks
- async infer_dependencies(tasks)[source]#
Infer semantic dependencies between tasks using Claude.
- Parameters:
- Return type:
- Returns:
List of inferred semantic dependencies
- async generate_enhanced_description(task, context)[source]#
Generate enhanced task description using Claude.
- async estimate_effort(task, context)[source]#
Estimate task effort using Claude.
- Parameters:
- Return type:
- Returns:
Effort estimate with confidence and factors
- async analyze_blocker(task, blocker, context)[source]#
Analyze blocker and suggest solutions using Claude.