@@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 1.2.0] - 2026-02-14
9+
10+ ### Added
11+ - ** Anthropic API support:** ` ask2api ` now supports Anthropic's Claude models (Opus 4.6, Sonnet 4.5, Haiku 4.5) in addition to OpenAI
12+ - ** Provider selection:** New ` ASK2API_PROVIDER ` environment variable to explicitly choose between ` openai ` and ` anthropic `
13+ - ** Provider-agnostic API key:** New ` ASK2API_API_KEY ` environment variable that works with any provider
14+ - ** Anthropic-specific functions:**
15+ - ` convert_schema_to_anthropic_tool() ` - Converts JSON Schema to Anthropic tool definition
16+ - ` build_anthropic_payload() ` - Builds API payload using tool calling format
17+ - ` build_anthropic_headers() ` - Sets Anthropic-specific headers (x-api-key, anthropic-version)
18+ - ` parse_anthropic_response() ` - Extracts structured output from tool_use response
19+ - ` prepare_anthropic_image_content() ` - Handles Anthropic's image format
20+ - ` convert_content_for_anthropic() ` - Converts multimodal content between formats
21+ - ** Provider constants:** ` OPENAI_BASE_URL ` , ` ANTHROPIC_BASE_URL ` , ` OPENAI_DEFAULT_MODEL ` , ` ANTHROPIC_DEFAULT_MODEL ` , ` ANTHROPIC_VERSION `
22+ - ** Intelligent API key fallback:** Automatically falls back to ` ANTHROPIC_API_KEY ` or ` OPENAI_API_KEY ` based on selected provider
23+ - ** Vision support for Anthropic:** Image analysis works with both URL and base64-encoded local files
24+ - ** Enhanced help text:** CLI help now shows provider-specific environment variables
25+
26+ ### Changed
27+ - ** Config class refactored:** Added ` provider ` field with automatic provider-specific defaults
28+ - ** Provider routing:** ` generate_api_response() ` now routes between OpenAI and Anthropic based on configuration
29+ - ** Image handling:** ` prepare_image_content() ` now accepts provider parameter for format-specific handling
30+ - ** Function naming:** Renamed OpenAI-specific functions for clarity:
31+ - ` build_payload() ` → ` build_openai_payload() `
32+ - ` build_headers() ` → ` build_openai_headers() `
33+ - ** Response parsing:** Extracted OpenAI response parsing into ` parse_openai_response() ` function
34+ - ** Default provider:** Defaults to ` openai ` when no provider is specified (100% backward compatible)
35+ - ** Documentation:** Updated README with comprehensive provider support guide and examples
36+
37+ ### Technical Details
38+ - Anthropic support uses tool calling to achieve structured output (no native ` json_schema ` format)
39+ - Single-file architecture maintained (~ 330 → 501 lines)
40+ - Zero new dependencies (still only ` requests ` )
41+ - Clean separation between OpenAI and Anthropic code paths
42+
843## [ 1.1.3] - 2025-12-30
944
1045### Added
0 commit comments