Skip to content

Commit 59f5039

Browse files
Add support for profanities detection endpoint
1 parent 1ffb497 commit 59f5039

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/lara_sdk/_translator.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,4 +757,13 @@ def detect(self, text: Union[str, List[str]], *, hint: Optional[str] = None,
757757
'passlist': passlist
758758
}
759759

760-
return DetectResult(**self._client.post('/v2/detect', body))
760+
return DetectResult(**self._client.post('/v2/detect/language', body))
761+
762+
def detect_profanities(self, text: str, *, language: str, content_type: str) -> ProfanityDetectResult:
763+
body = {
764+
'text': text,
765+
'language': language,
766+
'content_type': content_type
767+
}
768+
769+
return ProfanityDetectResult(**self._client.post('/v2/detect/profanities', body))

0 commit comments

Comments
 (0)