Skip to main content

Python SDK for Learning Commons educational evaluators

Project description

learning-commons-evaluators (Python)

Python SDK for Learning Commons educational text evaluators. Evaluators call LLMs via LangChain, return structured Pydantic results, and share a common configuration and error-handling model.

Installation

pip install learning-commons-evaluators

Requires Python 3.10+. Provider API keys are passed in at runtime (not bundled with the package).

Quick start

import logging
from learning_commons_evaluators import (
    ConventionalityEvaluator,
    ConventionalityEvaluationInput,
    GoogleLLMProviderConfig,
    create_config_no_telemetry,
)

logging.basicConfig(level=logging.INFO)

config = create_config_no_telemetry(
    google_llm_provider_config=GoogleLLMProviderConfig(api_key="your-google-key"),
)

evaluator = ConventionalityEvaluator(config)
result = evaluator.evaluate_sync(
    ConventionalityEvaluationInput(text="The cat's out of the bag now.", grade=5)
)

print(result.answer.label)        # e.g. "Moderately complex"
print(result.explanation.summary) # Reasoning for the score

Docs

For full implementation details, check out the Python SDK docs.

More resources

  • Local development – Local setup, testing, and development
  • Evaluators — Shipped evaluators with their inputs, outputs, and evaluation settings
  • Running evaluations — Sync / async usage and per-call settings overrides
  • ResultsEvaluationResult shape and metadata
  • Configuration — Provider configs, EvaluatorConfig, evaluation settings, logging
  • Error handling — Exception hierarchy, retries, and sanitization

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

learning_commons_evaluators-0.2.0.tar.gz (81.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

learning_commons_evaluators-0.2.0-py3-none-any.whl (95.7 kB view details)

Uploaded Python 3

File details

Details for the file learning_commons_evaluators-0.2.0.tar.gz.

File metadata

File hashes

Hashes for learning_commons_evaluators-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d2773bc99379f2f6c8563e14a26beca878e5a6c5bfd9ea918be978e121a83ed2
MD5 1ed7ab4d0d83d190d026023d5bb81098
BLAKE2b-256 edfc28c0d78a65f061c9538652b8beb331e84cb768f9fc8986bc418e4917fa28

See more details on using hashes here.

Provenance

The following attestation bundles were made for learning_commons_evaluators-0.2.0.tar.gz:

Publisher: publish-python-sdk.yml on learning-commons-org/evaluators

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file learning_commons_evaluators-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for learning_commons_evaluators-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22714c233257f096530adb81d25cdba9b8f52d4931f3565bd97ac75fb6dfc46b
MD5 77ee7057030a85daef5af1f9e902cdbf
BLAKE2b-256 349d83446f746696900ce94fcf0021d216b97898937766dc1abdbb92fd07c964

See more details on using hashes here.

Provenance

The following attestation bundles were made for learning_commons_evaluators-0.2.0-py3-none-any.whl:

Publisher: publish-python-sdk.yml on learning-commons-org/evaluators

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page