-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Summary
Add Claude (Anthropic) as a fourth AI provider option alongside Gemini, OpenAI, and Ollama.
Context
The AiSummarizer service already supports three providers via a callProvider() dispatch method. Each provider has its own private method (summarizeItemsWithGemini, summarizeItemsWithOpenAI, summarizeItemsWithOllama) that builds the HTTP request, parses the response, and returns enriched items. Adding a new provider means following this exact pattern.
What to do
- Add env vars to
config/ai.php:ANTHROPIC_API_KEY,DIGEST_AI_MODEL_ANTHROPIC(default:claude-sonnet-4-5-20250929) - Add
summarizeItemsWithAnthropic()toAiSummarizer— use the Messages API withresponse_format: { type: "json" } - Add
'anthropic'case tocallProvider() - Add env vars to
.env.examplewith comments - Add tests: happy path + missing API key placeholder (follow existing test pattern in
AiSummarizerTest)
Files to modify
config/ai.phpapp/Services/AiSummarizer.php.env.exampletests/Unit/AiSummarizerTest.php
Reference
Look at summarizeItemsWithOpenAI() as the closest pattern — Anthropic's Messages API is similar (JSON body, bearer token, structured response).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers