Skip to content

Latest commit

 

History

History

generated

groundlight-openapi-client

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.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.18.2
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >=3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import groundlight_openapi_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import groundlight_openapi_client

Getting Started

Please follow the installation procedure and then run the following:

import time
import groundlight_openapi_client
from pprint import pprint
from groundlight_openapi_client.api import actions_api
from groundlight_openapi_client.model.paginated_rule_list import PaginatedRuleList
from groundlight_openapi_client.model.rule import Rule
from groundlight_openapi_client.model.rule_request import RuleRequest
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
    host = "https://api.groundlight.ai/device-api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiToken
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'


# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = actions_api.ActionsApi(api_client)
    detector_id = "detector_id_example" # str | 
rule_request = RuleRequest(
        name="name_example",
        enabled=True,
        snooze_time_enabled=False,
        snooze_time_value=0,
        snooze_time_unit=None,
        human_review_required=False,
        condition=ConditionRequest(
            verb=VerbEnum("ANSWERED_CONSECUTIVELY"),
            parameters={
                "key": None,
            },
        ),
        action=None,
        webhook_action=[
            WebhookActionRequest(
                url="url_example",
                include_image=True,
                payload_template=None,
            ),
        ],
    ) # RuleRequest | 

    try:
        api_response = api_instance.create_rule(detector_id, rule_request)
        pprint(api_response)
    except groundlight_openapi_client.ApiException as e:
        print("Exception when calling ActionsApi->create_rule: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.groundlight.ai/device-api

Class Method HTTP request Description
ActionsApi create_rule POST /v1/actions/detector/{detector_id}/rules
ActionsApi delete_rule DELETE /v1/actions/rules/{id}
ActionsApi get_rule GET /v1/actions/rules/{id}
ActionsApi list_detector_rules GET /v1/actions/detector/{detector_id}/rules
ActionsApi list_rules GET /v1/actions/rules
DetectorGroupsApi create_detector_group POST /v1/detector-groups
DetectorGroupsApi get_detector_groups GET /v1/detector-groups
DetectorResetApi reset_detector DELETE /v1/detector-reset/{id}
DetectorsApi create_detector POST /v1/detectors
DetectorsApi delete_detector DELETE /v1/detectors/{id}
DetectorsApi get_detector GET /v1/detectors/{id}
DetectorsApi get_detector_evaluation GET /v1/detectors/{id}/evaluation
DetectorsApi get_detector_metrics GET /v1/detectors/{detector_id}/metrics
DetectorsApi list_detectors GET /v1/detectors
DetectorsApi update_detector PATCH /v1/detectors/{id}
EdgeApi get_model_urls GET /v1/edge/fetch-model-urls/{detector_id}/
ImageQueriesApi get_image GET /v1/image-queries/{id}/image
ImageQueriesApi get_image_query GET /v1/image-queries/{id}
ImageQueriesApi list_image_queries GET /v1/image-queries
ImageQueriesApi submit_image_query POST /v1/image-queries
LabelsApi create_label POST /v1/labels
NotesApi create_note POST /v1/notes
NotesApi get_notes GET /v1/notes
UserApi who_am_i GET /v1/me

Documentation For Models

Documentation For Authorization

ApiToken

  • Type: API key
  • API key parameter name: x-api-token
  • Location: HTTP header

Author

[email protected]

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in groundlight_openapi_client.apis and groundlight_openapi_client.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from groundlight_openapi_client.api.default_api import DefaultApi
  • from groundlight_openapi_client.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import groundlight_openapi_client
from groundlight_openapi_client.apis import *
from groundlight_openapi_client.models import *