swiftapi-python 1.2.1__py3-none-any.whl → 1.2.2__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.
swiftapi/__init__.py CHANGED
@@ -29,7 +29,7 @@ Usage:
29
29
  db.update(user_id, data)
30
30
  """
31
31
 
32
- __version__ = "1.2.1"
32
+ __version__ = "1.2.2"
33
33
  __author__ = "Rayan Pal"
34
34
 
35
35
  # Core exports
swiftapi/client.py CHANGED
@@ -111,10 +111,12 @@ class SwiftAPI:
111
111
 
112
112
  # Policy violations (denied actions)
113
113
  if response.status_code == 200 and data.get("approved") is False:
114
+ reason = data.get("denial_reason") or data.get("reason", "Action denied by policy")
115
+ action_type = data.get("action_type") or data.get("action", {}).get("type")
114
116
  raise PolicyViolation(
115
- message=data.get("reason", "Action denied by policy"),
116
- action_type=data.get("action", {}).get("type"),
117
- denial_reason=data.get("reason"),
117
+ message=reason,
118
+ action_type=action_type,
119
+ denial_reason=reason,
118
120
  )
119
121
 
120
122
  # Other errors
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swiftapi-python
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: SwiftAPI Python SDK - AI Action Verification Gateway
5
5
  Author-email: Rayan Pal <rayan@swiftapi.ai>
6
6
  License-Expression: MIT
@@ -1,13 +1,13 @@
1
- swiftapi/__init__.py,sha256=9P71iwPdwJoTfWzks9dGBkhdeOLNN9aMpMpvGMd7nk0,2061
1
+ swiftapi/__init__.py,sha256=lCk2KIRL72P7AYwFy0KwJV6AWt_E8npD3oyX85oyfYA,2061
2
2
  swiftapi/anthropic.py,sha256=aTgCNWHigmJf0zUz9OpmUS3Ej_2bA_EY70lnMTlhBiI,7680
3
- swiftapi/client.py,sha256=9rIsu1lMQbb62Pt3FJ3osGvS48myQfZwSbgXYFg-rsQ,10197
3
+ swiftapi/client.py,sha256=DIB66PMh6I48PMwmqqy08kzQrxa0dSg7lw9vK_GJsMg,10309
4
4
  swiftapi/enforcement.py,sha256=L-2JKvvL5U3Q4ZU_o889RxZteuN-ELuxKGIMUXtx2sw,8725
5
5
  swiftapi/exceptions.py,sha256=hBleOCc1WwDEM70WNYTy1TDOSOaBJSx3PtzFzfmVOGY,1701
6
6
  swiftapi/openai.py,sha256=9erzv6J4Ts2PuqhV030QyIm5yE0UxomA0y2qW9-slKQ,7670
7
7
  swiftapi/utils.py,sha256=Sn6ED6ltECCYc-ce9fhxZxgzBthvflPCZelXPPzskZM,3145
8
8
  swiftapi/verifier.py,sha256=SpeTo3tHTVxz7-R8o5_kLIhEJV6aDOUG0ud4WcSWDBg,4768
9
- swiftapi_python-1.2.1.dist-info/licenses/LICENSE,sha256=btq3h42ZP3swvtQ3ak5k3sP_Y6yRwzL5zrV7EzNeRus,1087
10
- swiftapi_python-1.2.1.dist-info/METADATA,sha256=xCRpB88EJIujXFLRqMKF2OUuhcjsvkTSlPVKtE7plMk,7674
11
- swiftapi_python-1.2.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
12
- swiftapi_python-1.2.1.dist-info/top_level.txt,sha256=oio-d2BTrT91P7dmufUhlSYjOtWBh4bOYz6rsTDDvu4,9
13
- swiftapi_python-1.2.1.dist-info/RECORD,,
9
+ swiftapi_python-1.2.2.dist-info/licenses/LICENSE,sha256=btq3h42ZP3swvtQ3ak5k3sP_Y6yRwzL5zrV7EzNeRus,1087
10
+ swiftapi_python-1.2.2.dist-info/METADATA,sha256=iJTgLr1jb0MZQuXhoSjmjpYPdvyyXSzHVEZAiWKb3VA,7674
11
+ swiftapi_python-1.2.2.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
12
+ swiftapi_python-1.2.2.dist-info/top_level.txt,sha256=oio-d2BTrT91P7dmufUhlSYjOtWBh4bOYz6rsTDDvu4,9
13
+ swiftapi_python-1.2.2.dist-info/RECORD,,