enkryptai-sdk 1.0.2__tar.gz → 1.0.3__tar.gz

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.
Files changed (41) hide show
  1. {enkryptai_sdk-1.0.2/src/enkryptai_sdk.egg-info → enkryptai_sdk-1.0.3}/PKG-INFO +1 -1
  2. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/setup.py +1 -1
  3. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/ai_proxy.py +6 -4
  4. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3/src/enkryptai_sdk.egg-info}/PKG-INFO +1 -1
  5. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/LICENSE +0 -0
  6. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/README.md +0 -0
  7. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/setup.cfg +0 -0
  8. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/__init__.py +0 -0
  9. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/base.py +0 -0
  10. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/config.py +0 -0
  11. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/datasets.py +0 -0
  12. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/deployments.py +0 -0
  13. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/__init__.py +0 -0
  14. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/ai_proxy.py +0 -0
  15. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/base.py +0 -0
  16. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/datasets.py +0 -0
  17. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/deployments.py +0 -0
  18. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/guardrails.py +0 -0
  19. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/models.py +0 -0
  20. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/dto/red_team.py +0 -0
  21. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/evals.py +0 -0
  22. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/guardrails.py +0 -0
  23. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/guardrails_old.py +0 -0
  24. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/models.py +0 -0
  25. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/red_team.py +0 -0
  26. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk/response.py +0 -0
  27. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk.egg-info/SOURCES.txt +0 -0
  28. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk.egg-info/dependency_links.txt +0 -0
  29. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/src/enkryptai_sdk.egg-info/top_level.txt +0 -0
  30. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_ai_proxy.py +0 -0
  31. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_all.py +0 -0
  32. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_basic.py +0 -0
  33. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_datasets.py +0 -0
  34. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_deployments.py +0 -0
  35. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_detect_policy.py +0 -0
  36. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_guardrails.py +0 -0
  37. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_injection_attack.py +0 -0
  38. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_model.py +0 -0
  39. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_openai.py +0 -0
  40. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_policy_violation.py +0 -0
  41. {enkryptai_sdk-1.0.2 → enkryptai_sdk-1.0.3}/tests/test_redteam.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enkryptai-sdk
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: A Python SDK with guardrails and red teaming functionality for API interactions
5
5
  Home-page: https://github.com/enkryptai/enkryptai-sdk
6
6
  Author: Enkrypt AI Team
@@ -8,7 +8,7 @@ with open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
8
8
 
9
9
  setup(
10
10
  name="enkryptai-sdk", # This is the name of your package on PyPI
11
- version="1.0.2", # Update this for new versions
11
+ version="1.0.3", # Update this for new versions
12
12
  description="A Python SDK with guardrails and red teaming functionality for API interactions",
13
13
  long_description=long_description,
14
14
  long_description_content_type="text/markdown",
@@ -54,7 +54,7 @@ class AIProxyClient(BaseClient):
54
54
  # Try to parse nested JSON error if it's a string
55
55
  if isinstance(error_message, str) and is_json_str:
56
56
  import ast
57
- import json
57
+ # import json
58
58
  try:
59
59
  # # Using ast.literal_eval to safely evaluate the string as a Python literal
60
60
  # # As json.loads is not working with literal string representation of dict
@@ -65,7 +65,8 @@ class AIProxyClient(BaseClient):
65
65
  response["error"] = parsed_error.get("error", parsed_error)
66
66
  if "enkrypt_policy_detections" in parsed_error:
67
67
  response["enkrypt_policy_detections"] = parsed_error["enkrypt_policy_detections"]
68
- except json.JSONDecodeError:
68
+ # except json.JSONDecodeError:
69
+ except Exception:
69
70
  # If parsing fails, keep the original error
70
71
  pass
71
72
 
@@ -78,9 +79,10 @@ class AIProxyClient(BaseClient):
78
79
  try:
79
80
  # print("Error in response: ", response)
80
81
  return ChatCompletionErrorResponse.from_dict(response)
81
- except (json.JSONDecodeError, TypeError, ValueError, SyntaxError):
82
+ # except (json.JSONDecodeError, TypeError, ValueError, SyntaxError):
83
+ except Exception:
82
84
  # Fallback to direct error if error object can't be parsed
83
- print("Failed to parse error response: ", response)
85
+ # print("Failed to parse error response: ", response)
84
86
  return ChatCompletionDirectErrorResponse.from_dict(response)
85
87
  raise AIProxyClientError(response["error"])
86
88
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enkryptai-sdk
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: A Python SDK with guardrails and red teaming functionality for API interactions
5
5
  Home-page: https://github.com/enkryptai/enkryptai-sdk
6
6
  Author: Enkrypt AI Team
File without changes
File without changes
File without changes