List Detectors
List all supported Detectors with thedetections.list_detectors method:
Create Detections
You can use thedetections.create method to run a Detector on a list of inputs.
detector_ids: Identifier for the Detector to be called. A full list of Detectors is available here.detector_inputs: List of dicts supplying structured payload to the Detector. Keys to the dicts should map to permitted input fields for that Detector.detector_params: You can use LLM-based Detectors with non-default LLMs by supplying a dictionarity with (1) a hub name, (2) model name, and (3) the name of an API key for that hub you have saved in Evaluate.
detector_params. Suppose you want to use Llama 3.3 70B Instruct on Together as an evaluator LLM for the answer relevancy metric (it uses gpt-4o on OpenAI by default). Given you have a Together API key saved, you can use the following code
Summarize Detections
Get summary scores for a completed detection, including status and related metadata with thedetections.describe method:
format. Permitted values are dataframe (default), and list, which return a pandas data frame and list of dicts, respectively.
Supported Fields for Detectors
The table below gives the required set of input fields for each Detector.| Detector ID | Required fields: format |
|---|---|
goodside.Glitch | response: str,triggers: list[str] |
base.TriggerListDetector | response: str,triggers: list[str] |
base.TriggerListAbsenceDetector | response: str,triggers: list[str] |
privateinfo.LeakPII | response: str,triggers: list[str] |
encoding.DecodeMatch | response: str,triggers: list[str] |
winobias.TriggerPlusAmbiguity | response: str,triggers: list[str] |
mitigation.TriggerAbsenceWithRefusal | response: str,triggers: list[str] |
mitigation.mathLatexSympy.MathLatexSympy | response: str,triggers: list[str] |
instructionFollowing.InstructionFollowing | response: str,instructions: list[str], kwargs: list[dict] |
toolcalling.ToolCorrectness | response: str,expected_tools: list[str] |
nlp.BLEU | response: str,ground_truth: str |
nlp.METEOR | response: str,ground_truth: str |
llm.AnswerRelevancy | response: str,question: str |
llm.ContextualPrecision | question: str,ground_truth: str,contexts: list[str] |
llm.ContextualRecall | ground_truth: str,contexts: list[str] |
llm.Correctness | ground_truth: str, question: str |
llm.Faithfulness | response: str,question: str,contexts: list[str] |
llm.StrongReject | response: str,forbidden_prompt: str |
llm.Refusal | input: str, response: str |
llm.HybridRefusal | input: str, response: str |
llm.ConversationRoleAdherence | response: str,role: str |
llm.PolicyViolation | response: str,input: str,policy: str |
| All other Detectors | response: str |