Metadata-Version: 2.4
Name: predictionguard
Version: 2.12.0
Summary: [DEPRECATED] The Prediction Guard Python SDK. No longer maintained; use an OpenAI- or Anthropic-compatible SDK instead.
Project-URL: Homepage, https://predictionguard.com
Project-URL: Documentation, https://predictionguard.github.io/python-client/
Project-URL: Repository, https://github.com/predictionguard/python-client.git
Project-URL: Issues, https://github.com/predictionguard/python-client/issues
Author-email: Jacob Mansdorfer <jacob@predictionguard.com>, Daniel Whitenack <dan@predictionguard.com>
License: The MIT License (MIT)
        
        Copyright (c) 2022 Daniel Whitenack
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 7 - Inactive
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.12
Requires-Dist: requests<3,>=2.34.2
Requires-Dist: tabulate<1,>=0.10.0
Provides-Extra: dev
Requires-Dist: black==26.5.1; extra == 'dev'
Requires-Dist: pytest==9.1.1; extra == 'dev'
Requires-Dist: ruff==0.16.1; extra == 'dev'
Requires-Dist: sphinx-autodoc-typehints==3.13.0; extra == 'dev'
Requires-Dist: sphinx-rtd-theme==3.1.0; extra == 'dev'
Requires-Dist: sphinx==9.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# Prediction Guard - Python Client

> [!WARNING]
> **This SDK is deprecated and no longer maintained.** Some features are broken or missing, and no further updates will be released. Existing releases remain installable from PyPI, but you should migrate to an OpenAI-compatible or Anthropic-compatible SDK as described below.

## Migrating

The Prediction Guard API is compatible with both OpenAI-style and Anthropic-style clients. Use whichever SDK matches the functionality you need, pointed at the Prediction Guard API with your existing API key.

### OpenAI-compatible SDK

```bash
pip install openai
```

```python
import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PREDICTIONGUARD_API_KEY"],
    base_url="https://api.predictionguard.com",
)

response = client.chat.completions.create(
    model="<model-name>",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```

### Anthropic-compatible SDK

```bash
pip install anthropic
```

```python
import os

from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["PREDICTIONGUARD_API_KEY"],
    base_url="https://api.predictionguard.com",
)

message = client.messages.create(
    model="<model-name>",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)
```

For the full list of endpoints and models, see the [Prediction Guard documentation](https://docs.predictionguard.com).

## Legacy documentation

The [API documentation](https://predictionguard.github.io/python-client/) for this SDK remains available for reference but will not be updated.
