Python SDK for CrowdStrike AIDR.
Project description
CrowdStrike AIDR Python SDK
Python SDK for CrowdStrike AIDR.
Installation
pip install crowdstrike-aidr
Requirements
Python v3.12 or greater.
Usage
from crowdstrike_aidr import AIGuard
client = AIGuard(
base_url_template="https://api.crowdstrike.com/aidr/{SERVICE_NAME}",
token="my API token"
)
response = client.guard_chat_completions(
guard_input={
"messages": [
{"role": "user", "content": "Hello, world!"}
]
}
)
Timeouts
The SDK uses httpx.Timeout for timeout configuration. By default, requests
have a timeout of 60 seconds with a 5 second connection timeout.
You can configure timeouts in two ways:
Client-level timeout
Set a default timeout for all requests made by the client:
import httpx
from crowdstrike_aidr import AIGuard
# Using a float (total timeout in seconds).
client = AIGuard(
base_url_template="https://api.crowdstrike.com/aidr/{SERVICE_NAME}",
token="my API token",
timeout=30.0,
)
# Using httpx.Timeout for more granular control.
client = AIGuard(
base_url_template="https://api.crowdstrike.com/aidr/{SERVICE_NAME}",
token="my API token",
timeout=httpx.Timeout(timeout=60.0, connect=10.0),
)
Request-level timeout
Override the timeout for a specific request:
# Using a float (total timeout in seconds).
response = client.guard_chat_completions(
guard_input={"messages": [...]},
timeout=120.0
)
# Using httpx.Timeout for more granular control.
response = client.guard_chat_completions(
guard_input={"messages": [...]},
timeout=httpx.Timeout(timeout=120.0, connect=15.0)
)
Retries
The SDK automatically retries failed requests with exponential backoff. By
default, the client will retry up to 2 times. Set max_retries during client
creation to change this.
from crowdstrike_aidr import AIGuard
client = AIGuard(
base_url_template="https://api.crowdstrike.com/aidr/{SERVICE_NAME}",
max_retries=5 # Retry up to 5 times.
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crowdstrike_aidr-0.4.0.tar.gz.
File metadata
- Download URL: crowdstrike_aidr-0.4.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0e15b468531bc4a3bf72b591c0943c786ef75b2a7f1cbf899f126aaeafb0f5
|
|
| MD5 |
8b3ffd627f28dabcfa609d91235b36ed
|
|
| BLAKE2b-256 |
be1e102c2e1cb1a485413b6cc35386becb2655e777c4665bacc8cfed02e16ca0
|
Provenance
The following attestation bundles were made for crowdstrike_aidr-0.4.0.tar.gz:
Publisher:
publish.yml on CrowdStrike/aidr-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crowdstrike_aidr-0.4.0.tar.gz -
Subject digest:
cc0e15b468531bc4a3bf72b591c0943c786ef75b2a7f1cbf899f126aaeafb0f5 - Sigstore transparency entry: 769097360
- Sigstore integration time:
-
Permalink:
CrowdStrike/aidr-python@a71d1faa4bb118726cb80bab91820837855560b8 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CrowdStrike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a71d1faa4bb118726cb80bab91820837855560b8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file crowdstrike_aidr-0.4.0-py3-none-any.whl.
File metadata
- Download URL: crowdstrike_aidr-0.4.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c18f42a64015eb74a36bfbde3dd92392475664bff6b9a28211c5e37489ab15a
|
|
| MD5 |
5c9db7d838fe1fae1307aef4157e8776
|
|
| BLAKE2b-256 |
b606cdca96b2f35ec009ec8a91090c54e32819f0fcea891bb5a9cc6fe4a776e8
|
Provenance
The following attestation bundles were made for crowdstrike_aidr-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on CrowdStrike/aidr-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crowdstrike_aidr-0.4.0-py3-none-any.whl -
Subject digest:
4c18f42a64015eb74a36bfbde3dd92392475664bff6b9a28211c5e37489ab15a - Sigstore transparency entry: 769097368
- Sigstore integration time:
-
Permalink:
CrowdStrike/aidr-python@a71d1faa4bb118726cb80bab91820837855560b8 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CrowdStrike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a71d1faa4bb118726cb80bab91820837855560b8 -
Trigger Event:
release
-
Statement type: