FlowJudge
any_guardrail.guardrails.flowjudge.flowjudge
Flowjudge
Bases: Guardrail
Wrapper around FlowJudge, allowing for custom guardrailing based on user defined criteria, metrics, and rubric.
Please see the model card for more information: FlowJudge.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
User defined metric name. |
required |
criteria
|
str
|
User defined question that they want answered by FlowJudge model. |
required |
rubric
|
dict[int, str]
|
A scoring rubric in a likert scale fashion, providing an integer score and then a description of what the value means. |
required |
required_inputs
|
list[str]
|
A list of what is required for the judge to consider. |
required |
required_output
|
str
|
What is the expected output from the judge. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
Only supports FlowJudge keywords to instantiate FlowJudge. |
Source code in src/any_guardrail/guardrails/flowjudge/flowjudge.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
__init__(name, criteria, rubric, required_inputs, required_output)
Initialize the FlowJudgeClass.
Source code in src/any_guardrail/guardrails/flowjudge/flowjudge.py
validate(inputs, output)
Classifies the desired input and output according to the associated metric provided to the judge.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs
|
list[dict[str, str]]
|
A dictionary mapping the required input names to the inputs. |
required |
output
|
dict[str, str]
|
A dictionary mapping the required output name to the output. |
required |
Return
A score from the RubricItems and feedback related to the rubric and criteria.