Interface GPTResponseCheck
-
public interface GPTResponseCheck
An additional check that verifies whether the translation was carried out right - such as paths in HTML weren't translated.
-
-
Field Summary
Fields Modifier and Type Field Description static GPTResponseCheck
KEEP_HREF_TRANSLATION_CHECK
A check that all href attributes in richtext appear in the translation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static String
collectResponseProblems(List<GPTResponseCheck> checks, String source, String translation)
Finds problems of translation wrt.String
responseProblem(String source, String translation)
Performs a check, and if the check fails it returns additional instructions with which the request is retried.
-
-
-
Field Detail
-
KEEP_HREF_TRANSLATION_CHECK
static final GPTResponseCheck KEEP_HREF_TRANSLATION_CHECK
A check that all href attributes in richtext appear in the translation. Sometimes the GPT translates paths containing recognizable words, so we check that the set of HREFs in the original is the same as the set of HREFs in the translation.
-
-
Method Detail
-
responseProblem
@Nullable String responseProblem(@Nonnull String source, @Nonnull String translation)
Performs a check, and if the check fails it returns additional instructions with which the request is retried.- Returns:
- null if the response is fine, otherwise the additional instructions to fix the response (possibly an empty string).
-
-