> ## 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: Evaluation

> client.eval() - sync and async evaluation examples.

<Info>
  **Concept:** [Evaluation](/concepts/evaluation) | **API:** [Evaluation API](/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"  Why: {scores.explanation}")
      if scores.issues:
          print(f"  Issues: {scores.issues}")
      if scores.suggestions:
          print(f"  Fix: {scores.suggestions}")
  ```

  ```python Selective dimensions theme={null}
  result = client.eval(
      content="Patient should take 500mg ibuprofen every 4 hours.",
      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>
