ragaai-catalyst 2.1.5.1b1__py3-none-any.whl → 2.1.5.1b2__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/guard_executor.py +7 -4
- {ragaai_catalyst-2.1.5.1b1.dist-info → ragaai_catalyst-2.1.5.1b2.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.1.5.1b1.dist-info → ragaai_catalyst-2.1.5.1b2.dist-info}/RECORD +6 -6
- {ragaai_catalyst-2.1.5.1b1.dist-info → ragaai_catalyst-2.1.5.1b2.dist-info}/LICENSE +0 -0
- {ragaai_catalyst-2.1.5.1b1.dist-info → ragaai_catalyst-2.1.5.1b2.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.1.5.1b1.dist-info → ragaai_catalyst-2.1.5.1b2.dist-info}/top_level.txt +0 -0
@@ -23,14 +23,15 @@ class GuardExecutor:
|
|
23
23
|
self.output_deployment_details = self.guard_manager.get_deployment(output_deployment_id)
|
24
24
|
if input_deployment_id and output_deployment_id:
|
25
25
|
# check if 2 deployments are mapped to same dataset
|
26
|
-
|
26
|
+
if self.input_deployment_details['data']['datasetId'] != self.output_deployment_details['data']['datasetId']:
|
27
|
+
raise ValueError('Input deployment and output deployment should be mapped to same dataset')
|
27
28
|
for guardrail in self.input_deployment_details['data']['guardrailsResponse']:
|
28
29
|
maps = guardrail['metricSpec']['config']['mappings']
|
29
30
|
for _map in maps:
|
30
31
|
if _map['schemaName']=='Response':
|
31
|
-
raise ValueError('Response field
|
32
|
+
raise ValueError('Response field should be mapped only in output guardrails')
|
32
33
|
except Exception as e:
|
33
|
-
raise ValueError(
|
34
|
+
raise ValueError(str(e))
|
34
35
|
self.base_url = guard_manager.base_url
|
35
36
|
for key in field_map.keys():
|
36
37
|
if key not in ['prompt','context','response','instruction']:
|
@@ -40,7 +41,8 @@ class GuardExecutor:
|
|
40
41
|
|
41
42
|
def execute_deployment(self, deployment_id, payload):
|
42
43
|
api = self.base_url + f'/guardrail/deployment/{deployment_id}/ingest'
|
43
|
-
|
44
|
+
if self.current_trace_id:
|
45
|
+
payload['traceId'] = self.current_trace_id
|
44
46
|
payload = json.dumps(payload)
|
45
47
|
headers = {
|
46
48
|
'x-project-id': str(self.guard_manager.project_id),
|
@@ -182,6 +184,7 @@ class GuardExecutor:
|
|
182
184
|
doc = self.set_variables(prompt,prompt_params)
|
183
185
|
deployment_response = self.execute_deployment(self.output_deployment_id,doc)
|
184
186
|
del self.id_2_doc[self.current_trace_id]
|
187
|
+
self.current_trace_id = None
|
185
188
|
if deployment_response and deployment_response['data']['status'].lower() == 'fail':
|
186
189
|
return deployment_response['data']['alternateResponse'], deployment_response
|
187
190
|
elif deployment_response:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.1.5.
|
3
|
+
Version: 2.1.5.1b2
|
4
4
|
Summary: RAGA AI CATALYST
|
5
5
|
Author-email: Kiran Scaria <kiran.scaria@raga.ai>, Kedar Gaikwad <kedar.gaikwad@raga.ai>, Dushyant Mahajan <dushyant.mahajan@raga.ai>, Siddhartha Kosti <siddhartha.kosti@raga.ai>, Ritika Goel <ritika.goel@raga.ai>, Vijay Chaurasia <vijay.chaurasia@raga.ai>, Tushar Kumar <tushar.kumar@raga.ai>
|
6
6
|
Requires-Python: <3.13,>=3.9
|
@@ -3,7 +3,7 @@ ragaai_catalyst/_version.py,sha256=JKt9KaVNOMVeGs8ojO6LvIZr7ZkMzNN-gCcvryy4x8E,4
|
|
3
3
|
ragaai_catalyst/dataset.py,sha256=YCj8Ovu6y38KEw-1HCe4xQWkmYPgfNTtMa8Q0g6B62o,29401
|
4
4
|
ragaai_catalyst/evaluation.py,sha256=O96CydYVPh3duUmXjY6REIXMOR-tOPixSG-Qhrf636A,22955
|
5
5
|
ragaai_catalyst/experiment.py,sha256=8yQo1phCHlpnJ-4CqCaIbLXg_1ZlAuLGI9kqGBl-OTE,18859
|
6
|
-
ragaai_catalyst/guard_executor.py,sha256=
|
6
|
+
ragaai_catalyst/guard_executor.py,sha256=rSdgf_3PB1Eaeoxz0cz6jbAoGvHXAeEfmM1jFUwL8cI,13970
|
7
7
|
ragaai_catalyst/guardrails_manager.py,sha256=_VrARJ1udmCF8TklNKy7XTQUaM8ATDhTOAGDonBkFro,14245
|
8
8
|
ragaai_catalyst/internal_api_completion.py,sha256=DdICI5yfEudiOAIC8L4oxH0Qz7kX-BZCdo9IWsi2gNo,2965
|
9
9
|
ragaai_catalyst/prompt_manager.py,sha256=W8ypramzOprrJ7-22d5vkBXIuIQ8v9XAzKDGxKsTK28,16550
|
@@ -90,8 +90,8 @@ ragaai_catalyst/tracers/utils/langchain_tracer_extraction_logic.py,sha256=XS2_x2
|
|
90
90
|
ragaai_catalyst/tracers/utils/model_prices_and_context_window_backup.json,sha256=C3uwkibJ08C9sOX-54kulZYmJlIpZ-SQpfE6HNGrjbM,343502
|
91
91
|
ragaai_catalyst/tracers/utils/trace_json_converter.py,sha256=qXSYKr4JMUpGQsB3mnr9_2qH6FqzUhCynNqlDp1IWTs,12440
|
92
92
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
93
|
-
ragaai_catalyst-2.1.5.
|
94
|
-
ragaai_catalyst-2.1.5.
|
95
|
-
ragaai_catalyst-2.1.5.
|
96
|
-
ragaai_catalyst-2.1.5.
|
97
|
-
ragaai_catalyst-2.1.5.
|
93
|
+
ragaai_catalyst-2.1.5.1b2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
94
|
+
ragaai_catalyst-2.1.5.1b2.dist-info/METADATA,sha256=Nv0jgHG5lZLvef0tdbH7msv7Wb2nkPVEH1GgK_JH-xQ,22057
|
95
|
+
ragaai_catalyst-2.1.5.1b2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
96
|
+
ragaai_catalyst-2.1.5.1b2.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
97
|
+
ragaai_catalyst-2.1.5.1b2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|