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>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.krylov.refound.ai.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,5 +12,7 @@ public class ImageModerationResponse {
|
||||
|
||||
private String reason;
|
||||
|
||||
// AI-сервис (Python) отдаёт поля в snake_case
|
||||
@JsonProperty("detected_labels")
|
||||
private List<String> detectedLabels;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user