You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from .requestsimportHumanEvaluatorRequestParamsasHumanEvaluatorDict
35
36
36
37
37
-
# Responses are Pydantic models and we leverage them for improved request validation
38
+
# Responses are Pydantic models, we leverage them for improved request validation
38
39
from .typesimportFlowKernelRequestasFlow
39
40
from .typesimportPromptKernelRequestasPrompt
40
41
from .typesimportToolKernelRequestasTool
@@ -97,22 +98,12 @@ class File(Identifiers):
97
98
"""The function being evaluated.
98
99
It will be called using your Dataset `inputs` as follows: `output = callable(**datapoint.inputs)`.
99
100
If `messages` are defined in your Dataset, then `output = callable(**datapoint.inputs, messages=datapoint.messages)`.
100
-
It should return a single string output. If not, you must provide a `custom_logger`.
101
-
"""
102
-
custom_logger: NotRequired[Callable]
103
-
"""function that logs the output of your function to Humanloop, replacing the default logging.
104
-
If provided, it will be called as follows:
105
-
```
106
-
output = callable(**datapoint.inputs).
107
-
log = custom_logger(client, output)
108
-
```
109
-
Inside the custom_logger, you can use the Humanloop `client` to log the output of your function.
110
-
If not provided your pipline must return a single string.
101
+
It should return a single string or json output.
111
102
"""
112
103
113
104
114
105
classDataset(Identifiers):
115
-
datapoints: Sequence[DatapointDict]
106
+
datapoints: NotRequired[Sequence[DatapointDict]]
116
107
"""The datapoints to map your function over to produce the outputs required by the evaluation."""
117
108
action: NotRequired[UpdateDatasetAction]
118
109
"""How to update the Dataset given the provided Datapoints;
@@ -128,15 +119,6 @@ class Evaluator(Identifiers):
128
119
"""The type of return value the Evaluator produces - only required for local Evaluators."""
129
120
callable: NotRequired[Callable]
130
121
"""The function to run on the logs to produce the judgment - only required for local Evaluators."""
131
-
custom_logger: NotRequired[Callable]
132
-
"""optional function that logs the output judgment from your Evaluator to Humanloop, if provided, it will be called as follows:
133
-
```
134
-
judgment = callable(log_dict)
135
-
log = custom_logger(client, judgmemt)
136
-
```
137
-
Inside the custom_logger, you can use the Humanloop `client` to log the judgment to Humanloop.
138
-
If not provided your function must return a single string and by default the code will be used to inform the version of the external Evaluator on Humanloop.
139
-
"""
140
122
threshold: NotRequired[float]
141
123
"""The threshold to check the Evaluator against. If the aggregate value of the Evaluator is below this threshold, the check will fail."""
142
124
@@ -213,7 +195,6 @@ def _run_eval(
213
195
f"No `callable` provided for your {type_} file - will attempt to generate logs on Humanloop."
0 commit comments