Skip to content

[AI] Implement provider trait and Anthropic client #13

@copyleftdev

Description

@copyleftdev

Task

Implement AI provider abstraction and Anthropic Claude integration.

Provider Trait

#[async_trait]
pub trait AiProvider: Send + Sync {
    async fn complete(&self, prompt: &str) -> Result<String>;
    fn name(&self) -> &'static str;
}

Anthropic Implementation

  • Use reqwest for HTTP
  • Read ANTHROPIC_API_KEY from environment
  • Use Claude Sonnet model
  • System prompt for Genesis file generation

Acceptance Criteria

  • Provider trait defined
  • Anthropic client implements trait
  • Proper error handling for API failures
  • Rate limiting awareness
  • Timeout handling

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions