feat: add native Anthropic Claude provider - #3
Merged
Conversation
- AnthropicProvider: config keys anthropicApiKey/BaseUrl/DefaultModel, capabilities TextGeneration/Vision/ToolCalling/StructuredOutput/Reasoning/ Temperature (no image generation) - AnthropicClient: Messages API (/v1/messages) with x-api-key + anthropic-version headers, system prompt mapping, required max_tokens (default 4096), structured output via forced 'structured_output' tool use, usage + stop_reason mapping; generateImage() throws ImageGenerationNotSupportedException - DI registration with frosh_ai.provider tag, config.xml card - Admin settings component frosh-ai-provider-anthropic (en-GB + de-DE snippets) - Unit tests: chat mapping, structured output tool-use, finish reasons, HTTP error handling, image not-supported
roboshyim
force-pushed
the
feat/anthropic-provider
branch
from
July 21, 2026 16:45
99f86b7 to
ca141d3
Compare
roboshyim
added a commit
that referenced
this pull request
Jul 21, 2026
- Add FeatureId::CategoryDescription with config key and label
- Add featureCategoryDescription checkbox to config.xml (en + de-DE)
- Create CategoryDescriptionGenerator mirroring ProductDescriptionGenerator
- Reuses ProductDescriptionToneStore for shared tone presets
- Accepts category context: name, parentCategories, keywords, metaTitle,
metaDescription, existingDescription, tone, language, maxWords
- Create CategoryDescriptionController with POST /api/_action/frosh-ai/category/generate-description
and GET /api/_action/frosh-ai/category/description-status
- Register generator + controller in services.xml
- Add CategoryDescriptionGeneratorTest (5 tests) and update FeatureFlagsTest
for the new feature flag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a first-class Anthropic Claude provider (P0 roadmap item #1), following the existing Gemini provider pattern.
Implementation
AnthropicProvider(src/Provider/Anthropic/) — IDanthropic, models.dev idanthropic, API-key auth. Capabilities: TextGeneration, Vision, ToolCalling, StructuredOutput, Reasoning, Temperature (no image generation).AnthropicClient— maps to the Anthropic Messages API (POST /v1/messages,x-api-key+anthropic-version: 2023-06-01headers):systemparammax_tokens(required by Anthropic; defaults 4096)tool_choice) — extracts the tool_use block as JSONinput_tokens/output_tokens) →TokenUsage;stop_reason→FinishReasongenerateImage()throwsImageGenerationNotSupportedExceptionservices.xml(frosh_ai.providertag) + config card inconfig.xml(API key / base URL / default model, de-DE translations).frosh-ai-provider-anthropic(html.twig/scss/index.js) wired into the provider page + en-GB/de-DE snippets.Tests
tests/Unit/Provider/AnthropicClientTest.php(168 lines): chat mapping, structured output via tool-use, finish-reason mapping, error handling, image-generation-not-supported. Suite: 75 → 80 tests, green in the container (Shopware 6.7.2.2 / PHP 8.3).