Metadata-Version: 2.4
Name: aristech-nlp-client
Version: 2.1.0
Summary: A Python client library for the Aristech Natural-Language-Processing API.
Author-email: Martin Mende <speech@aristech.de>
License: MIT License
Project-URL: Homepage, https://github.com/aristech-de/nlp-clients/tree/main/python
Project-URL: Issues, https://github.com/aristech-de/nlp-clients/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: grpcio<2.0.0,>=1.71.0
Requires-Dist: protobuf<7.0.0,>=5.26.1
Provides-Extra: dev
Requires-Dist: grpcio-tools<2.0.0,>=1.71.0; extra == "dev"
Requires-Dist: mypy-protobuf<4.0.0,>=3.6.0; extra == "dev"
Requires-Dist: python-dotenv<2.0.0,>=1.1.0; extra == "dev"

# Aristech NLP-Client for Python

This is the Python client implementation for the Aristech NLP-Server.

## Installation

To install the package, you can use pip:

```sh
pip install aristech-nlp-client
```

## Usage

```python
from aristech_nlp_client import NlpClient

client = NlpClient(host='nlp.example.com')
response = client.run_functions(RunFunctionsRequest(
    input='Hello, world!',
    functions=[
        Function(id="recasepunct-de")
    ]
))
print(response.output)
```

There are several examples in the [examples](.) directory:

- [functions.py](https://github.com/aristech-de/nlp-clients/blob/main/python/examples/models.py): Demonstrates how to list the available functions.
- [run_functions.py](https://github.com/aristech-de/nlp-clients/blob/main/python/examples/run_functions.py): Demonstrates how to perform NLP processing on a text.
- [projects.py](https://github.com/aristech-de/nlp-clients/blob/main/python/examples/projects.py): Demonstrates how to list the available projects.
- [intents.py](https://github.com/aristech-de/nlp-clients/blob/main/python/examples/intents.py): Demonstrates how to list intents for a project.
- [scoreLimits.py](https://github.com/aristech-de/nlp-clients/blob/main/python/examples/scoreLimits.py): Demonstrates how to use score limits to figure out good thresholds for intents.
- [content.py](https://github.com/aristech-de/nlp-clients/blob/main/python/examples/content.py): Demonstrates how to search content for a given prompt.

You can run the examples directly using `python` like this:

1. Create a `.env` file in the [python](.) directory:

```sh
HOST=nlp.example.com
# The credentials are optional but probably required for most servers:
TOKEN=your-token
SECRET=your-secret

# The following are optional:
# ROOT_CERT=your-root-cert.pem # If the server uses a self-signed certificate
# PROJECT_ID=some-project-id # Required for some examples
```

2. Run the examples, e.g.:

```sh
python examples/functions.py
```
