Skip to content

Conversation

lukaszlenart
Copy link
Member

@lukaszlenart lukaszlenart commented Sep 18, 2025

Summary

This PR adds comprehensive documentation for Claude API implementation to support issue #390.

Files Added

📋 docs/plans/claude-api-implementation-plan.md

Complete technical implementation plan for native Claude API support including:

  • Project structure and build configuration
  • Accurate Claude API request/response models
  • Authentication with required headers
  • Implementation phases with concrete deliverables
  • Testing strategy focused on Claude-specific functionality

📚 Enhanced CLAUDE.md

Added critical code formatting workflow documentation to prevent CI failures during implementation.

Key Technical Corrections

✅ Authentication Configuration

  • Added missing anthropic-version header requirement
  • Updated ClaudeConfig to include both required headers

✅ Request/Response Models

  • Fixed content structure from simple String to List[ContentBlock]
  • Added system parameter support for Claude-specific system messages
  • Added image content support via ContentBlock structure
  • Added Claude-specific tool calling format

✅ Build Configuration

  • Updated with Scala 3 priority and projectMatrix integration
  • Added Claude streaming modules for all effect systems

✅ Implementation Strategy

  • 5-phase implementation plan with clear deliverables
  • Claude-focused testing strategy
  • Future-proof design for sttp-ai direction

Reference

This PR provides the documentation foundation for implementing issue #390 - Support Claude native API.

The detailed plan has also been added as a comment to the original issue for easy reference.


Ready for implementation team assignment.

@lukaszlenart lukaszlenart changed the title Claude API Implementation Plan - Technical Corrections and Updates Claude API Implementation Plan Documentation Sep 18, 2025
- Add missing anthropic-version header requirement for authentication
- Fix request/response models to match actual Claude API structure:
  * ContentBlock arrays instead of simple strings
  * System parameter support for Claude-specific system messages
  * Claude-specific tool calling format
  * Image content support via ContentBlock structure
- Update build configuration with Scala 3 priority and projectMatrix integration
- Refine testing strategy to focus on Claude-specific functionality
- Update implementation phases with Claude-specific technical details
- Add mandatory code formatting workflow documentation

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

Co-Authored-By: Claude <[email protected]>
@lukaszlenart lukaszlenart force-pushed the feature/claude-api-implementation-plan-updates branch from 3026ba6 to 586a943 Compare September 18, 2025 13:31
lukaszlenart added a commit that referenced this pull request Sep 22, 2025
Add native Claude API support per issue #390, implementing Phase 1 of the implementation plan from PR #408.

Core Implementation:
- New `claude/` module with Scala 3 priority (3.3.6 + 2.13.16 cross-compilation)
- ClaudeClient trait and ClaudeSyncClient for API operations
- Messages API (/v1/messages) and Models API (/v1/models) support
- Proper authentication with x-api-key and anthropic-version headers

Claude-Specific Features:
- ContentBlock architecture for messages (vs simple strings)
- System parameter support (vs role-based system messages)
- Image support via ContentBlock with base64 encoding
- Tool calling foundation models (Tool, ToolInputSchema, PropertySchema)

Models & Configuration:
- ClaudeConfig with environment variable support
- Claude model enums (Claude 3.5 Sonnet, Haiku, Opus, etc.)
- Comprehensive error handling with ClaudeException hierarchy
- JSON serialization using uPickle with proper ReadWriter instances

Testing:
- Unit tests for models, config, and core functionality
- All tests passing (ContentBlockSpec, ClaudeModelSpec, MessageSpec)
- Code formatted with sbt scalafmt as per project requirements

This foundation enables future phases including streaming support (Phase 2) and advanced features (Phase 3+).

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

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant