Skip to content

feat: review summary generation (P0 #6)#8

Merged
roboshyim merged 1 commit into
mainfrom
feat/review-summary
Jul 21, 2026
Merged

feat: review summary generation (P0 #6)#8
roboshyim merged 1 commit into
mainfrom
feat/review-summary

Conversation

@roboshyim

Copy link
Copy Markdown
Collaborator

What

Adds AI-generated per-product review summaries — P0 roadmap item #6, and the flagship Shopware-Copilot-parity wedge (Copilot's review summary is paywalled behind Rise+). Summarizes a product's approved reviews into a concise summary + pros/cons/themes + average rating, using the structured output support added in #4.

Changes

  • ReviewSummaryGenerator (src/Feature/ReviewSummary/): master + per-feature flag gates + provider availability; fetches up to 50 approved reviews (status=true, createdAt DESC, title/content/points) via product_review.repository; throws on zero reviews; calls AiClient::chatStructured with a schema for summary, pros[], cons[], themes[], reviewCount, averageRating; returns the structured result + provider/model.
  • ReviewSummaryController: POST /api/_action/frosh-ai/product/review-summary + GET .../review-summary-status.
  • FeatureId::ReviewSummary + featureReviewSummary config checkbox (en + de-DE).
  • services.xml registrations.

Tests

ReviewSummaryGeneratorTest (7 tests): master-off / flag-off / no-provider / zero-reviews / invalid-structured-output / success (full payload) / isEnabled(). Updated FeatureFlagsTest (7→8 flags).

113 tests / 438 assertions, green — locally and in the frosh-ai-dev container (Shopware 6.7 / PHP 8.3).

Notes

  • Storefront snippet + admin "summarize" button are deliberate follow-ups — this lands the generator + API + flag + tests.
  • Uses Capability::StructuredOutput, so it prefers providers/models with structured-output support (Anthropic, Mistral, OpenAI, Gemini).

P0 roadmap item #6 — per-product AI summary of approved customer reviews
(summary/pros/cons/themes/reviewCount/averageRating) via chatStructured.

- ReviewSummaryGenerator: master + feature flag + provider gates, fetches
  up to 50 approved reviews (status=true, createdAt DESC, content capped
  at 500 chars each) from product_review.repository
- POST /api/_action/frosh-ai/product/review-summary {productId}
- GET  /api/_action/frosh-ai/product/review-summary-status
- FeatureId::ReviewSummary + featureReviewSummary config checkbox (en/de)
- Admin UI / storefront output intentionally left for follow-ups
@roboshyim
roboshyim merged commit 88000a6 into main Jul 21, 2026
2 checks passed
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