Conversation
edge_config_example.py
Outdated
| @@ -0,0 +1,41 @@ | |||
| """Example of constructing an edge endpoint configuration programmatically.""" | |||
There was a problem hiding this comment.
This is temporary, I'll get rid of this before merging.
There was a problem hiding this comment.
Getting rid of it is too easy, grab the most important snippets and put them in docs in a md file, we auto push those to a webpage
brandon-wada
left a comment
There was a problem hiding this comment.
This looks good so far, we should discuss more what the calls to update the config on the remote machine should look like
edge_config_example.py
Outdated
| @@ -0,0 +1,41 @@ | |||
| """Example of constructing an edge endpoint configuration programmatically.""" | |||
There was a problem hiding this comment.
Getting rid of it is too easy, grab the most important snippets and put them in docs in a md file, we auto push those to a webpage
| RootEdgeConfig, | ||
| ) | ||
|
|
||
| __all__ = [ |
There was a problem hiding this comment.
Nit, this is a little redundant since it includes all objects that could be importet
There was a problem hiding this comment.
ChatGPT says: "good point. all is kept intentionally to make the public API explicit/stable for this new module (and to control wildcard-import surface), but it can be removed if repo convention prefers omitting it."
I'm not really sure which way is best...
…nto tim/edge-config
…nto tim/edge-config
Resolve conflict in edge config validation by keeping shared helper-based validation logic. Made-with: Cursor
…nto tim/edge-config
Resolve the merge conflict in test_edge_config and preserve current edge config tests. Made-with: Cursor
Moves the edge endpoint config schema from
edge-endpointinto the Python SDK so users can programmatically build and validate edge configurations.What's new
groundlight.edgesubmodule with Pydantic models ported fromedge-endpoint/app/core/configs.py:EdgeEndpointConfig-- top-level config (includesglobal_config) with ergonomicadd_detector()supportDetectorsConfig-- detector-scoped config model for detector-only workflowsInferenceConfig-- per-detector inference behavior (frozen/immutable)GlobalConfig,DetectorConfig-- supporting modelsDEFAULTEDGE_ANSWERS_WITH_ESCALATIONNO_CLOUDDISABLEDdisable_cloud_escalationrequiresalways_return_edge_prediction=Truedetectors[*].edge_inference_configmust exist inedge_inference_configs)Usage
Design decisions
InferenceConfigis frozen to prevent accidental mutation of shared preset objects.add_detector()accepts either a detector ID string or aDetectorobject (consistent with existing SDK ergonomics).add_detector(); no separate registration step is needed.EdgeEndpointConfigcomposesDetectorsConfigand delegates detector mutations throughadd_detector().DetectorsConfig.to_payload()provides explicit detector-scoped wire serialization for future HTTP use.detectorsas a list,edge_inference_configsas a dict keyed by config name).nameonInferenceConfigis excluded from serialization because it is represented as the dict key.Quality and tests
test/unit/test_edge_config.py, including:add_detector()duplicate detector ID rejectionedge_inference_configreferencesInferenceConfigobjectsInferenceConfigvalidation constraintsDetectorsConfig.to_payload()payload shapeEdgeEndpointConfig.model_dump()payload shapeFollow-up work
edge-endpointto import these models from the Python SDK instead of defining them locally.POST /set-edge-config(full config replace)GET /edge-config(get current active config)POST /set-edge-detectorswith modereplace|mergeset_edge_endpoint_config(config, *, timeout_s=...)get_edge_endpoint_config()set_edge_endpoint_detectors(detectors, *, mode="replace"|"merge", timeout_s=...)remove_edge_endpoint_detectors(detector_ids, *, timeout_s=...)