judgeval 0.9.3__py3-none-any.whl → 0.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- judgeval/__init__.py +2 -2
- judgeval/api/__init__.py +28 -96
- judgeval/api/api_types.py +49 -140
- judgeval/constants.py +1 -5
- judgeval/data/__init__.py +1 -3
- judgeval/data/example.py +4 -2
- judgeval/data/judgment_types.py +57 -165
- judgeval/data/result.py +1 -2
- judgeval/data/trace.py +14 -40
- judgeval/dataset/__init__.py +15 -42
- judgeval/evaluation/__init__.py +23 -34
- judgeval/scorers/__init__.py +9 -7
- judgeval/scorers/api_scorer.py +8 -0
- judgeval/scorers/base_scorer.py +0 -1
- judgeval/scorers/judgeval_scorers/api_scorers/__init__.py +2 -10
- judgeval/scorers/judgeval_scorers/api_scorers/answer_correctness.py +2 -2
- judgeval/scorers/judgeval_scorers/api_scorers/answer_relevancy.py +2 -2
- judgeval/scorers/judgeval_scorers/api_scorers/faithfulness.py +2 -2
- judgeval/scorers/judgeval_scorers/api_scorers/instruction_adherence.py +2 -2
- judgeval/scorers/judgeval_scorers/api_scorers/prompt_scorer.py +43 -4
- judgeval/tracer/__init__.py +40 -93
- judgeval/tracer/local_eval_queue.py +2 -2
- judgeval/tracer/processors/__init__.py +84 -6
- judgeval/tracer/utils.py +1 -1
- judgeval/trainer/trainer.py +4 -4
- judgeval/utils/serialize.py +7 -1
- {judgeval-0.9.3.dist-info → judgeval-0.10.0.dist-info}/METADATA +2 -2
- {judgeval-0.9.3.dist-info → judgeval-0.10.0.dist-info}/RECORD +31 -36
- judgeval/data/trace_run.py +0 -39
- judgeval/scorers/judgeval_scorers/api_scorers/derailment_scorer.py +0 -14
- judgeval/scorers/judgeval_scorers/api_scorers/tool_dependency.py +0 -20
- judgeval/scorers/judgeval_scorers/api_scorers/tool_order.py +0 -27
- judgeval/scorers/trace_api_scorer.py +0 -5
- {judgeval-0.9.3.dist-info → judgeval-0.10.0.dist-info}/WHEEL +0 -0
- {judgeval-0.9.3.dist-info → judgeval-0.10.0.dist-info}/entry_points.txt +0 -0
- {judgeval-0.9.3.dist-info → judgeval-0.10.0.dist-info}/licenses/LICENSE.md +0 -0
judgeval/utils/serialize.py
CHANGED
@@ -19,6 +19,8 @@ from pydantic import BaseModel
|
|
19
19
|
from pydantic.types import SecretBytes, SecretStr
|
20
20
|
import orjson
|
21
21
|
|
22
|
+
from judgeval.logger import judgeval_logger
|
23
|
+
|
22
24
|
|
23
25
|
"""
|
24
26
|
This module contains the encoders used by jsonable_encoder to convert Python objects to JSON serializable data types.
|
@@ -244,4 +246,8 @@ encoders_by_class_tuples = generate_encoders_by_class_tuples(ENCODERS_BY_TYPE)
|
|
244
246
|
|
245
247
|
# Seralize arbitrary object to a json string
|
246
248
|
def safe_serialize(obj: Any) -> str:
|
247
|
-
|
249
|
+
try:
|
250
|
+
return orjson.dumps(json_encoder(obj)).decode()
|
251
|
+
except Exception as e:
|
252
|
+
judgeval_logger.warning(f"Error serializing object: {e}")
|
253
|
+
return orjson.dumps(repr(obj)).decode()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: judgeval
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.10.0
|
4
4
|
Summary: Judgeval Package
|
5
5
|
Project-URL: Homepage, https://github.com/JudgmentLabs/judgeval
|
6
6
|
Project-URL: Issues, https://github.com/JudgmentLabs/judgeval/issues
|
@@ -9,7 +9,7 @@ License-Expression: Apache-2.0
|
|
9
9
|
License-File: LICENSE.md
|
10
10
|
Classifier: Operating System :: OS Independent
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
|
-
Requires-Python: >=3.
|
12
|
+
Requires-Python: >=3.10
|
13
13
|
Requires-Dist: boto3>=1.40.11
|
14
14
|
Requires-Dist: click<8.2.0
|
15
15
|
Requires-Dist: dotenv
|
@@ -1,80 +1,75 @@
|
|
1
|
-
judgeval/__init__.py,sha256=
|
1
|
+
judgeval/__init__.py,sha256=MqB1s0zp-Fr_KvKFjGKnRHUeulutmrlMcUyjNRRAU_4,4962
|
2
2
|
judgeval/cli.py,sha256=R5IiIQmSVg21kQHX2kL3sOeXCxvvAMSqyva3Z9AoSXc,1560
|
3
|
-
judgeval/constants.py,sha256=
|
3
|
+
judgeval/constants.py,sha256=h7Cuf_2uvNzHZi8nqRFoMpvsQUZMS3mlNB3s2uduse8,3557
|
4
4
|
judgeval/env.py,sha256=R0bj7XU29RIVVQjkVMa11ObhOYVMbaE_3LTvL3I9dWM,2212
|
5
5
|
judgeval/exceptions.py,sha256=tTbfe4yoOtPXmn22UQz9-6a-5PT9uOko85xaRRwr0Sw,621
|
6
6
|
judgeval/logger.py,sha256=ZWbp0QfT1CJnQIjV-Zle4n489nFCKEmD2-ukx--iiow,1553
|
7
7
|
judgeval/version.py,sha256=kJtYsih3hTYZ_rY_Lt0RcFqvjAfF5Xo1uNq0jZWJ5pw,73
|
8
8
|
judgeval/warnings.py,sha256=LbGte14ppiFjrkp-JJYueZ40NWFvMkWRvPXr6r-fUWw,73
|
9
|
-
judgeval/api/__init__.py,sha256=
|
10
|
-
judgeval/api/api_types.py,sha256=
|
11
|
-
judgeval/data/__init__.py,sha256=
|
9
|
+
judgeval/api/__init__.py,sha256=RWQDwzT93nXWih3WYMPl1OL2ga9uk0dUGYV7fEDzBso,12764
|
10
|
+
judgeval/api/api_types.py,sha256=uyz8ePQI-ec88PVwhHN-KVmldAmNgRjOVmesVDKIBUw,6461
|
11
|
+
judgeval/data/__init__.py,sha256=1tU0EN0ThIfQ1fad5I3dKxAfTcZ5U8cvTLcQ6qLVLU0,407
|
12
12
|
judgeval/data/evaluation_run.py,sha256=G7ad4eDQTjketfcQRITk8bs8CIO8rm058H1G_qkLmhc,4729
|
13
|
-
judgeval/data/example.py,sha256=
|
14
|
-
judgeval/data/judgment_types.py,sha256=
|
15
|
-
judgeval/data/result.py,sha256=
|
13
|
+
judgeval/data/example.py,sha256=eGJpF-lyUH734Cg90B7WtU9f8iKoS3VFGeV6R-GVCCc,1039
|
14
|
+
judgeval/data/judgment_types.py,sha256=JkhNG6fRBFdryG8ogVZsMWtq3W3JmWh0AYIR8LdBAT4,11773
|
15
|
+
judgeval/data/result.py,sha256=LA0OzwcVKwD5NkmtmFuA_EusmYRyE10mjDMXa2bgU1g,2067
|
16
16
|
judgeval/data/scorer_data.py,sha256=g9PE0DNLikW0LgxGWhgpCiNVOX8PzqEaZKivifLOUDI,2997
|
17
17
|
judgeval/data/tool.py,sha256=bj_WxFg22mypUUVR5KqQRxMDHWvKwiE1MMPjLnTCoDU,99
|
18
|
-
judgeval/data/trace.py,sha256=
|
19
|
-
judgeval/data/trace_run.py,sha256=VCQUdDlrHixyiqWW1RUiCtLgqMt-3oW1M1A7CCer2Ok,1635
|
18
|
+
judgeval/data/trace.py,sha256=R9RF1kv1JHeOpjXLjErJcxV2RrNrJUSqWcWe73l3f9k,503
|
20
19
|
judgeval/data/scripts/fix_default_factory.py,sha256=lvp2JwYZqz-XpD9LZNa3mANZVP-jJSZoNzolI6JWERM,591
|
21
20
|
judgeval/data/scripts/openapi_transform.py,sha256=Sm04JClzyP1ga8KA3gkIdsae8Hlx-XU7-x0gHCQYOhg,3877
|
22
|
-
judgeval/dataset/__init__.py,sha256=
|
23
|
-
judgeval/evaluation/__init__.py,sha256=
|
21
|
+
judgeval/dataset/__init__.py,sha256=S1iLL7ivDLIT3aTNO1ardHqhIRxXMuoW5PFLFIkt4uY,5731
|
22
|
+
judgeval/evaluation/__init__.py,sha256=u-aDyLTRebPZigeBbJHpnZk3wQAS7jv_VgLXIi-jMGU,15075
|
24
23
|
judgeval/integrations/langgraph/__init__.py,sha256=VvqCKOk65A2gLlr8uWrJVzpRF5OnIja5zwF4hGPEFsw,27540
|
25
24
|
judgeval/judges/__init__.py,sha256=e7JnTc1TG_SwqydDHTXHIP0EBazQxt-ydMQG7ghSU5A,228
|
26
25
|
judgeval/judges/base_judge.py,sha256=_dz0qWsKRxzXxpRY9l6mrxTRYPSF2FE4ZXkrzhZ4gbY,986
|
27
26
|
judgeval/judges/litellm_judge.py,sha256=5vEF0IUo7HVWnOF2ww-DMke8Xkarnz32B_qbgKjc0-I,4182
|
28
27
|
judgeval/judges/together_judge.py,sha256=GzwlXZJzle8hT-vWKmq39JyIeanJqJfHDOkrksUbzk0,4398
|
29
28
|
judgeval/judges/utils.py,sha256=ITbYwvjU3o9-FIAReFvxh24yJrx9LV3l9BnSBgKUpxg,2068
|
30
|
-
judgeval/scorers/__init__.py,sha256=
|
29
|
+
judgeval/scorers/__init__.py,sha256=34PMPsfR2_3n7T96wpSfAZJWzWlU6v53S3mGX2PE87k,665
|
31
30
|
judgeval/scorers/agent_scorer.py,sha256=V1NSwhGWgtXPsX-blKLkDLsPPbEiP-A4614X-95dtlQ,565
|
32
|
-
judgeval/scorers/api_scorer.py,sha256=
|
33
|
-
judgeval/scorers/base_scorer.py,sha256=
|
31
|
+
judgeval/scorers/api_scorer.py,sha256=8TUJut9r74v-qMACiSKAUbDI1v3ZItPXrTz8s4_Lrgk,2287
|
32
|
+
judgeval/scorers/base_scorer.py,sha256=naGiZYHnkn9HVwY-jpOY7O6cYPJJJe5dHbrRBSOikxw,2723
|
34
33
|
judgeval/scorers/example_scorer.py,sha256=o_BGUztJXjnKnuOqIa9T4PXe0wPoWg63FyH518N1LxA,561
|
35
34
|
judgeval/scorers/exceptions.py,sha256=ACDHK5-TWiF3NTk-wycaedpbrdobm-CvvC1JA_iP-Mk,179
|
36
35
|
judgeval/scorers/score.py,sha256=xquM59SCtNeuAsrBsHFgBQk3CHp4-bms4oFs24xfcU0,7176
|
37
|
-
judgeval/scorers/trace_api_scorer.py,sha256=B2Vp8Jj2I7N-G1weHMm1b_9gVbn0BMcOtestMFNtx08,112
|
38
36
|
judgeval/scorers/utils.py,sha256=iSZONwK0HecxUPz-cMCyra_87DSCag1E8BdpF2a4_44,377
|
39
37
|
judgeval/scorers/judgeval_scorers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
|
-
judgeval/scorers/judgeval_scorers/api_scorers/__init__.py,sha256=
|
41
|
-
judgeval/scorers/judgeval_scorers/api_scorers/answer_correctness.py,sha256=
|
42
|
-
judgeval/scorers/judgeval_scorers/api_scorers/answer_relevancy.py,sha256=
|
43
|
-
judgeval/scorers/judgeval_scorers/api_scorers/
|
44
|
-
judgeval/scorers/judgeval_scorers/api_scorers/
|
45
|
-
judgeval/scorers/judgeval_scorers/api_scorers/
|
46
|
-
judgeval/
|
47
|
-
judgeval/scorers/judgeval_scorers/api_scorers/tool_dependency.py,sha256=BhrLnIASZOTT9XJ6giYSoVfdR7NYsjRRTOTNioNtEiU,610
|
48
|
-
judgeval/scorers/judgeval_scorers/api_scorers/tool_order.py,sha256=bMu0WMJaXdMyDTN42sVLoWV-lrUHCEa8iDrCI_K7nlQ,808
|
49
|
-
judgeval/tracer/__init__.py,sha256=WmRmfvBOkzwEaAljwJ_ClNDJt1zB6J562G5BYXNMySY,36914
|
38
|
+
judgeval/scorers/judgeval_scorers/api_scorers/__init__.py,sha256=wrq7y9I30GZbwDXIrSh81KRO_-j7i-1DjwX5Hc3PScI,728
|
39
|
+
judgeval/scorers/judgeval_scorers/api_scorers/answer_correctness.py,sha256=_qa1sOHUwJubBCfyx6lsE_4vZsUh65VoTZba1NSouis,558
|
40
|
+
judgeval/scorers/judgeval_scorers/api_scorers/answer_relevancy.py,sha256=ciiFBQQC4UDsk9qou9OiKbAR31s82eRUY1ZTt1gdM-0,407
|
41
|
+
judgeval/scorers/judgeval_scorers/api_scorers/faithfulness.py,sha256=lIJ3GgOI9tfbrC7voZMvlxXdK3X1bhdj2zNxqdaGIkM,545
|
42
|
+
judgeval/scorers/judgeval_scorers/api_scorers/instruction_adherence.py,sha256=bSwbpVNhpkpEeX3GtCJuyz5vFyY1gbyqYEfaBF2KTVY,697
|
43
|
+
judgeval/scorers/judgeval_scorers/api_scorers/prompt_scorer.py,sha256=E2_TVO88iLSBAdcKYnfHYp4cUyffgG_p1th5aCpjCd8,9680
|
44
|
+
judgeval/tracer/__init__.py,sha256=mQQaca8XJRYwSRn7a5x63dFQeA8xGjwfoZYikQCAAyI,35214
|
50
45
|
judgeval/tracer/constants.py,sha256=ae8tivAW97awJQxdRB9OMqX50wOLX3zqChT_AGkPBu0,85
|
51
46
|
judgeval/tracer/keys.py,sha256=qXPoZSkEhVF-YYfQ9-zeDMVdr4GtpPf2W7MPJaN2AQo,2889
|
52
|
-
judgeval/tracer/local_eval_queue.py,sha256=
|
47
|
+
judgeval/tracer/local_eval_queue.py,sha256=iv9on1G4woGlhYn1mZATEMkzCiz-qVn2cdzEINzQFYQ,7242
|
53
48
|
judgeval/tracer/managers.py,sha256=h2ZHJ61_vf3cS-HlEUiodFzKDUuQWIhYC6n7pMVyM9c,6113
|
54
|
-
judgeval/tracer/utils.py,sha256=
|
49
|
+
judgeval/tracer/utils.py,sha256=3_8ZjjF4XgNyAu9LpThq5dVOcwdwI-E3vb-HRl_Px8c,594
|
55
50
|
judgeval/tracer/exporters/__init__.py,sha256=lnZXfPGaQH844HAIuZCQqjqhnmZGA98kHY8Xp-Oi4Ws,1220
|
56
51
|
judgeval/tracer/exporters/s3.py,sha256=N9gmw17cnR0VkfAQQkLsNj5BksgNRETThR5qYhWRjP4,4360
|
57
52
|
judgeval/tracer/exporters/store.py,sha256=KQV3cyqteesByQjR-9VdPXT9OlUZ-6F08ogqj837_c0,1012
|
58
53
|
judgeval/tracer/exporters/utils.py,sha256=JRcoSQuEHxMDJbXfyrUIfA2SHBVkZM82h4bTbYGxkNw,1154
|
59
54
|
judgeval/tracer/llm/__init__.py,sha256=p9uwWPg9k-NcWjj9TbwQj55sHhBOqRYx2-Ld6YHaFUs,42625
|
60
55
|
judgeval/tracer/llm/providers.py,sha256=QQLJlSNnDjXRAc2Wqw78o254COJUSXX39D7D_mx3NVA,2651
|
61
|
-
judgeval/tracer/processors/__init__.py,sha256=
|
56
|
+
judgeval/tracer/processors/__init__.py,sha256=tXbQaXGMQeutgM_7d5Y2EFTeSjbVEBky685Dst_v3rg,8672
|
62
57
|
judgeval/trainer/__init__.py,sha256=h_DDVV7HFF7HUPAJFpt2d9wjqgnmEVcHxqZyB1k7pPQ,257
|
63
58
|
judgeval/trainer/config.py,sha256=8s0X8B334PJomorwONaUpb6K8cAMxRdYAeQdtx7HPHs,4258
|
64
59
|
judgeval/trainer/console.py,sha256=PJ0rCnDwC7aoW-VsLDS96ZyMyagh-l9EOJKff1ATIpo,4342
|
65
60
|
judgeval/trainer/trainable_model.py,sha256=vSDtHJJ-fLczC2gkaY9jG6TQvLgWqaVjElm1l8YlJcU,8959
|
66
|
-
judgeval/trainer/trainer.py,sha256=
|
61
|
+
judgeval/trainer/trainer.py,sha256=YhepEm3M-5z1RB50cAEsLbZiOIE_fOWiX-thyvBj6v4,16578
|
67
62
|
judgeval/utils/async_utils.py,sha256=lgCgi8gkLUcAEepruEkx-AGQgJnAJpKmBIhZx6Y0q2s,935
|
68
63
|
judgeval/utils/decorators.py,sha256=rdqY1w0zNL6O6GU6Wdeo0-x5EgpFTEhU2vkgiWsRYdc,525
|
69
64
|
judgeval/utils/file_utils.py,sha256=3LI1YCZwO5ogTgJreyOgRgDksey3natO2Td1PQqaPyY,3252
|
70
65
|
judgeval/utils/guards.py,sha256=QBb6m6KElxdvt2bskLZCKh_zGHbBcqV-VfGzT63o3hY,807
|
71
66
|
judgeval/utils/meta.py,sha256=wQFCLJTNKF9yUdXcw37AT6mC-wqzZpAvjn5gP_6flD8,349
|
72
|
-
judgeval/utils/serialize.py,sha256=
|
67
|
+
judgeval/utils/serialize.py,sha256=QXR-8Nj5rqOrI9zLx0oRLdk6DW6Bc7j8eyF4zQ7PLxA,6256
|
73
68
|
judgeval/utils/testing.py,sha256=kJOq4LlEXaNThfg9oSIRqSK7IH8AwLgbukjn5uxMY7A,3661
|
74
69
|
judgeval/utils/url.py,sha256=Shf0v3XcbaWpL0m1eGJEEO_z4TsQCnDB2Rl25OTUmiI,195
|
75
70
|
judgeval/utils/version_check.py,sha256=kcF6SvB6GbVKI0Gv9QRVm-kvBn9_z-c3jmPORsXO3h0,1015
|
76
|
-
judgeval-0.
|
77
|
-
judgeval-0.
|
78
|
-
judgeval-0.
|
79
|
-
judgeval-0.
|
80
|
-
judgeval-0.
|
71
|
+
judgeval-0.10.0.dist-info/METADATA,sha256=vpsStrROABbjYIuuO8UqssmVjq70k4rLH2AvEz4jie8,8870
|
72
|
+
judgeval-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
73
|
+
judgeval-0.10.0.dist-info/entry_points.txt,sha256=-eoeD-oDLn4A7MSgeBS9Akwanf3_0r0cgEleBcIOjg0,46
|
74
|
+
judgeval-0.10.0.dist-info/licenses/LICENSE.md,sha256=tKmCg7k5QOmxPK19XMfzim04QiQJPmgIm0pAn55IJwk,11352
|
75
|
+
judgeval-0.10.0.dist-info/RECORD,,
|
judgeval/data/trace_run.py
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
from pydantic import BaseModel
|
2
|
-
from typing import List, Optional, Dict, Any, Union
|
3
|
-
from judgeval.data import Trace
|
4
|
-
from judgeval.scorers import APIScorerConfig, BaseScorer
|
5
|
-
from judgeval.env import JUDGMENT_DEFAULT_GPT_MODEL
|
6
|
-
|
7
|
-
|
8
|
-
class TraceRun(BaseModel):
|
9
|
-
"""
|
10
|
-
Stores example and evaluation scorers together for running an eval task
|
11
|
-
|
12
|
-
Args:
|
13
|
-
project_name (str): The name of the project the evaluation results belong to
|
14
|
-
eval_name (str): A name for this evaluation run
|
15
|
-
traces (List[Trace]): The traces to evaluate
|
16
|
-
scorers (List[Union[JudgmentScorer, BaseScorer]]): A list of scorers to use for evaluation
|
17
|
-
model (str): The model used as a judge when using LLM as a Judge
|
18
|
-
metadata (Optional[Dict[str, Any]]): Additional metadata to include for this evaluation run, e.g. comments, dataset name, purpose, etc.
|
19
|
-
rules (Optional[List[Rule]]): Rules to evaluate against scoring results
|
20
|
-
append (Optional[bool]): Whether to append to existing evaluation results
|
21
|
-
tools (Optional[List[Dict[str, Any]]]): List of tools to use for evaluation
|
22
|
-
"""
|
23
|
-
|
24
|
-
organization_id: Optional[str] = None
|
25
|
-
project_name: Optional[str] = None
|
26
|
-
eval_name: Optional[str] = None
|
27
|
-
traces: Optional[List[Trace]] = None
|
28
|
-
scorers: List[Union[APIScorerConfig, BaseScorer]]
|
29
|
-
model: Optional[str] = JUDGMENT_DEFAULT_GPT_MODEL
|
30
|
-
trace_span_id: Optional[str] = None
|
31
|
-
append: Optional[bool] = False
|
32
|
-
override: Optional[bool] = False
|
33
|
-
|
34
|
-
# TODO: ?
|
35
|
-
rules: Any = None
|
36
|
-
tools: Optional[List[Dict[str, Any]]] = None
|
37
|
-
|
38
|
-
class Config:
|
39
|
-
arbitrary_types_allowed = True
|
@@ -1,14 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
`judgeval` answer relevancy scorer
|
3
|
-
|
4
|
-
TODO add link to docs page for this scorer
|
5
|
-
|
6
|
-
"""
|
7
|
-
|
8
|
-
# Internal imports
|
9
|
-
from judgeval.scorers.api_scorer import APIScorerConfig
|
10
|
-
from judgeval.constants import APIScorerType
|
11
|
-
|
12
|
-
|
13
|
-
class DerailmentScorer(APIScorerConfig):
|
14
|
-
score_type: APIScorerType = APIScorerType.DERAILMENT
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
`judgeval` tool dependency scorer
|
3
|
-
"""
|
4
|
-
|
5
|
-
# Internal imports
|
6
|
-
from judgeval.scorers.trace_api_scorer import TraceAPIScorerConfig
|
7
|
-
from judgeval.constants import APIScorerType
|
8
|
-
from typing import Optional, Dict
|
9
|
-
|
10
|
-
|
11
|
-
class ToolDependencyScorer(TraceAPIScorerConfig):
|
12
|
-
kwargs: Optional[Dict] = None
|
13
|
-
|
14
|
-
def __init__(self, threshold: float = 1.0, enable_param_checking: bool = True):
|
15
|
-
super().__init__(threshold=threshold, score_type=APIScorerType.TOOL_DEPENDENCY)
|
16
|
-
self.kwargs = {"enable_param_checking": enable_param_checking}
|
17
|
-
|
18
|
-
@property
|
19
|
-
def __name__(self):
|
20
|
-
return "Tool Dependency"
|
@@ -1,27 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
`judgeval` tool order scorer
|
3
|
-
"""
|
4
|
-
|
5
|
-
# Internal imports
|
6
|
-
from judgeval.scorers.trace_api_scorer import TraceAPIScorerConfig
|
7
|
-
from judgeval.constants import APIScorerType
|
8
|
-
from typing import Dict, Any
|
9
|
-
|
10
|
-
|
11
|
-
class ToolOrderScorer(TraceAPIScorerConfig):
|
12
|
-
score_type: APIScorerType = APIScorerType.TOOL_ORDER
|
13
|
-
threshold: float = 1.0
|
14
|
-
exact_match: bool = False
|
15
|
-
|
16
|
-
def model_dump(self, *args, **kwargs) -> Dict[str, Any]:
|
17
|
-
base = super().model_dump(*args, **kwargs)
|
18
|
-
base_fields = set(TraceAPIScorerConfig.model_fields.keys())
|
19
|
-
all_fields = set(self.__class__.model_fields.keys())
|
20
|
-
|
21
|
-
extra_fields = all_fields - base_fields - {"kwargs"}
|
22
|
-
|
23
|
-
base["kwargs"] = {
|
24
|
-
k: getattr(self, k) for k in extra_fields if getattr(self, k) is not None
|
25
|
-
}
|
26
|
-
|
27
|
-
return base
|
File without changes
|
File without changes
|
File without changes
|