feat(core): implement Anthropic API client with streaming

Add anthropic.rs with complete Claude API integration:
- AnthropicClient with builder pattern configuration
- Message types (Role, ContentBlock, Tool, etc.)
- Non-streaming message() method with retry logic
- Streaming message_stream() with SSE parsing
- Comprehensive error types (AuthError, RateLimited, ApiError)
- Exponential backoff for transient errors
- 8 unit tests for client and parsing

Dependencies added: reqwest (with stream), futures

Closes #19

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Shunsuke Hayashi 2025-11-22 17:56:33 +09:00
parent bed65b23b2
commit 8d7a7a6099
4 changed files with 569 additions and 0 deletions

View file

@ -51,6 +51,9 @@ serde_json = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# HTTP Client
reqwest = { version = "0.12", features = ["json", "stream"] }
# Utilities
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4", "serde"] }