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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ cython_debug/
# python sphinx docs
_build/
testing.py

.DS_Store
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changelog
=========

* Added inference client to run inference requests and get status and results

v1.9.0 (2025-04-04)
-------------------

Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,41 @@ DataCrunch's Public API documentation [is available here](https://api.datacrunch

- Generate your client credentials - [instructions in the public API docs](https://api.datacrunch.io/v1/docs#description/quick-start-guide).

- Add the client secret to an environment variable (don't want it to be hardcoded):

- Add your client id and client secret to an environment variable (don't want it to be hardcoded):

Linux (bash):

```bash
export DATACRUNCH_CLIENT_SECRET=Z4CZq02rdwdB7ISV0k4Z2gtwAFKiyvr2U1l0KDIeYi
export DATACRUNCH_CLIENT_ID=YOUR_ID_HERE
export DATACRUNCH_CLIENT_SECRET=YOUR_SECRET_HERE
```

- To enable sending inference requests from SDK you must generate an inference key - [Instructions on inference authorization](https://docs.datacrunch.io/inference/authorization)


- Add your inference key to an environment variable

Linux (bash):

```bash
export DATACRUNCH_INFERENCE_KEY=YOUR_API_KEY_HERE
```

Other platforms:
https://en.wikipedia.org/wiki/Environment_variable



- Example for creating a new instance:

```python
import os
from datacrunch import DataCrunchClient

# Get client secret from environment variable
# Get credentials from environment variables
CLIENT_ID = os.environ.get('DATACRUNCH_CLIENT_ID')
CLIENT_SECRET = os.environ['DATACRUNCH_CLIENT_SECRET']
CLIENT_ID = 'Ibk5bdxV64lKAWOqYnvSi'

# Create datcrunch client
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET)
Expand Down Expand Up @@ -118,7 +133,7 @@ Create this file in the root directory of the project:
from datacrunch.datacrunch import DataCrunchClient

CLIENT_SECRET = 'secret'
CLIENT_ID = 'Ibk5bdxV64lKAWOqYnvSi'
CLIENT_ID = 'your-id'

# Create datcrunch client
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET, base_url='http://localhost:3001/v1')
Expand Down
3 changes: 3 additions & 0 deletions datacrunch/InferenceClient/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .inference_client import InferenceClient, InferenceResponse

__all__ = ['InferenceClient', 'InferenceResponse']
Loading