You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,7 @@
1
1
# Groundlight Python SDK
2
-
3
-
This package holds an SDK for accessing the Groundlight public API.
2
+
This package holds an SDK for accessing the Groundlight public API.
4
3
5
4
### Installation
6
-
7
5
Install with `pip` or `poetry`.
8
6
9
7
```Bash
@@ -16,14 +14,14 @@ $ poetry add groundlight
16
14
17
15
### Basic Usage
18
16
19
-
To access the API, you need an API token. You can create one on the [groundlight website](https://app.positronix.ai/reef/my-account/api-tokens). Then, you're ready to use the SDK!
17
+
To access the API, you need an API token. You can create one on the [groundlight website](https://app.groundlight.ai/reef/my-account/api-tokens). Then, you're ready to use the SDK!
20
18
21
19
```Python
22
20
from groundlight import Groundlight
23
21
24
22
# Load the API client. This defaults to the prod endpoint,
25
23
# but you can specify a different endpoint like so:
For more details, see the [Groundlight](src/groundlight/client.py) class. This SDK closely follows the methods in our [API Docs](https://app.positronix.ai/reef/admin/api-docs).
40
-
37
+
For more details, see the [Groundlight](src/groundlight/client.py)
38
+
class. This SDK closely follows the methods in our [API
The auto-generated SDK code is in the `generated/` directory. To re-generate the client code, you'll need to install [openapi-generator](https://openapi-generator.tech/docs/installation#homebrew) (I recommend homebrew if you're on a mac). Then you can run it with:
43
+
The auto-generated SDK code is in the `generated/` directory. To
44
+
re-generate the client code, you'll need to install
(I recommend homebrew if you're on a mac). Then you can run it with:
45
47
46
48
```Bash
47
49
$ make generate
48
50
```
49
51
50
52
## Testing
51
-
52
53
Most tests need an API endpoint to run.
53
54
54
55
### Local API endpoint
55
56
56
-
1. Set up a local [janzu API endpoint](https://github.com/positronix-ai/zuuul/blob/main/deploy/README.md#development-using-local-microk8s) running (e.g., on an AWS GPU instance).
1. Set up an ssh tunnel to your laptop. That way, you can access the endpoint at http://localhost:8000/device-api (and the web UI at http://localhost:8000/reef):
61
+
1. Set up an ssh tunnel to your laptop. That way, you can access the
62
+
endpoint at http://localhost:8000/device-api (and the web UI at
63
+
http://localhost:8000/reef):
59
64
60
65
```Bash
61
66
$ ssh instance-name -L 8000:localhost:80
@@ -68,7 +73,9 @@ Most tests need an API endpoint to run.
68
73
$ make test-local
69
74
```
70
75
71
-
(Note: in theory, it's possible to run the janzu API server on your laptop without microk8s - but some API methods don't work because of the dependence on GPUs)
76
+
(Note: in theory, it's possible to run the janzu API server on your
77
+
laptop without microk8s - but some API methods don't work because of
78
+
the dependence on GPUs)
72
79
73
80
### Integ API endpoint
74
81
@@ -81,7 +88,9 @@ Most tests need an API endpoint to run.
81
88
82
89
## Releases
83
90
84
-
To publish a new package version to our [internal pypi repository](https://github.com/positronix-ai/packaging/tree/main/aws), you create a release on github.
91
+
To publish a new package version to our [internal pypi
# Create a git tag locally. Use semver "vX.Y.Z" format.
@@ -91,7 +100,13 @@ $ git tag -a v0.1.2 -m "Short description"
91
100
$ git push origin --tags
92
101
```
93
102
94
-
Then, go to the [github repo](https://github.com/positronix-ai/groundlight-python-sdk/tags) -> choose your tag -> create a release from this tag ->typein some description -> release. A [github action](https://github.com/positronix-ai/groundlight-python-sdk/actions/workflows/publish.yaml) will trigger a release, and then`groundlight-X.Y.Z` will be available for consumers.
@@ -171,7 +171,7 @@ Name | Type | Description | Notes
171
171
172
172
173
173
174
-
Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` for the image data. For example: ```Bash $ curl https://api.groundlight.ai/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ```
174
+
Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` for the image data. For example: ```Bash $ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ```
175
175
176
176
### Example
177
177
@@ -252,4 +252,3 @@ Name | Type | Description | Notes
252
252
**201** | | - |
253
253
254
254
[[Back to top]](#)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to Model list]](../README.md#documentation-for-models)[[Back to README]](../README.md)
0 commit comments