judgeval 0.0.15__py3-none-any.whl → 0.0.17__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/common/tracer.py +19 -21
- judgeval/constants.py +1 -1
- judgeval/data/datasets/eval_dataset_client.py +5 -5
- judgeval/judgment_client.py +4 -4
- judgeval/run_evaluation.py +3 -3
- {judgeval-0.0.15.dist-info → judgeval-0.0.17.dist-info}/METADATA +1 -1
- {judgeval-0.0.15.dist-info → judgeval-0.0.17.dist-info}/RECORD +9 -9
- {judgeval-0.0.15.dist-info → judgeval-0.0.17.dist-info}/WHEEL +0 -0
- {judgeval-0.0.15.dist-info → judgeval-0.0.17.dist-info}/licenses/LICENSE.md +0 -0
judgeval/common/tracer.py
CHANGED
@@ -37,7 +37,7 @@ from http import HTTPStatus
|
|
37
37
|
import pika
|
38
38
|
import os
|
39
39
|
|
40
|
-
from judgeval.constants import JUDGMENT_TRACES_SAVE_API_URL, JUDGMENT_TRACES_FETCH_API_URL, RABBITMQ_HOST, RABBITMQ_PORT, RABBITMQ_QUEUE, JUDGMENT_TRACES_DELETE_API_URL
|
40
|
+
from judgeval.constants import JUDGMENT_TRACES_SAVE_API_URL, JUDGMENT_TRACES_FETCH_API_URL, RABBITMQ_HOST, RABBITMQ_PORT, RABBITMQ_QUEUE, JUDGMENT_TRACES_DELETE_API_URL,JUDGMENT_TRACES_ADD_TO_EVAL_QUEUE_API_URL
|
41
41
|
from judgeval.judgment_client import JudgmentClient
|
42
42
|
from judgeval.data import Example
|
43
43
|
from judgeval.scorers import APIJudgmentScorer, JudgevalScorer, ScorerWrapper
|
@@ -208,7 +208,7 @@ class TraceManagerClient:
|
|
208
208
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
209
209
|
"X-Organization-Id": self.organization_id
|
210
210
|
},
|
211
|
-
verify=
|
211
|
+
verify=True
|
212
212
|
)
|
213
213
|
|
214
214
|
if response.status_code != HTTPStatus.OK:
|
@@ -233,7 +233,7 @@ class TraceManagerClient:
|
|
233
233
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
234
234
|
"X-Organization-Id": self.organization_id
|
235
235
|
},
|
236
|
-
verify=
|
236
|
+
verify=True
|
237
237
|
)
|
238
238
|
|
239
239
|
if response.status_code == HTTPStatus.BAD_REQUEST:
|
@@ -619,25 +619,23 @@ class TraceClient:
|
|
619
619
|
}
|
620
620
|
# Execute asynchrous evaluation in the background
|
621
621
|
if not empty_save: # Only send to RabbitMQ if the trace is not empty
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
trace_data["judgment_api_key"] = self.tracer.api_key
|
628
|
-
trace_data["organization_id"] = self.tracer.organization_id
|
629
|
-
channel.basic_publish(
|
630
|
-
exchange='',
|
631
|
-
routing_key=RABBITMQ_QUEUE,
|
632
|
-
body=json.dumps(trace_data),
|
633
|
-
properties=pika.BasicProperties(
|
634
|
-
delivery_mode=pika.DeliveryMode.Transient, # Changed from Persistent to Transient
|
622
|
+
# Send trace data to evaluation queue via API
|
623
|
+
try:
|
624
|
+
response = requests.post(
|
625
|
+
JUDGMENT_TRACES_ADD_TO_EVAL_QUEUE_API_URL,
|
626
|
+
json=trace_data,
|
635
627
|
headers={
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
628
|
+
"Content-Type": "application/json",
|
629
|
+
"Authorization": f"Bearer {self.tracer.api_key}",
|
630
|
+
"X-Organization-Id": self.tracer.organization_id
|
631
|
+
},
|
632
|
+
verify=True
|
633
|
+
)
|
634
|
+
|
635
|
+
if response.status_code != HTTPStatus.OK:
|
636
|
+
warnings.warn(f"Failed to add trace to evaluation queue: {response.text}")
|
637
|
+
except Exception as e:
|
638
|
+
warnings.warn(f"Error sending trace to evaluation queue: {str(e)}")
|
641
639
|
|
642
640
|
self.trace_manager_client.save_trace(trace_data, empty_save)
|
643
641
|
|
judgeval/constants.py
CHANGED
@@ -46,7 +46,7 @@ JUDGMENT_EVAL_DELETE_PROJECT_API_URL = f"{ROOT_API}/delete_eval_results_by_proje
|
|
46
46
|
JUDGMENT_TRACES_FETCH_API_URL = f"{ROOT_API}/traces/fetch/"
|
47
47
|
JUDGMENT_TRACES_SAVE_API_URL = f"{ROOT_API}/traces/save/"
|
48
48
|
JUDGMENT_TRACES_DELETE_API_URL = f"{ROOT_API}/traces/delete/"
|
49
|
-
|
49
|
+
JUDGMENT_TRACES_ADD_TO_EVAL_QUEUE_API_URL = f"{ROOT_API}/traces/add_to_eval_queue/"
|
50
50
|
# RabbitMQ
|
51
51
|
RABBITMQ_HOST = os.getenv("RABBITMQ_HOST", "rabbitmq-networklb-faa155df16ec9085.elb.us-west-1.amazonaws.com")
|
52
52
|
RABBITMQ_PORT = os.getenv("RABBITMQ_PORT", 5672)
|
@@ -69,7 +69,7 @@ class EvalDatasetClient:
|
|
69
69
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
70
70
|
"X-Organization-Id": self.organization_id
|
71
71
|
},
|
72
|
-
verify=
|
72
|
+
verify=True
|
73
73
|
)
|
74
74
|
if response.status_code == 500:
|
75
75
|
error(f"Server error during push: {content.get('message')}")
|
@@ -134,7 +134,7 @@ class EvalDatasetClient:
|
|
134
134
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
135
135
|
"X-Organization-Id": self.organization_id
|
136
136
|
},
|
137
|
-
verify=
|
137
|
+
verify=True
|
138
138
|
)
|
139
139
|
response.raise_for_status()
|
140
140
|
except requests.exceptions.RequestException as e:
|
@@ -193,7 +193,7 @@ class EvalDatasetClient:
|
|
193
193
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
194
194
|
"X-Organization-Id": self.organization_id
|
195
195
|
},
|
196
|
-
verify=
|
196
|
+
verify=True
|
197
197
|
)
|
198
198
|
response.raise_for_status()
|
199
199
|
except requests.exceptions.RequestException as e:
|
@@ -247,7 +247,7 @@ class EvalDatasetClient:
|
|
247
247
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
248
248
|
"X-Organization-Id": self.organization_id
|
249
249
|
},
|
250
|
-
verify=
|
250
|
+
verify=True
|
251
251
|
)
|
252
252
|
response.raise_for_status()
|
253
253
|
except requests.exceptions.RequestException as e:
|
@@ -279,7 +279,7 @@ class EvalDatasetClient:
|
|
279
279
|
"X-Organization-Id": self.organization_id
|
280
280
|
},
|
281
281
|
stream=True,
|
282
|
-
verify=
|
282
|
+
verify=True
|
283
283
|
)
|
284
284
|
response.raise_for_status()
|
285
285
|
except requests.exceptions.HTTPError as err:
|
judgeval/judgment_client.py
CHANGED
@@ -307,7 +307,7 @@ class JudgmentClient:
|
|
307
307
|
"X-Organization-Id": self.organization_id
|
308
308
|
},
|
309
309
|
json=eval_run_request_body.model_dump(),
|
310
|
-
verify=
|
310
|
+
verify=True)
|
311
311
|
if eval_run.status_code != requests.codes.ok:
|
312
312
|
raise ValueError(f"Error fetching eval results: {eval_run.json()}")
|
313
313
|
|
@@ -380,7 +380,7 @@ class JudgmentClient:
|
|
380
380
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
381
381
|
},
|
382
382
|
json={}, # Empty body now
|
383
|
-
verify=
|
383
|
+
verify=True
|
384
384
|
)
|
385
385
|
if response.status_code == 200:
|
386
386
|
return True, response.json()
|
@@ -412,7 +412,7 @@ class JudgmentClient:
|
|
412
412
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
413
413
|
"X-Organization-Id": self.organization_id
|
414
414
|
},
|
415
|
-
verify=
|
415
|
+
verify=True
|
416
416
|
)
|
417
417
|
|
418
418
|
if response.status_code == 500:
|
@@ -456,7 +456,7 @@ class JudgmentClient:
|
|
456
456
|
"Authorization": f"Bearer {self.judgment_api_key}",
|
457
457
|
"X-Organization-Id": self.organization_id
|
458
458
|
},
|
459
|
-
verify=
|
459
|
+
verify=True
|
460
460
|
)
|
461
461
|
|
462
462
|
if response.status_code == 500:
|
judgeval/run_evaluation.py
CHANGED
@@ -56,7 +56,7 @@ def execute_api_eval(evaluation_run: EvaluationRun) -> List[Dict]:
|
|
56
56
|
"X-Organization-Id": evaluation_run.organization_id
|
57
57
|
},
|
58
58
|
json=payload,
|
59
|
-
verify=
|
59
|
+
verify=True)
|
60
60
|
response_data = response.json()
|
61
61
|
except Exception as e:
|
62
62
|
error(f"Error: {e}")
|
@@ -170,7 +170,7 @@ def check_eval_run_name_exists(eval_name: str, project_name: str, judgment_api_k
|
|
170
170
|
"project_name": project_name,
|
171
171
|
"judgment_api_key": judgment_api_key,
|
172
172
|
},
|
173
|
-
verify=
|
173
|
+
verify=True
|
174
174
|
)
|
175
175
|
|
176
176
|
if response.status_code == 409:
|
@@ -213,7 +213,7 @@ def log_evaluation_results(merged_results: List[ScoringResult], evaluation_run:
|
|
213
213
|
"project_name": evaluation_run.project_name,
|
214
214
|
"eval_name": evaluation_run.eval_name,
|
215
215
|
},
|
216
|
-
verify=
|
216
|
+
verify=True
|
217
217
|
)
|
218
218
|
|
219
219
|
if not res.ok:
|
@@ -1,14 +1,14 @@
|
|
1
1
|
judgeval/__init__.py,sha256=xiiG4CkeaOtey4fusCd9CBz0BVqzTIbV-K2EFIU0rUM,283
|
2
2
|
judgeval/clients.py,sha256=Ns5ljrgPPXUMo7fSPJxO12H64lcPyKeQPIVG_RMi2cM,1162
|
3
|
-
judgeval/constants.py,sha256=
|
3
|
+
judgeval/constants.py,sha256=hbKAToxC9RZqIu40ohRdb-DLrRLnXmYwqWiAJT3ebwk,4783
|
4
4
|
judgeval/evaluation_run.py,sha256=qGNafAPLW9tq6KV3eDolIASodLxcSBWQO0mQ0Aq9Cig,6285
|
5
|
-
judgeval/judgment_client.py,sha256=
|
5
|
+
judgeval/judgment_client.py,sha256=E55AZkx5FBiX6yM0ILanqx2m87ppBXcM8nza6iWYEBc,23373
|
6
6
|
judgeval/rules.py,sha256=6RT3DdMvu-LpjqiSDMAd4d2T8S8pOfc_IBEvTgf3GS4,15665
|
7
|
-
judgeval/run_evaluation.py,sha256=
|
7
|
+
judgeval/run_evaluation.py,sha256=cJzVBD_P-2JkKHIPAwXQupiypbWjfOtH7x8g5eQIo_4,21487
|
8
8
|
judgeval/common/__init__.py,sha256=7d24BRxtncpMj3AAJCj8RS7TqgjXmW777HVZH6-3sBs,289
|
9
9
|
judgeval/common/exceptions.py,sha256=U-TxHLn7oVMezsMuoYouNDb2XuS8RCggfntYf5_6u4E,565
|
10
10
|
judgeval/common/logger.py,sha256=QXN3UMymmKu2iMEMEgATLBnMDjGr_pE2iOSEFoICgg8,6092
|
11
|
-
judgeval/common/tracer.py,sha256=
|
11
|
+
judgeval/common/tracer.py,sha256=Q2jbowOFPjOmlonofahDrYzkm8O_XZ5LtOVRWHNA3bA,36455
|
12
12
|
judgeval/common/utils.py,sha256=T1lpObopcH868NIgOTzNViTB33OGadcVWxWcfh2pm3E,33439
|
13
13
|
judgeval/data/__init__.py,sha256=YferxwmUqoBi18hrdgro0BD0h4pt20LAqISeUzGMcVU,474
|
14
14
|
judgeval/data/api_example.py,sha256=vwWFbI6eJr5VgURCRbuSiMtEXLUbTCih_BcaqEBy-pg,4108
|
@@ -17,7 +17,7 @@ judgeval/data/result.py,sha256=8FIO-bFKPegZuByKRjA2_sumjb8oGWQ5ZeQ1RVz5z2w,4393
|
|
17
17
|
judgeval/data/scorer_data.py,sha256=pYljblCPZrlMIv5Eg7R-clnmsqzUBAwokKjZpwa0DXE,3280
|
18
18
|
judgeval/data/datasets/__init__.py,sha256=eO6ayeM_bTGwIt0eDSlTBIIBvXvIWRWWSfYZrZROPiQ,265
|
19
19
|
judgeval/data/datasets/dataset.py,sha256=FRl2efBQZEpyK_ZTM7FMQQ7wjmtvcHCMFBq8L7O2Wus,12080
|
20
|
-
judgeval/data/datasets/eval_dataset_client.py,sha256=
|
20
|
+
judgeval/data/datasets/eval_dataset_client.py,sha256=iaUwlzed3JrWV0P4vu8s2hd5q0BKzF_vAbCv36gx6us,11526
|
21
21
|
judgeval/data/datasets/ground_truth.py,sha256=OTBs3VZe-Wp0vEXEsq14GPZHYtpWT16bhGQTycIvkKc,2057
|
22
22
|
judgeval/data/datasets/utils.py,sha256=lQxyl7mevct7JcDSyIrU_8QOzT-EYPWEvoUiAeOdeek,2502
|
23
23
|
judgeval/judges/__init__.py,sha256=tyQ5KY88Kp1Ctfw2IJxnVEpy8DnFCtmy04JdPOpp-As,339
|
@@ -80,7 +80,7 @@ judgeval/scorers/judgeval_scorers/local_implementations/tool_correctness/__init_
|
|
80
80
|
judgeval/scorers/judgeval_scorers/local_implementations/tool_correctness/tool_correctness_scorer.py,sha256=CYGRJY5EuyICYzHrmFdLykwXakX8AC7G3Bhj7p6szfY,5493
|
81
81
|
judgeval/tracer/__init__.py,sha256=wy3DYpH8U_z0GO_K_gOSkK0tTTD-u5eLDo0T5xIBoAc,147
|
82
82
|
judgeval/utils/alerts.py,sha256=RgW5R9Dn3Jtim0OyAYDbNzjoX2s6SA4Mw16GyyaikjI,1424
|
83
|
-
judgeval-0.0.
|
84
|
-
judgeval-0.0.
|
85
|
-
judgeval-0.0.
|
86
|
-
judgeval-0.0.
|
83
|
+
judgeval-0.0.17.dist-info/METADATA,sha256=5T7WfHQNVQmdsmOaDcS6pNKSk4O7DMvxfQPaoYf_4X0,1283
|
84
|
+
judgeval-0.0.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
85
|
+
judgeval-0.0.17.dist-info/licenses/LICENSE.md,sha256=tKmCg7k5QOmxPK19XMfzim04QiQJPmgIm0pAn55IJwk,11352
|
86
|
+
judgeval-0.0.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|