(
text: str,
raw_results: list[dict[str, Any]],
operators: dict[str, OperatorConfig] | None,
)
| 195 | |
| 196 | |
| 197 | def run_anonymize( |
| 198 | text: str, |
| 199 | raw_results: list[dict[str, Any]], |
| 200 | operators: dict[str, OperatorConfig] | None, |
| 201 | ): |
| 202 | analyzer_results = [ |
| 203 | RecognizerResult( |
| 204 | entity_type=r["entity_type"], |
| 205 | start=r["start"], |
| 206 | end=r["end"], |
| 207 | score=r.get("score", 1.0), |
| 208 | ) |
| 209 | for r in raw_results |
| 210 | ] |
| 211 | return anonymizer.anonymize( |
| 212 | text=text, |
| 213 | analyzer_results=analyzer_results, |
| 214 | operators=operators, |
| 215 | ) |
| 216 | |
| 217 | |
| 218 | @app.get("/health") |
no test coverage detected