Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fde518c
Add ask_vlm method for cloud VLM alert verification
Jun 18, 2026
9a5e3e1
Automatically reformatting code
Jun 18, 2026
d3a428b
Send ask_vlm query/model_id as form fields; use friendly model alias
Jun 22, 2026
2b20fce
Update ask_vlm model_id docstring examples to vision-capable aliases
Jun 22, 2026
320887b
ask_vlm: rename images -> media, accept up to 8
Jun 22, 2026
00789e0
ask_vlm: point at renamed /v1/vlm-verifications endpoint
Jun 24, 2026
263808d
fix: correct URL path separator and add regression test
Jun 24, 2026
3cfbb7e
address PR comments: model list in docstring, timeout/corrupted-image…
Jun 24, 2026
7216313
trim ask_vlm tests to meaningful coverage only
Jun 24, 2026
6aad9e0
fix CI failures: numpy optional import, magic value constant, pylint …
Jun 25, 2026
6d8b680
address Copilot review comments on ask_vlm
Jun 25, 2026
397f9cc
fix: clarify media docstring and add /v1 deduplication regression test
Jun 25, 2026
2ca16ff
fix: register ask_vlm in CLI command groups
Jun 25, 2026
b9bf222
refactor: convert VLMVerificationResult to Pydantic BaseModel; fix ty…
Jun 25, 2026
2616477
Automatically reformatting code
Jun 25, 2026
da816d0
Generate VLM verification model from spec; move ask_vlm_verify to exp…
Jun 29, 2026
a38eb92
Automatically reformatting code
Jun 29, 2026
729ae3c
regen: run full make generate with Java — add VlmVerificationsApi + m…
Jun 29, 2026
89a91e3
fix: restore cli.py to main (only drop the ask_vlm command)
Jun 29, 2026
3c90b08
simplify: build vlm-verifications URL like create_note (no version st…
Jun 29, 2026
9d23339
fix: import VlmVerification from model, not groundlight (mypy)
Jun 29, 2026
c031c1b
fix: exclude ask_vlm_verify from CLI auto-registration
Jun 29, 2026
e574ae0
Add ask_vlm_verify as an experimental CLI command
Jun 29, 2026
1c4a496
docs: note CLI supports only a single image for now
Jun 29, 2026
532e3cb
Potential fix for pull request finding
srnangi Jun 29, 2026
4aa5e5e
Use generated VlmVerificationsApi instead of raw requests
Jun 29, 2026
7154463
Automatically reformatting code
Jun 29, 2026
09ed731
Use one-indexed media filenames (image_1.jpg, image_2.jpg, ...)
Jun 29, 2026
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
10 changes: 10 additions & 0 deletions generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ docs/TextModeConfiguration.md
docs/TextRecognitionResult.md
docs/UserApi.md
docs/VerbEnum.md
docs/VerdictEnum.md
docs/VlmVerification.md
docs/VlmVerificationCost.md
docs/VlmVerificationResult.md
docs/VlmVerificationsApi.md
docs/WebhookAction.md
docs/WebhookActionRequest.md
git_push.sh
Expand All @@ -92,6 +97,7 @@ groundlight_openapi_client/api/month_to_date_account_info_api.py
groundlight_openapi_client/api/notes_api.py
groundlight_openapi_client/api/priming_groups_api.py
groundlight_openapi_client/api/user_api.py
groundlight_openapi_client/api/vlm_verifications_api.py
groundlight_openapi_client/api_client.py
groundlight_openapi_client/apis/__init__.py
groundlight_openapi_client/configuration.py
Expand Down Expand Up @@ -162,6 +168,10 @@ groundlight_openapi_client/model/status_enum.py
groundlight_openapi_client/model/text_mode_configuration.py
groundlight_openapi_client/model/text_recognition_result.py
groundlight_openapi_client/model/verb_enum.py
groundlight_openapi_client/model/verdict_enum.py
groundlight_openapi_client/model/vlm_verification.py
groundlight_openapi_client/model/vlm_verification_cost.py
groundlight_openapi_client/model/vlm_verification_result.py
groundlight_openapi_client/model/webhook_action.py
groundlight_openapi_client/model/webhook_action_request.py
groundlight_openapi_client/model_utils.py
Expand Down
5 changes: 5 additions & 0 deletions generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Class | Method | HTTP request | Description
*PrimingGroupsApi* | [**get_priming_group**](docs/PrimingGroupsApi.md#get_priming_group) | **GET** /v1/priming-groups/{id} |
*PrimingGroupsApi* | [**list_priming_groups**](docs/PrimingGroupsApi.md#list_priming_groups) | **GET** /v1/priming-groups |
*UserApi* | [**who_am_i**](docs/UserApi.md#who_am_i) | **GET** /v1/me |
*VlmVerificationsApi* | [**submit_vlm_verification**](docs/VlmVerificationsApi.md#submit_vlm_verification) | **POST** /v1/vlm-verifications |


## Documentation For Models
Expand Down Expand Up @@ -215,6 +216,10 @@ Class | Method | HTTP request | Description
- [TextModeConfiguration](docs/TextModeConfiguration.md)
- [TextRecognitionResult](docs/TextRecognitionResult.md)
- [VerbEnum](docs/VerbEnum.md)
- [VerdictEnum](docs/VerdictEnum.md)
- [VlmVerification](docs/VlmVerification.md)
- [VlmVerificationCost](docs/VlmVerificationCost.md)
- [VlmVerificationResult](docs/VlmVerificationResult.md)
- [WebhookAction](docs/WebhookAction.md)
- [WebhookActionRequest](docs/WebhookActionRequest.md)

Expand Down
12 changes: 12 additions & 0 deletions generated/docs/VerdictEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# VerdictEnum

* `YES` - YES * `NO` - NO * `UNSURE` - UNSURE

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | * `YES` - YES * `NO` - NO * `UNSURE` - UNSURE | must be one of ["YES", "NO", "UNSURE", ]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


19 changes: 19 additions & 0 deletions generated/docs/VlmVerification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# VlmVerification

Response shape for POST /v1/vlm-verifications.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | | [readonly]
**type** | **str** | | [readonly]
**created_at** | **datetime** | | [readonly]
**query** | **str** | |
**model_id** | **str** | |
**result** | [**VlmVerificationResult**](VlmVerificationResult.md) | |
**cost** | [**VlmVerificationCost**](VlmVerificationCost.md) | |
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


14 changes: 14 additions & 0 deletions generated/docs/VlmVerificationCost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# VlmVerificationCost


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**input_tokens** | **int, none_type** | |
**output_tokens** | **int, none_type** | |
**total_cost_usd** | **float, none_type** | |
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


14 changes: 14 additions & 0 deletions generated/docs/VlmVerificationResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# VlmVerificationResult


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**verdict** | [**VerdictEnum**](VerdictEnum.md) | |
**confidence** | **float** | |
**reasoning** | **str** | |
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


100 changes: 100 additions & 0 deletions generated/docs/VlmVerificationsApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# groundlight_openapi_client.VlmVerificationsApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**submit_vlm_verification**](VlmVerificationsApi.md#submit_vlm_verification) | **POST** /v1/vlm-verifications |


# **submit_vlm_verification**
> VlmVerification submit_vlm_verification(media, query)



Submit one or more images for VLM-based alert verification. Send everything as `multipart/form-data`: one to eight `media` parts, plus a `query` field and an optional `model_id` field. The `query` describes what each image is and what to look for — the server makes no assumptions about the images' meaning. Images are presented to the model labeled `Image 1`, `Image 2`, ... in upload order, so the query can reference them (e.g. \"Image 1 is the full frame; image 2 is the cropped ROI ...\"). (Video parts are planned but not yet supported and are rejected.) Requires `ENABLE_BEDROCK_VLM_ACCESS` (enabled for Standard_Internal and SciDuck accounts) and accepted terms of service. ```bash curl https://api.groundlight.ai/device-api/v1/vlm-verifications \\ -F \"media=@full_frame.jpg;type=image/jpeg\" \\ -F \"media=@roi.jpg;type=image/jpeg\" \\ -F \"query=Image 1 is the full camera frame; image 2 is the cropped region a detector flagged. Is there really a fire?\" \\ -F \"model_id=gpt-5.4\" ```

### Example

* Api Key Authentication (ApiToken):

```python
import time
import groundlight_openapi_client
from groundlight_openapi_client.api import vlm_verifications_api
from groundlight_openapi_client.model.vlm_verification import VlmVerification
from pprint import pprint
# 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 = vlm_verifications_api.VlmVerificationsApi(api_client)
media = [
open('/path/to/file', 'rb'),
] # [file_type] | One or more images (common formats: JPEG, PNG, WEBP). Video is not yet supported.
query = "query_example" # str | Natural-language prompt describing the media and what to verify.
model_id = "model_id_example" # str | Friendly model alias (e.g. 'gpt-5.4', 'claude-sonnet-4.5'). Defaults to the server default. (optional)

# example passing only required values which don't have defaults set
try:
api_response = api_instance.submit_vlm_verification(media, query)
pprint(api_response)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling VlmVerificationsApi->submit_vlm_verification: %s\n" % e)

# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.submit_vlm_verification(media, query, model_id=model_id)
pprint(api_response)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling VlmVerificationsApi->submit_vlm_verification: %s\n" % e)
```


### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**media** | **[file_type]**| One or more images (common formats: JPEG, PNG, WEBP). Video is not yet supported. |
**query** | **str**| Natural-language prompt describing the media and what to verify. |
**model_id** | **str**| Friendly model alias (e.g. 'gpt-5.4', 'claude-sonnet-4.5'). Defaults to the server default. | [optional]

### Return type

[**VlmVerification**](VlmVerification.md)

### Authorization

[ApiToken](../README.md#ApiToken)

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: application/json


### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | | - |

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

153 changes: 153 additions & 0 deletions generated/groundlight_openapi_client/api/vlm_verifications_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
"""
Groundlight API

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

The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
Generated by: https://openapi-generator.tech
"""

import re # noqa: F401
import sys # noqa: F401

from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
from groundlight_openapi_client.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types,
)
from groundlight_openapi_client.model.vlm_verification import VlmVerification


class VlmVerificationsApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech

Do not edit the class manually.
"""

def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
self.submit_vlm_verification_endpoint = _Endpoint(
settings={
"response_type": (VlmVerification,),
"auth": ["ApiToken"],
"endpoint_path": "/v1/vlm-verifications",
"operation_id": "submit_vlm_verification",
"http_method": "POST",
"servers": None,
},
params_map={
"all": [
"media",
"query",
"model_id",
],
"required": [
"media",
"query",
],
"nullable": [],
"enum": [],
"validation": [
"media",
],
},
root_map={
"validations": {
("media",): {
"max_items": 8,
"min_items": 1,
},
},
"allowed_values": {},
"openapi_types": {
"media": ([file_type],),
"query": (str,),
"model_id": (str,),
},
"attribute_map": {
"media": "media",
"query": "query",
"model_id": "model_id",
},
"location_map": {
"media": "form",
"query": "form",
"model_id": "form",
},
"collection_format_map": {
"media": "csv",
},
},
headers_map={"accept": ["application/json"], "content_type": ["multipart/form-data"]},
api_client=api_client,
)

def submit_vlm_verification(self, media, query, **kwargs):
"""submit_vlm_verification # noqa: E501

Submit one or more images for VLM-based alert verification. Send everything as `multipart/form-data`: one to eight `media` parts, plus a `query` field and an optional `model_id` field. The `query` describes what each image is and what to look for — the server makes no assumptions about the images' meaning. Images are presented to the model labeled `Image 1`, `Image 2`, ... in upload order, so the query can reference them (e.g. \"Image 1 is the full frame; image 2 is the cropped ROI ...\"). (Video parts are planned but not yet supported and are rejected.) Requires `ENABLE_BEDROCK_VLM_ACCESS` (enabled for Standard_Internal and SciDuck accounts) and accepted terms of service. ```bash curl https://api.groundlight.ai/device-api/v1/vlm-verifications \\ -F \"media=@full_frame.jpg;type=image/jpeg\" \\ -F \"media=@roi.jpg;type=image/jpeg\" \\ -F \"query=Image 1 is the full camera frame; image 2 is the cropped region a detector flagged. Is there really a fire?\" \\ -F \"model_id=gpt-5.4\" ``` # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.submit_vlm_verification(media, query, async_req=True)
>>> result = thread.get()

Args:
media ([file_type]): One or more images (common formats: JPEG, PNG, WEBP). Video is not yet supported.
query (str): Natural-language prompt describing the media and what to verify.

Keyword Args:
model_id (str): Friendly model alias (e.g. 'gpt-5.4', 'claude-sonnet-4.5'). Defaults to the server default.. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously

Returns:
VlmVerification
If the method is called asynchronously, returns the request
thread.
"""
kwargs["async_req"] = kwargs.get("async_req", False)
kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
kwargs["_preload_content"] = kwargs.get("_preload_content", True)
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
kwargs["media"] = media
kwargs["query"] = query
return self.submit_vlm_verification_endpoint.call_with_http_info(**kwargs)
1 change: 1 addition & 0 deletions generated/groundlight_openapi_client/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
from groundlight_openapi_client.api.notes_api import NotesApi
from groundlight_openapi_client.api.priming_groups_api import PrimingGroupsApi
from groundlight_openapi_client.api.user_api import UserApi
from groundlight_openapi_client.api.vlm_verifications_api import VlmVerificationsApi
Loading
Loading