Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion products/ai-runtime-security/api/pythonsdk.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: pythonsdk
title: "AI Runtime Security API Python SDK"
sidebar_label: "AI Runtime Security API Python SDK"
sidebar_label: "Python SDK Overview"
keywords:
- PythonSDK
- AIRS
Expand Down Expand Up @@ -32,3 +32,15 @@ Each usage can use two functions:

* sync_scan()
* async_scan()

## Error Handling & Exceptions

When the client is unable to fetch the expected response from the API server, a subclass of aisecurity.exceptions.AISecSDKException is raised.

There are five types of Exceptions defined in aisecurity/exceptions.py:

* AISEC_SERVER_SIDE_ERROR: Errors returned by the API server. For example, an invalid API key.
* AISEC_CLIENT_SIDE_ERROR: Errors that occur on the client side. For example, a network connection issue.
* AISEC_USER_REQUEST_PAYLOAD_ERROR: Errors related to the user's request payload. For example, an empty scan object.
* AISEC_MISSING_VARIABLE: Errors related to missing variables. For example, missing API key environment variable.
* AISEC_SDK_ERROR: Other uncategorized errors that occur in the SDK.
Loading