Module llm

Module llm 

Source
Expand description

The LLM feedback layer: a pure prompt builder and the rig-core provider client that turns a model’s structured tool call into a typed verdict.

Three concerns, one submodule each (§4.1): prompt builds the injection-hardened prompt (pure, §2.1); provider is the closed set of LLM backends; feedback runs the request and maps the result to a Verdict (the only effectful part, §2.2). The split keeps the pure prompt core separate from the effectful request (§3.1). This layer owns prompt-build, provider-client construction, and the DTO → domain mapping; it does not run learner code or score evals — that is the runner and grade layers’ job. See ADR-0006.

The public names are re-exported here, so callers use core::llm::build_prompt, core::llm::OPEN_CODE, etc., without depending on the internal split.

Structs§

ExecResults
A graded run: what the submission produced, paired with its per-check verdicts.
Prompt
A rendered LLM feedback prompt.
Submission
A learner’s submitted code, awaiting feedback.

Enums§

FeedbackError
Why feedback could not be produced.
ProviderChoice
The LLM backend used to grade a submission.
Verdict
A graded verdict on a submission: correct or incorrect, each carrying the learner-facing message.

Constants§

CHECKS_LABEL
Labels the check-results section.
CLOSE_CODE
Closes the fence around the verbatim student submission.
OPEN_CODE
Opens the fence around the verbatim student submission.
OUTPUT_LABEL
Labels the captured-output section.

Functions§

build_prompt
Build the LLM feedback prompt for a graded submission.
request_feedback
Request structured feedback for a prompt from the chosen provider.