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

# Create evaluator config
# NOTE: Telemetry is not yet implemented in v0.1.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 = ConventionalityEvaluator(config)

# Evaluate text for a grade level
result = evaluator.evaluate(
    ConventionalityEvaluationInput(text="The cat's out of the bag now.", grade=5)
)

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.