Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Codeer Education Guardrails

Check a candidate tutoring response and receive five classifications with diagnostics and verifiable input quotes. Python 3.11 or newer is required.

Install

python -m pip install --pre codeer-edu-guardrails

Use a Codeer API key issued for this service. A Gemini provider key is not accepted. You do not need to install the Codeer CLI or run a model locally.

from getpass import getpass
from codeer_edu_guardrails import Guardrails

with Guardrails(api_key=getpass("Codeer API key: ")) as client:
    result = client.check(
        conversation_history=input("Question and tutoring history: "),
        candidate_response=input("Candidate tutor response: "),
        # student_context="Optional background supplied by the caller",
    )
    print(result.model_dump_json(indent=2))

Alternatively set CODEER_API_KEY securely in your environment and construct Guardrails() without arguments. Never commit keys into source code.

Results

result.checks contains exactly these original MRBench criteria:

Criterion Labels
Mistake_Identification Yes, To some extent, No
Mistake_Location Yes, To some extent, No
Revealing_of_the_Answer No, Yes (and the answer is correct), Yes (but the answer is incorrect)
Providing_Guidance Yes, To some extent, No
Actionability Yes, To some extent, No

Each item has label, confidence (high, medium, low), diagnosis, evidence (a list of {source, quote}), and limitations. The SDK checks that each quote occurs verbatim in its specified input field. It does not verify the semantic correctness of the diagnosis. Confidence is not a calibrated probability.

guidance = result.checks["Providing_Guidance"]
print(guidance.label, guidance.diagnosis)

Request, chat and response IDs support troubleshooting. scheme_version identifies the SDK's response contract. model, agent_history_id and cost_credits are null when the service does not expose them. An enclosing JSON Markdown fence may be removed; normalized_json_fence reports this formatting normalization. Label strings and input text are never rewritten. service_completion_verified indicates whether the service supplied an explicit successful inference status. When status metadata is absent, the client validates the synchronous response and its full result but does not invent that status.

Errors and timeouts

from codeer_edu_guardrails import GuardrailsError

try:
    with Guardrails() as client:
        result = client.check(conversation_history=history, candidate_response=candidate)
except GuardrailsError as error:
    print(type(error).__name__, error.request_id, error.chat_id)

Errors distinguish invalid input, authentication/permission, rate limits, timeouts, service failure and invalid model output. A successful result always contains all five checks. Missing evidence or invalid labels cause an error, not fabricated classifications. There is no content-level abstention category.

Guardrails(timeout=120) sets the HTTP inactivity timeout in seconds, which is not an end-to-end response-time guarantee. No requests are automatically retried; a timeout can occur after the server has accepted work. Preserve the request/chat IDs and inspect the outcome before retrying.

Service and scope

Each check sends your supplied content to Codeer and creates a separate saved chat. The backend uses a Gemini 3.8 Flash Agent. The generator retains responsibility for deciding whether and how to revise its response. This SDK does not rewrite answers or produce an overall pass/revise decision.

The alpha is for integration and local development. Classification and diagnostic quality are not yet validated for release thresholds or multiple languages. Content language is not restricted. Curriculum alignment, personalized help dosage and complete answer correctness are not separately validated capabilities. Do not infer them directly from these five labels.

agent_id= (or CODEER_GUARDRAILS_AGENT_ID) and base_url= allow an explicitly configured Codeer deployment. Custom agents must implement the same five-check contract. The external Chat API executes the published configuration; selecting an Agent ID does not pin an immutable AgentHistory. Published service changes must therefore be managed separately from SDK versions.

The criterion names follow MRBench. This package distributes no benchmark records, gold labels, customer data or keys.

Release files for codeer-edu-guardrails 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codeer-edu-guardrails 0.1.0a1
File Size Uploaded
codeer_edu_guardrails-0.1.0a1.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codeer-edu-guardrails 0.1.0a1
File Interpreter ABI Platform
codeer_edu_guardrails-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / codeer_edu_guardrails-0.1.0a1.tar.gz

Download URL codeer_edu_guardrails-0.1.0a1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4b584e23ca4b55a3550363058758b9d007da0ab8442923be416417017645f942
BLAKE2b-256 checksum
How to use checksums
2655cd92682b8e655b1f9730e170c07abd7ceb850503c3dae58749f2159701df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / codeer_edu_guardrails-0.1.0a1-py3-none-any.whl

Download URL codeer_edu_guardrails-0.1.0a1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c07546a3d53b2b03818372a34a74c2a9d0f9c2369e9ce4bfd9395a55e0ab1ef
BLAKE2b-256 checksum
How to use checksums
8321a8be4c79b3007bc9728901ded9cae9dd2460fdadbf970d80b691f45ccecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page