Skip to content

Commit 4eeffdd

Browse files
authored
updates endpoint from positronix to groundlight (#4)
* updates the endpoint to groundlight.ai in readme, userguide and toml * updates endpoints in spec, client and makefile from positronix to groundlight
1 parent 0c97a2a commit 4eeffdd

File tree

7 files changed

+45
-30
lines changed

7 files changed

+45
-30
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ test-local: install ## Run integration tests against an API server running at h
1717

1818

1919
test-integ: install ## Run integration tests against the integ API server (needs GROUNDLIGHT_API_TOKEN)
20-
GROUNDLIGHT_TEST_API_ENDPOINT="https://device.integ.positronix.ai/device-api" poetry run pytest --cov=src test --log-cli-level INFO
20+
GROUNDLIGHT_TEST_API_ENDPOINT="https://api.integ.groundlight.ai/device-api" poetry run pytest --cov=src test --log-cli-level INFO

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# 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.
43

54
### Installation
6-
75
Install with `pip` or `poetry`.
86

97
```Bash
@@ -16,14 +14,14 @@ $ poetry add groundlight
1614

1715
### Basic Usage
1816

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!
2018

2119
```Python
2220
from groundlight import Groundlight
2321

2422
# Load the API client. This defaults to the prod endpoint,
2523
# but you can specify a different endpoint like so:
26-
# gl = Groundlight(endpoint="https://device.integ.positronix.ai/device-api")
24+
# gl = Groundlight(endpoint="https://device.integ.groundlight.ai/device-api")
2725
gl = Groundlight(api_token="<YOUR_API_TOKEN>")
2826

2927
# Call an API method (e.g., retrieve a list of detectors)
@@ -36,26 +34,33 @@ detectors = gl.list_detectors()
3634

3735
Check out the [User Guide](UserGuide.md)!
3836

39-
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
39+
Docs](https://app.groundlight.ai/reef/admin/api-docs).
4140

4241
## Development
4342

44-
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
45+
[openapi-generator](https://openapi-generator.tech/docs/installation#homebrew)
46+
(I recommend homebrew if you're on a mac). Then you can run it with:
4547

4648
```Bash
4749
$ make generate
4850
```
4951

5052
## Testing
51-
5253
Most tests need an API endpoint to run.
5354

5455
### Local API endpoint
5556

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).
57+
1. Set up a local [janzu API
58+
endpoint](https://github.com/positronix-ai/zuuul/blob/main/deploy/README.md#development-using-local-microk8s)
59+
running (e.g., on an AWS GPU instance).
5760

58-
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):
5964

6065
```Bash
6166
$ ssh instance-name -L 8000:localhost:80
@@ -68,7 +73,9 @@ Most tests need an API endpoint to run.
6873
$ make test-local
6974
```
7075

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)
7279

7380
### Integ API endpoint
7481

@@ -81,7 +88,9 @@ Most tests need an API endpoint to run.
8188

8289
## Releases
8390

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
92+
repository](https://github.com/positronix-ai/packaging/tree/main/aws),
93+
you create a release on github.
8594

8695
```Bash
8796
# Create a git tag locally. Use semver "vX.Y.Z" format.
@@ -91,7 +100,13 @@ $ git tag -a v0.1.2 -m "Short description"
91100
$ git push origin --tags
92101
```
93102

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 -> type in 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.
103+
Then, go to the [github
104+
repo](https://github.com/positronix-ai/groundlight-python-sdk/tags) ->
105+
choose your tag -> create a release from this tag -> type in some
106+
description -> release. A [github
107+
action](https://github.com/positronix-ai/groundlight-python-sdk/actions/workflows/publish.yaml)
108+
will trigger a release, and then `groundlight-X.Y.Z` will be available
109+
for consumers.
95110

96111
## TODOs
97112

UserGuide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
$ pip install groundlight
1313
```
1414

15-
1. 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).
15+
1. To access the API, you need an API token. You can create one on the
16+
[groundlight website](https://app.groundlight.ai/reef/my-account/api-tokens).
1617

1718
1. Use the `Groundlight` client!
18-
19+
1920
```Python
2021
from groundlight import Groundlight
2122
gl = Groundlight(api_token="<YOUR_API_TOKEN>")

generated/docs/ImageQueriesApi.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ All URIs are relative to *https://device.positronix.ai/device-api*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**get_image_query**](ImageQueriesApi.md#get_image_query) | **GET** /v1/image-queries/{id} |
8-
[**list_image_queries**](ImageQueriesApi.md#list_image_queries) | **GET** /v1/image-queries |
9-
[**submit_image_query**](ImageQueriesApi.md#submit_image_query) | **POST** /v1/image-queries |
7+
[**get_image_query**](ImageQueriesApi.md#get_image_query) | **GET** /v1/image-queries/{id} |
8+
[**list_image_queries**](ImageQueriesApi.md#list_image_queries) | **GET** /v1/image-queries |
9+
[**submit_image_query**](ImageQueriesApi.md#submit_image_query) | **POST** /v1/image-queries |
1010

1111

1212
# **get_image_query**
@@ -171,7 +171,7 @@ Name | Type | Description | Notes
171171
172172

173173

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 ```
175175

176176
### Example
177177

@@ -252,4 +252,3 @@ Name | Type | Description | Notes
252252
**201** | | - |
253253

254254
[[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)
255-

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "groundlight"
33
version = "0.2.0"
44
license = "MIT"
55
readme = "UserGuide.md"
6-
homepage = "https://app.positronix.ai"
6+
homepage = "https://groundlight.ai"
77
description = "Call the Groundlight API from python"
88
authors = ["Groundlight AI <support@groundlight.ai>"]
99
packages = [

spec/public-api.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ paths:
120120
You must use `"Content-Type: image/jpeg"` for the image data. For example:
121121
122122
```Bash
123-
$ curl https://api.groundlight.ai/v1/image-queries?detector_id=det_abc123 \
123+
$ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \
124124
--header "Content-Type: image/jpeg" \
125125
--data-binary @path/to/filename.jpeg
126126
```
@@ -371,11 +371,11 @@ components:
371371
type: apiKey
372372
in: header
373373
servers:
374+
- url: https://api.groundlight.ai/device-api
375+
description: Prod
376+
- url: https://api.integ.groundlight.ai/device-api
377+
description: Integ
374378
- url: https://device.positronix.ai/device-api
375379
description: Device Prod
376380
- url: https://device.integ.positronix.ai/device-api
377381
description: Device Integ
378-
- url: https://api.groundlight.ai
379-
description: Prod
380-
- url: https://api.integ.groundlight.ai
381-
description: Integ

src/groundlight/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from groundlight.images import buffer_from_jpeg_file
1212

13-
API_TOKEN_WEB_URL = "https://app.positronix.ai/reef/my-account/api-tokens"
13+
API_TOKEN_WEB_URL = "https://app.groundlight.ai/reef/my-account/api-tokens"
1414
API_TOKEN_VARIABLE_NAME = "GROUNDLIGHT_API_TOKEN"
1515

1616

@@ -30,7 +30,7 @@ class Groundlight:
3030
```
3131
"""
3232

33-
def __init__(self, endpoint: str = "https://device.positronix.ai/device-api", api_token: str = None):
33+
def __init__(self, endpoint: str = "https://api.groundlight.ai/device-api", api_token: str = None):
3434
"""
3535
:param endpoint: optionally specify a different endpoint
3636
:param api_token: use this API token for your API calls. If unset, fallback to the

0 commit comments

Comments
 (0)