-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Customize Safety Checks levels and better those log errors
- Loading branch information
Showing
4 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
from typing import List | ||
from pydantic import SecretStr | ||
from pydantic import SecretStr, Field | ||
from pydantic_settings import BaseSettings | ||
|
||
|
||
class ContentSafetyModel(BaseSettings): | ||
access_key: SecretStr | ||
blocklists: List[str] | ||
category_hate_score: int = Field(default=0, ge=0, le=7) | ||
category_self_harm_score: int = Field(default=1, ge=0, le=7) | ||
category_sexual_score: int = Field(default=2, ge=0, le=7) | ||
category_violence_score: int = Field(default=0, ge=0, le=7) | ||
endpoint: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters