Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivycheck/ivycheck-python-sdk
Python SDK for IvyCheck
https://github.com/ivycheck/ivycheck-python-sdk
ai ai-quality ai-security generative-ai generative-ai-security-assurance gpt
Last synced: 3 days ago
JSON representation
Python SDK for IvyCheck
- Host: GitHub
- URL: https://github.com/ivycheck/ivycheck-python-sdk
- Owner: ivycheck
- Created: 2024-03-21T10:26:23.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-17T15:14:24.000Z (9 months ago)
- Last Synced: 2024-04-17T16:34:58.854Z (9 months ago)
- Topics: ai, ai-quality, ai-security, generative-ai, generative-ai-security-assurance, gpt
- Language: Jupyter Notebook
- Homepage: https://ivycheck.com/
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome_ai_agents - IvyCheck - IvyCheck offers an API for real-time AI application safety checks, preventing prompt injection attacks, PII data leakage, and hallucinations in agentic AI development [github](https://github.com/ivycheck/ivycheck-python-sdk) | [announcement](https://www.ycombinator.com/launches/KkA-ivycheck-guard-against-ai-risks-with-real-time-checks) | [website](https://ivycheck.com) (Learning / Repositories)
- awesome_ai_agents - IvyCheck - IvyCheck offers an API for real-time AI application safety checks, preventing prompt injection attacks, PII data leakage, and hallucinations in agentic AI development [github](https://github.com/ivycheck/ivycheck-python-sdk) | [announcement](https://www.ycombinator.com/launches/KkA-ivycheck-guard-against-ai-risks-with-real-time-checks) | [website](https://ivycheck.com) (Learning / Repositories)
README
# IvyCheck Python SDK
## SDK Installation
```bash
pip install ivycheck
```## SDK Example Usage
### Example
```python
import ivycheckivy = ivycheck.IvyCheck(
api_key="",
)ivy.checks.hallucination(text="It is sunny outside", context="It is rainig cats and dogs")
# {'passed': False,
# 'score': 0.0003337860107421875,
# 'message': 'Hallucination detected',
# 'findings': None,
# 'sanitized_output': None}```
## Available Resources and Operations
### Checks
- [hallucination](https://docs.ivycheck.com/checks/hallucination) - Hallucination
- [pii](https://docs.ivycheck.com/checks/pii) - Pii
- [prompt_injection](https://docs.ivycheck.com/checks/prompt_injection) - Prompt Injection## Custom HTTP Client
The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
For example, you could specify a header for every request that this sdk makes as follows:
```python
import ivycheck
import requestshttp_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = ivycheck.IvyCheck(client: http_client)
```## Authentication
### Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
| --------- | ---- | ----------- |
| `api_key` | http | HTTP Bearer |To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example:
```python
import ivycheckivy = ivycheck.IvyCheck(
api_key="",
)res = ivy.checks.hallucination(response='', context='', project_id='')
if res.check_result is not None:
# handle response
pass```