fix(solaris): proper building google safety settings

This commit is contained in:
h
2025-08-12 20:10:06 +03:00
parent 441805b994
commit d21ff78727

View File

@@ -12,12 +12,22 @@ from pydantic_ai.providers.google import GoogleProvider
from utils.db.models import DynamicConfig, RespondSession from utils.db.models import DynamicConfig, RespondSession
from utils.env import env from utils.env import env
from utils.logging import console
from ..types.model import RespondModel, ReviewModel from ..types.model import RespondModel, ReviewModel
GOOGLE_SAFETY_SETTINGS = [ GOOGLE_SAFETY_SETTINGS = [
SafetySettingDict(category=category, threshold=HarmBlockThreshold.OFF) {
for category in HarmCategory "category": HarmCategory.HARM_CATEGORY_HATE_SPEECH,
"threshold": HarmBlockThreshold.OFF,
}
for category in [
HarmCategory.HARM_CATEGORY_HATE_SPEECH,
HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
HarmCategory.HARM_CATEGORY_HARASSMENT,
HarmCategory.HARM_CATEGORY_CIVIC_INTEGRITY,
]
] ]