Add multilingual audit CI pipeline + extract mandelblog_content_guard

This commit is contained in:
2026-03-29 20:49:42 +02:00
parent 643aca26d0
commit e3bafd3a73
104 changed files with 3372 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
from __future__ import annotations
from .agents import get_language_agent
from .validators.multilingual import validate_ai_text_or_raise
def guard_ai_output(locale_code: str, field_path: str, value: str) -> str:
validate_ai_text_or_raise(locale_code, field_path, value)
return value
def rewrite_ai_output(locale_code: str, field_path: str, value: str) -> str:
agent = get_language_agent(locale_code)
rewritten = agent.rewrite(value, field_path=field_path)
validate_ai_text_or_raise(locale_code, field_path, rewritten)
return rewritten