Files
nahodka-back/src/main/java/com/krylov/refound/ai/dto/ImageModerationResponse.java
SlimusMinus a68b89981c fix AI moderation response mapping and long post text
The AI service returns snake_case JSON, so detectedLabels was always null
and blocked posts carried no labels. Map it with @JsonProperty("detected_labels").

Post text longer than the service limit (5000 chars) got 422, which became
AiBadRequestException and the post was rejected. Text is now sent in
overlapping chunks within ai.text-max-length; blank text is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 00:33:31 +03:00

19 lines
401 B
Java

package com.krylov.refound.ai.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import lombok.Data;
@Data
public class ImageModerationResponse {
private Boolean approved;
private Double score;
private String reason;
// AI-сервис (Python) отдаёт поля в snake_case
@JsonProperty("detected_labels")
private List<String> detectedLabels;
}