mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
[CORL-1050] Add Perspective toxicity support for fr and pt (#2940)
* Add support for fr and pt * fix: added some more docs Co-authored-by: Wyatt Johnson <me@wyattjoh.ca>
This commit is contained in:
co-authored by
Wyatt Johnson
parent
0e9621c499
commit
192c3486af
@@ -11,8 +11,11 @@ const fetch = createFetch({ name: "perspective" });
|
||||
/**
|
||||
* Language is the language key that is supported by the Perspective API in the
|
||||
* ISO 631-1 format.
|
||||
*
|
||||
* The current list of supported languages can be found:
|
||||
* https://github.com/conversationai/perspectiveapi/blob/master/2-api/models.md#languages-in-production
|
||||
*/
|
||||
type PerspectiveLanguage = "en" | "es" | "fr" | "de";
|
||||
type PerspectiveLanguage = "en" | "es" | "fr" | "de" | "pt";
|
||||
|
||||
/**
|
||||
* convertLanguage returns the language code for the related Perspective API
|
||||
@@ -26,8 +29,12 @@ function convertLanguage(locale: LanguageCode): PerspectiveLanguage {
|
||||
return "en";
|
||||
case "es":
|
||||
return "es";
|
||||
case "fr-FR":
|
||||
return "fr";
|
||||
case "de":
|
||||
return "de";
|
||||
case "pt-BR":
|
||||
return "pt";
|
||||
default:
|
||||
return "en";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user