> ## 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 : Évaluation

> client.eval() - exemples d'évaluation synchrones et asynchrones.

<Info>
  **Concept :** [Évaluation](/concepts/evaluation) | **API :** [API d'évaluation](/api-reference/evaluation)
</Info>

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

  client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

  result = client.eval(content="Your AI-generated text here", mode="basic")

  print(f"Score: {result.rail_score.score}/10")
  print(f"Confidence: {result.rail_score.confidence}")

  for dim, scores in result.dimension_scores.items():
      print(f"  {dim}: {scores.score}/10")
  ```

  ```python Deep mode with explanations theme={null}
  result = client.eval(
      content="Your text here",
      mode="deep",
      include_explanations=True,
      include_issues=True,
      include_suggestions=True,
  )

  for dim, scores in result.dimension_scores.items():
      print(f"{dim}: {scores.score}/10")
      if scores.explanation:
          print(f"  Pourquoi : {scores.explanation}")
      if scores.issues:
          print(f"  Problèmes : {scores.issues}")
      if scores.suggestions:
          print(f"  Correction : {scores.suggestions}")
  ```

  ```python Selective dimensions theme={null}
  result = client.eval(
      content="Le patient doit prendre 500 mg d'ibuprofène toutes les 4 heures.",
      mode="basic",
      dimensions=["safety", "reliability", "privacy"],
      domain="healthcare",
  )
  ```

  ```python Custom weights theme={null}
  result = client.eval(
      content="Your text here",
      mode="deep",
      weights={
          "safety": 25, "privacy": 20, "reliability": 20,
          "accountability": 15, "transparency": 10,
          "fairness": 5, "inclusivity": 3, "user_impact": 2,
      },
  )
  ```

  ```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.eval(content="Your text here", mode="basic")
      print(result["rail_score"]["score"])

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