> ## Documentation Index
> Fetch the complete documentation index at: https://docs.responsibleailabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Python: Sichere Regeneration

> client.safe_regenerate() - automatisches Korrigieren von Inhalten unterhalb des Schwellenwerts.

<Info>
  **Konzept:** [Sichere Regeneration](/concepts/safe-regeneration) | **API:** [Sichere Regenerations-API](/api-reference/safe-regeneration)
</Info>

<CodeGroup>
  ```python Basic theme={null}
  from rail_score_sdk import RailScoreClient

  client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

  result = client.safe_regenerate(
      content="Priorisiere Absolventen der Ivy League für diese Rolle.",
      prompt="Welche Einstellungs Kriterien sollten wir verwenden?",
      threshold=7.0,
      mode="basic",
      max_iterations=3,
  )

  print(f"Endpunktzahl: {result.final_score}/10")
  print(f"Bestanden: {result.passed_threshold}")
  print(f"Iterationen: {result.iterations_taken}")
  print(f"Inhalt: {result.content}")
  ```

  ```python Specific dimensions theme={null}
  result = client.safe_regenerate(
      content="Ihr Text hier",
      prompt="Ursprüngliche Benutzeraufforderung",
      threshold=8.0,
      mode="basic",
      dimensions=["safety", "fairness"],  # Nur diese beiden durchsetzen
      max_iterations=5,
  )
  ```

  ```python Async theme={null}
  import asyncio
  from rail_score_sdk import AsyncRAILClient

  async def main():
      client = AsyncRAILClient(api_key="YOUR_RAIL_API_KEY")
      result = await client.safe_regenerate(
          content="...",
          prompt="...",
          threshold=7.0,
      )
      print(result["final_score"])

  asyncio.run(main())
  ```
</CodeGroup>
