Skip to main content
Once you’ve configured your evaluator, you can start evaluating text inputs for grade level appropriateness:
example.py
from learning_commons_evaluators import (
  GradeLevelAppropriatenessEvaluator,
  GradeLevelAppropriatenessEvaluationInput,
  GooglePromptProviderConfig,
  create_config,
)

# Create evaluator config
# NOTE: Telemetry is not yet implemented in v0.2.0
config = create_config(
  google_llm_provider_config=GooglePromptProviderConfig(api_key="your-google-key"),
  telemetry_partner_id="your-learning-commons-api-key",
)

# Instantiate evaluator
evaluator = GradeLevelAppropriatenessEvaluator(config)

# Evaluate text for grade level appropriateness
result = evaluator.evaluate(
  GradeLevelAppropriatenessEvaluationInput(text="The cat's out of the bag now.")
)

Literacy evaluators

The literacy evaluators have the following output fields.
FieldTypeDescription
answerEvaluationAnswer ↗Complexity score returned by the evaluation
explanationEvaluationExplanation ↗Reasoning for the complexity score and evaluator-specific fields (explanation.details – see table below)
metadataEvaluationMetadata ↗Evaluation run metadata like timing, status, token usage, and per-step details
The explanation.details field includes detailed internal analysis data specific to that evaluator.