trulens.feedback.templates.base¶
trulens.feedback.templates.base
¶
Base classes and shared scaffolding for feedback evaluation templates.
Contains
- FeedbackTemplate (base class, renamed from the former v2
Feedback) - WithPrompt, NaturalLanguage, Semantics
- CriteriaOutputSpaceMixin, OutputSpace, EvalSchema
- FewShotExample / FewShotExamples
- Criteria enum and supported_criteria mapping
- Level 2/3 design-sketch abstractions (FeedbackOutputType, Model, β¦)
Classes¶
FeedbackTemplate
¶
Bases: BaseModel
Base class for feedback template definitions.
Subclasses define system_prompt, user_prompt, criteria, and output_space as ClassVars. Providers use these to build LLM evaluation prompts.
FewShotExamples
¶
Bases: BaseModel
Functions¶
from_examples_list
classmethod
¶
Create a FewShotExamples instance from a list of examples.
| PARAMETER | DESCRIPTION |
|---|---|
examples_list
|
A list of tuples where the first element is the feedback_args and the second element is the score. |
| RETURNS | DESCRIPTION |
|---|---|
FewShotExamples
|
An instance of FewShotExamples with the provided |
FewShotExamples
|
examples. |