ragaai-catalyst 2.1.5b19__py3-none-any.whl → 2.1.5b20__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.
- ragaai_catalyst/evaluation.py +25 -6
- {ragaai_catalyst-2.1.5b19.dist-info → ragaai_catalyst-2.1.5b20.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.1.5b19.dist-info → ragaai_catalyst-2.1.5b20.dist-info}/RECORD +6 -6
- {ragaai_catalyst-2.1.5b19.dist-info → ragaai_catalyst-2.1.5b20.dist-info}/LICENSE +0 -0
- {ragaai_catalyst-2.1.5b19.dist-info → ragaai_catalyst-2.1.5b20.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.1.5b19.dist-info → ragaai_catalyst-2.1.5b20.dist-info}/top_level.txt +0 -0
ragaai_catalyst/evaluation.py
CHANGED
@@ -7,6 +7,11 @@ import logging
|
|
7
7
|
|
8
8
|
logger = logging.getLogger(__name__)
|
9
9
|
|
10
|
+
# Job status constants
|
11
|
+
JOB_STATUS_FAILED = "failed"
|
12
|
+
JOB_STATUS_IN_PROGRESS = "in_progress"
|
13
|
+
JOB_STATUS_COMPLETED = "success"
|
14
|
+
|
10
15
|
class Evaluation:
|
11
16
|
|
12
17
|
def __init__(self, project_name, dataset_name):
|
@@ -366,22 +371,36 @@ class Evaluation:
|
|
366
371
|
response.raise_for_status()
|
367
372
|
if response.json()["success"]:
|
368
373
|
status_json = [item["status"] for item in response.json()["data"]["content"] if item["id"]==self.jobId][0]
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
374
|
+
if status_json == "Failed":
|
375
|
+
print("Job failed. No results to fetch.")
|
376
|
+
return JOB_STATUS_FAILED
|
377
|
+
elif status_json == "In Progress":
|
378
|
+
print(f"Job in progress. Please wait while the job completes.\nVisit Job Status: {self.base_url.removesuffix('/api')}/projects/job-status?projectId={self.project_id} to track")
|
379
|
+
return JOB_STATUS_IN_PROGRESS
|
380
|
+
elif status_json == "Completed":
|
381
|
+
print(f"Job completed. Fetching results.\nVisit Job Status: {self.base_url.removesuffix('/api')}/projects/job-status?projectId={self.project_id} to check")
|
382
|
+
return JOB_STATUS_COMPLETED
|
383
|
+
else:
|
384
|
+
logger.error(f"Unknown status received: {status_json}")
|
385
|
+
return JOB_STATUS_FAILED
|
386
|
+
else:
|
387
|
+
logger.error("Request was not successful")
|
388
|
+
return JOB_STATUS_FAILED
|
375
389
|
except requests.exceptions.HTTPError as http_err:
|
376
390
|
logger.error(f"HTTP error occurred: {http_err}")
|
391
|
+
return JOB_STATUS_FAILED
|
377
392
|
except requests.exceptions.ConnectionError as conn_err:
|
378
393
|
logger.error(f"Connection error occurred: {conn_err}")
|
394
|
+
return JOB_STATUS_FAILED
|
379
395
|
except requests.exceptions.Timeout as timeout_err:
|
380
396
|
logger.error(f"Timeout error occurred: {timeout_err}")
|
397
|
+
return JOB_STATUS_FAILED
|
381
398
|
except requests.exceptions.RequestException as req_err:
|
382
399
|
logger.error(f"An error occurred: {req_err}")
|
400
|
+
return JOB_STATUS_FAILED
|
383
401
|
except Exception as e:
|
384
402
|
logger.error(f"An unexpected error occurred: {e}")
|
403
|
+
return JOB_STATUS_FAILED
|
385
404
|
|
386
405
|
def get_results(self):
|
387
406
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.5b20
|
4
4
|
Summary: RAGA AI CATALYST
|
5
5
|
Author-email: Kiran Scaria <kiran.scaria@raga.ai>, Siddhartha Kosti <siddhartha.kosti@raga.ai>, Vijay Chaurasia <vijay.chaurasia@raga.ai>, Tanaya Pakhale <tanaya.pakhale@raga.ai>, Ritika Goel <ritika.goel@raga.ai>, Kedar Gaikwad <kedar.gaikwad@raga.ai>, Dushyant Mahajan <dushyant.mahajan@raga.ai>
|
6
6
|
Requires-Python: <3.13,>=3.9
|
@@ -1,7 +1,7 @@
|
|
1
1
|
ragaai_catalyst/__init__.py,sha256=tvESV8UuVtth14E89wQxgf0WvQZSApWfDeLiIdmMhkE,791
|
2
2
|
ragaai_catalyst/_version.py,sha256=JKt9KaVNOMVeGs8ojO6LvIZr7ZkMzNN-gCcvryy4x8E,460
|
3
3
|
ragaai_catalyst/dataset.py,sha256=8EbZEpcV4Fb8oO0vhYIK_WIwGyYvJ4VzwGeIZDtu2E8,23475
|
4
|
-
ragaai_catalyst/evaluation.py,sha256=
|
4
|
+
ragaai_catalyst/evaluation.py,sha256=pcmgCxmrugvIzBApu0BVaiPIueOcFj8uig3F1Br_PKs,21035
|
5
5
|
ragaai_catalyst/experiment.py,sha256=8yQo1phCHlpnJ-4CqCaIbLXg_1ZlAuLGI9kqGBl-OTE,18859
|
6
6
|
ragaai_catalyst/guard_executor.py,sha256=llPbE3DyVtrybojXknzBZj8-dtUrGBQwi9-ZiPJxGRo,3762
|
7
7
|
ragaai_catalyst/guardrails_manager.py,sha256=DILMOAASK57FH9BLq_8yC1AQzRJ8McMFLwCXgYwNAd4,11904
|
@@ -66,8 +66,8 @@ ragaai_catalyst/tracers/utils/__init__.py,sha256=KeMaZtYaTojilpLv65qH08QmpYclfpa
|
|
66
66
|
ragaai_catalyst/tracers/utils/convert_langchain_callbacks_output.py,sha256=ofrNrxf2b1hpjDh_zeaxiYq86azn1MF3kW8-ViYPEg0,1641
|
67
67
|
ragaai_catalyst/tracers/utils/langchain_tracer_extraction_logic.py,sha256=qK67fdUBz5Xr99ajqXbYf1ueKS1V3a3_XR0zCcN4iGI,3061
|
68
68
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
69
|
-
ragaai_catalyst-2.1.
|
70
|
-
ragaai_catalyst-2.1.
|
71
|
-
ragaai_catalyst-2.1.
|
72
|
-
ragaai_catalyst-2.1.
|
73
|
-
ragaai_catalyst-2.1.
|
69
|
+
ragaai_catalyst-2.1.5b20.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
70
|
+
ragaai_catalyst-2.1.5b20.dist-info/METADATA,sha256=BG35VSzU3yXUjC8bTD8eS6nu3f7wgMVKgOTMR5omqJk,12837
|
71
|
+
ragaai_catalyst-2.1.5b20.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
72
|
+
ragaai_catalyst-2.1.5b20.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
73
|
+
ragaai_catalyst-2.1.5b20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|