Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
goulven authored and goulven committed Dec 23, 2024
1 parent a66904e commit 9bd9b84
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@
*
*/

// TODO : Scheduling from conf
public class CompletionFacadeService {

protected static final Logger logger = LoggerFactory.getLogger(CompletionFacadeService.class);

private final PerplexityReviewCompletionService aiCompletionService;
private final PerplexityReviewCompletionService perplexityReviewCompletionService;
private PerplexityAttributesCompletionService perplexityAttributesCompletionService;
private ResourceCompletionService resourceCompletionService;
private AmazonCompletionService amazonCompletionService;
private IcecatCompletionService icecatCompletionService;

public CompletionFacadeService(PerplexityReviewCompletionService aiCompletionService,
ResourceCompletionService resourceCompletionService, AmazonCompletionService amazonCompletionService, IcecatCompletionService icecatCompletionService, PerplexityAttributesCompletionService perplexityAttributesCompletionService) {
this.aiCompletionService = aiCompletionService;
this.perplexityReviewCompletionService = aiCompletionService;
this.resourceCompletionService = resourceCompletionService;
this.amazonCompletionService = amazonCompletionService;
this.icecatCompletionService = icecatCompletionService;
Expand All @@ -52,9 +51,12 @@ public CompletionFacadeService(PerplexityReviewCompletionService aiCompletionSer
public void processAll(Set<Product> products, VerticalConfig vertical) {
logger.info("Completing {] products",products.size());
products.forEach(product -> {
// TODO(p2, perf) : should paralellize (on verticals, at upper level)
resourceCompletionService.process(vertical, product);
icecatCompletionService.process(vertical, product);
aiCompletionService.process(vertical, product);
perplexityAttributesCompletionService.process(vertical, product);
perplexityReviewCompletionService.process(vertical, product);

amazonCompletionService.process(vertical, product);
});

Expand All @@ -78,7 +80,7 @@ public void resourceCompletionAll() throws InvalidParameterException, IOExceptio

public void genaiCompletionAll() throws InvalidParameterException, IOException {
logger.warn("Completing verticals with genAI content");
aiCompletionService.completeAll(false);
perplexityReviewCompletionService.completeAll(false);
}

///////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,42 @@ <h3 class="h5 mb-3">100% Satisfaction</h3>

<div class="col-12 col-lg-4">




<!-- Tops -->
<div class="card shadow border-gray-300">
<div class="card-body p-4 p-lg-5">
<div class="d-flex p-3 justify-content-center">
<div class="icon icon-primary">
<span class="fas fa-trophy"></span>
</div>
<div class="ps-4">
<h3 class="h5 icon-box-title md-1">Les tops</h3>
</div>
</div>
<div class="lead" th:text="${product.bestsScores}"></div>
</div>
</div>

<!-- Flops -->
<div class="card shadow border-gray-300">
<div class="card-body p-4 p-lg-5">
<div class="d-flex p-3 justify-content-center">
<div class="icon icon-primary">
<span class="fas fa-thumbs-down"></span>
</div>
<div class="ps-4">
<h3 class="h5 icon-box-title md-1">Les flops</h3>
</div>
</div>
<div th:text="${product.worsesScores}" class="lead">
</div>
</div>
</div>



<!-- Identity -->
<div class="card shadow border-gray-300">
<div class="card-body p-4 p-lg-5">
Expand All @@ -65,21 +101,7 @@ <h3 class="h5 icon-box-title md-1">Fiche d'identité</h3>
</div>


<!-- Bilan -->
<div th:if="${aiReview}" class="card shadow border-gray-300">
<div class="card-body p-4 p-lg-5">
<div class="d-flex p-3 justify-content-center">
<div class="icon icon-primary">
<span class="fas fa-id-card"></span>
</div>
<div class="ps-4">
<h3 class="h5 icon-box-title md-1">Bilan</h3>
</div>
</div>
<div class="lead" th:utext="${aiReview.review}"></div>
</div>
</div>



</div>

Expand Down Expand Up @@ -143,6 +165,24 @@ <h3 class="h5 icon-box-title md-1">Inconvénients</h3>
<!-- End of Icon Box -->
</div>
</div>


<!-- Bilan -->
<div th:if="${aiReview}" class="card shadow border-gray-300">
<div class="card-body p-4 p-lg-5">
<div class="d-flex p-3 justify-content-center">
<div class="icon icon-primary">
<span class="fas fa-id-card"></span>
</div>
<div class="ps-4">
<h3 class="h5 icon-box-title md-1">Bilan</h3>
</div>
</div>
<div class="lead" th:utext="${aiReview.review}"></div>
</div>
</div>


</div>
</div>

Expand Down

0 comments on commit 9bd9b84

Please sign in to comment.