trulens.feedback.v2.feedback¶
trulens.feedback.v2.feedback
¶
Classes¶
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 examples.
TYPE:
|
Relevance
¶
Bases: Semantics
This evaluates the relevance of the LLM response to the given text by LLM prompting.
Relevance is available for any LLM provider.
Sentiment
dataclass
¶
Bases: Semantics
, WithPrompt
, CriteriaOutputSpaceMixin
This evaluates the positive sentiment of either the prompt or response.
Harmfulness
¶
Bases: Moderation
, WithPrompt
Examples of Harmfulness:
Insensitivity
¶
Bases: Semantics
, WithPrompt
Examples and categorization of racial insensitivity: https://sph.umn.edu/site/docs/hewg/microaggressions.pdf .
Maliciousness
¶
Bases: Moderation
, WithPrompt
Examples of maliciousness:
Hate
¶
Bases: Moderation
Examples of (not) Hate metrics:
openai
package:openai.moderation
categoryhate
.
HateThreatening
¶
Bases: Hate
Examples of (not) Threatening Hate metrics:
openai
package:openai.moderation
categoryhate/threatening
.
SelfHarm
¶
Bases: Moderation
Examples of (not) Self Harm metrics:
openai
package:openai.moderation
categoryself-harm
.
Sexual
¶
Bases: Moderation
Examples of (not) Sexual metrics:
openai
package:openai.moderation
categorysexual
.
SexualMinors
¶
Bases: Sexual
Examples of (not) Sexual Minors metrics:
openai
package:openai.moderation
categorysexual/minors
.
Violence
¶
Bases: Moderation
Examples of (not) Violence metrics:
openai
package:openai.moderation
categoryviolence
.