Skip to content

Commit f8d89aa

Browse files
brandon-wadaAuto-format Bot
andauthored
Allows binary download for edge (#313)
Co-authored-by: Auto-format Bot <autoformatbot@groundlight.ai>
1 parent 2004b65 commit f8d89aa

File tree

17 files changed

+805
-15
lines changed

17 files changed

+805
-15
lines changed

generated/.openapi-generator/FILES

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ docs/DetectorGroupsApi.md
2222
docs/DetectorResetApi.md
2323
docs/DetectorTypeEnum.md
2424
docs/DetectorsApi.md
25+
docs/EdgeApi.md
26+
docs/EdgeModelInfo.md
2527
docs/EscalationTypeEnum.md
2628
docs/ImageQueriesApi.md
2729
docs/ImageQuery.md
@@ -60,6 +62,7 @@ groundlight_openapi_client/api/actions_api.py
6062
groundlight_openapi_client/api/detector_groups_api.py
6163
groundlight_openapi_client/api/detector_reset_api.py
6264
groundlight_openapi_client/api/detectors_api.py
65+
groundlight_openapi_client/api/edge_api.py
6366
groundlight_openapi_client/api/image_queries_api.py
6467
groundlight_openapi_client/api/labels_api.py
6568
groundlight_openapi_client/api/notes_api.py
@@ -87,6 +90,7 @@ groundlight_openapi_client/model/detector_creation_input_request.py
8790
groundlight_openapi_client/model/detector_group.py
8891
groundlight_openapi_client/model/detector_group_request.py
8992
groundlight_openapi_client/model/detector_type_enum.py
93+
groundlight_openapi_client/model/edge_model_info.py
9094
groundlight_openapi_client/model/escalation_type_enum.py
9195
groundlight_openapi_client/model/image_query.py
9296
groundlight_openapi_client/model/image_query_type_enum.py
@@ -122,7 +126,4 @@ setup.cfg
122126
setup.py
123127
test-requirements.txt
124128
test/__init__.py
125-
test/test_text_recognition_result.py
126-
test/test_webhook_action.py
127-
test/test_webhook_action_request.py
128129
tox.ini

generated/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Class | Method | HTTP request | Description
124124
*DetectorsApi* | [**get_detector**](docs/DetectorsApi.md#get_detector) | **GET** /v1/detectors/{id} |
125125
*DetectorsApi* | [**list_detectors**](docs/DetectorsApi.md#list_detectors) | **GET** /v1/detectors |
126126
*DetectorsApi* | [**update_detector**](docs/DetectorsApi.md#update_detector) | **PATCH** /v1/detectors/{id} |
127+
*EdgeApi* | [**get_model_urls**](docs/EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ |
127128
*ImageQueriesApi* | [**get_image**](docs/ImageQueriesApi.md#get_image) | **GET** /v1/image-queries/{id}/image |
128129
*ImageQueriesApi* | [**get_image_query**](docs/ImageQueriesApi.md#get_image_query) | **GET** /v1/image-queries/{id} |
129130
*ImageQueriesApi* | [**list_image_queries**](docs/ImageQueriesApi.md#list_image_queries) | **GET** /v1/image-queries |
@@ -154,6 +155,7 @@ Class | Method | HTTP request | Description
154155
- [DetectorGroup](docs/DetectorGroup.md)
155156
- [DetectorGroupRequest](docs/DetectorGroupRequest.md)
156157
- [DetectorTypeEnum](docs/DetectorTypeEnum.md)
158+
- [EdgeModelInfo](docs/EdgeModelInfo.md)
157159
- [EscalationTypeEnum](docs/EscalationTypeEnum.md)
158160
- [ImageQuery](docs/ImageQuery.md)
159161
- [ImageQueryTypeEnum](docs/ImageQueryTypeEnum.md)

generated/docs/Detector.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Detector
22

3-
Spec for serializing a detector object in the public API.
3+
Groundlight Detectors provide answers to natural language questions about images. Each detector can answer a single question, and multiple detectors can be strung together for more complex logic. Detectors can be created through the create_detector method, or through the create_[MODE]_detector methods for pro tier users
44

55
## Properties
66
Name | Type | Description | Notes

generated/docs/EdgeApi.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# groundlight_openapi_client.EdgeApi
2+
3+
All URIs are relative to *https://api.groundlight.ai/device-api*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**get_model_urls**](EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ |
8+
9+
10+
# **get_model_urls**
11+
> EdgeModelInfo get_model_urls(detector_id)
12+
13+
14+
15+
Gets time limited pre-authenticated URLs to download a detector's edge model and oodd model.
16+
17+
### Example
18+
19+
* Api Key Authentication (ApiToken):
20+
21+
```python
22+
import time
23+
import groundlight_openapi_client
24+
from groundlight_openapi_client.api import edge_api
25+
from groundlight_openapi_client.model.edge_model_info import EdgeModelInfo
26+
from pprint import pprint
27+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
28+
# See configuration.py for a list of all supported configuration parameters.
29+
configuration = groundlight_openapi_client.Configuration(
30+
host = "https://api.groundlight.ai/device-api"
31+
)
32+
33+
# The client must configure the authentication and authorization parameters
34+
# in accordance with the API server security policy.
35+
# Examples for each auth method are provided below, use the example that
36+
# satisfies your auth use case.
37+
38+
# Configure API key authorization: ApiToken
39+
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
40+
41+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
42+
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
43+
44+
# Enter a context with an instance of the API client
45+
with groundlight_openapi_client.ApiClient(configuration) as api_client:
46+
# Create an instance of the API class
47+
api_instance = edge_api.EdgeApi(api_client)
48+
detector_id = "detector_id_example" # str |
49+
50+
# example passing only required values which don't have defaults set
51+
try:
52+
api_response = api_instance.get_model_urls(detector_id)
53+
pprint(api_response)
54+
except groundlight_openapi_client.ApiException as e:
55+
print("Exception when calling EdgeApi->get_model_urls: %s\n" % e)
56+
```
57+
58+
59+
### Parameters
60+
61+
Name | Type | Description | Notes
62+
------------- | ------------- | ------------- | -------------
63+
**detector_id** | **str**| |
64+
65+
### Return type
66+
67+
[**EdgeModelInfo**](EdgeModelInfo.md)
68+
69+
### Authorization
70+
71+
[ApiToken](../README.md#ApiToken)
72+
73+
### HTTP request headers
74+
75+
- **Content-Type**: Not defined
76+
- **Accept**: application/json
77+
78+
79+
### HTTP response details
80+
81+
| Status code | Description | Response headers |
82+
|-------------|-------------|------------------|
83+
**200** | | - |
84+
85+
[[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)
86+

generated/docs/EdgeModelInfo.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EdgeModelInfo
2+
3+
Information for the model running on edge, including temporary presigned urls to the model binaries
4+
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**model_binary_id** | **str** | | [optional]
9+
**model_binary_url** | **str** | | [optional]
10+
**oodd_model_binary_id** | **str** | | [optional]
11+
**oodd_model_binary_url** | **str** | | [optional]
12+
**pipeline_config** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
13+
**oodd_pipeline_config** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
14+
**predictor_metadata** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
15+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
16+
17+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
18+
19+

generated/docs/ImageQuery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ImageQuery
22

3-
Spec for serializing a image-query object in the public API.
3+
ImageQuery objects are the answers to natural language questions about images created by detectors.
44

55
## Properties
66
Name | Type | Description | Notes

generated/docs/PatchedDetectorRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PatchedDetectorRequest
22

3-
Spec for serializing a detector object in the public API.
3+
Groundlight Detectors provide answers to natural language questions about images. Each detector can answer a single question, and multiple detectors can be strung together for more complex logic. Detectors can be created through the create_detector method, or through the create_[MODE]_detector methods for pro tier users
44

55
## Properties
66
Name | Type | Description | Notes
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
"""
2+
Groundlight API
3+
4+
Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
5+
6+
The version of the OpenAPI document: 0.18.2
7+
Contact: support@groundlight.ai
8+
Generated by: https://openapi-generator.tech
9+
"""
10+
11+
import re # noqa: F401
12+
import sys # noqa: F401
13+
14+
from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
15+
from groundlight_openapi_client.model_utils import ( # noqa: F401
16+
check_allowed_values,
17+
check_validations,
18+
date,
19+
datetime,
20+
file_type,
21+
none_type,
22+
validate_and_convert_types,
23+
)
24+
from groundlight_openapi_client.model.edge_model_info import EdgeModelInfo
25+
26+
27+
class EdgeApi(object):
28+
"""NOTE: This class is auto generated by OpenAPI Generator
29+
Ref: https://openapi-generator.tech
30+
31+
Do not edit the class manually.
32+
"""
33+
34+
def __init__(self, api_client=None):
35+
if api_client is None:
36+
api_client = ApiClient()
37+
self.api_client = api_client
38+
self.get_model_urls_endpoint = _Endpoint(
39+
settings={
40+
"response_type": (EdgeModelInfo,),
41+
"auth": ["ApiToken"],
42+
"endpoint_path": "/v1/edge/fetch-model-urls/{detector_id}/",
43+
"operation_id": "get_model_urls",
44+
"http_method": "GET",
45+
"servers": None,
46+
},
47+
params_map={
48+
"all": [
49+
"detector_id",
50+
],
51+
"required": [
52+
"detector_id",
53+
],
54+
"nullable": [],
55+
"enum": [],
56+
"validation": [],
57+
},
58+
root_map={
59+
"validations": {},
60+
"allowed_values": {},
61+
"openapi_types": {
62+
"detector_id": (str,),
63+
},
64+
"attribute_map": {
65+
"detector_id": "detector_id",
66+
},
67+
"location_map": {
68+
"detector_id": "path",
69+
},
70+
"collection_format_map": {},
71+
},
72+
headers_map={
73+
"accept": ["application/json"],
74+
"content_type": [],
75+
},
76+
api_client=api_client,
77+
)
78+
79+
def get_model_urls(self, detector_id, **kwargs):
80+
"""get_model_urls # noqa: E501
81+
82+
Gets time limited pre-authenticated URLs to download a detector's edge model and oodd model. # noqa: E501
83+
This method makes a synchronous HTTP request by default. To make an
84+
asynchronous HTTP request, please pass async_req=True
85+
86+
>>> thread = api.get_model_urls(detector_id, async_req=True)
87+
>>> result = thread.get()
88+
89+
Args:
90+
detector_id (str):
91+
92+
Keyword Args:
93+
_return_http_data_only (bool): response data without head status
94+
code and headers. Default is True.
95+
_preload_content (bool): if False, the urllib3.HTTPResponse object
96+
will be returned without reading/decoding response data.
97+
Default is True.
98+
_request_timeout (int/float/tuple): timeout setting for this request. If
99+
one number provided, it will be total request timeout. It can also
100+
be a pair (tuple) of (connection, read) timeouts.
101+
Default is None.
102+
_check_input_type (bool): specifies if type checking
103+
should be done one the data sent to the server.
104+
Default is True.
105+
_check_return_type (bool): specifies if type checking
106+
should be done one the data received from the server.
107+
Default is True.
108+
_spec_property_naming (bool): True if the variable names in the input data
109+
are serialized names, as specified in the OpenAPI document.
110+
False if the variable names in the input data
111+
are pythonic names, e.g. snake case (default)
112+
_content_type (str/None): force body content-type.
113+
Default is None and content-type will be predicted by allowed
114+
content-types and body.
115+
_host_index (int/None): specifies the index of the server
116+
that we want to use.
117+
Default is read from the configuration.
118+
async_req (bool): execute request asynchronously
119+
120+
Returns:
121+
EdgeModelInfo
122+
If the method is called asynchronously, returns the request
123+
thread.
124+
"""
125+
kwargs["async_req"] = kwargs.get("async_req", False)
126+
kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
127+
kwargs["_preload_content"] = kwargs.get("_preload_content", True)
128+
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
129+
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
130+
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
131+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
132+
kwargs["_content_type"] = kwargs.get("_content_type")
133+
kwargs["_host_index"] = kwargs.get("_host_index")
134+
kwargs["detector_id"] = detector_id
135+
return self.get_model_urls_endpoint.call_with_http_info(**kwargs)

generated/groundlight_openapi_client/apis/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
1818
from groundlight_openapi_client.api.detector_reset_api import DetectorResetApi
1919
from groundlight_openapi_client.api.detectors_api import DetectorsApi
20+
from groundlight_openapi_client.api.edge_api import EdgeApi
2021
from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi
2122
from groundlight_openapi_client.api.labels_api import LabelsApi
2223
from groundlight_openapi_client.api.notes_api import NotesApi

0 commit comments

Comments
 (0)