feat: add PrimingGroup and MLPipeline SDK methods#420
Open
brandon-wada wants to merge 3 commits intomainfrom
Open
feat: add PrimingGroup and MLPipeline SDK methods#420brandon-wada wants to merge 3 commits intomainfrom
brandon-wada wants to merge 3 commits intomainfrom
Conversation
New Groundlight client methods: - list_detector_pipelines(detector) -> List[MLPipeline] - list_priming_groups() -> List[PrimingGroup] - create_priming_group(name, source_ml_pipeline_id, canonical_query, disable_shadow_pipelines) -> PrimingGroup - get_priming_group(priming_group_id) -> PrimingGroup - delete_priming_group(priming_group_id) New pydantic models in generated/model.py: MLPipeline, PrimingGroup, PaginatedMLPipelineList, PaginatedPrimingGroupList. PrimingGroups let users seed new detectors with a pre-trained model binary so they skip the cold-start period. Detectors created with priming_group_id (already supported in create_detector) will start with the primed model active.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds SDK methods for the new PrimingGroup public API (companion to axon-groundlight/zuuul#6180).
list_detector_pipelines(detector)— list all MLPipelines for a detectorcreate_priming_group(name, source_ml_pipeline_id, ...)— create a PrimingGroup seeded from an existing trained modellist_priming_groups()— list all priming groups owned by this accountget_priming_group(priming_group_id)— retrieve by IDdelete_priming_group(priming_group_id)— soft-deleteNew pydantic models:
MLPipeline,PrimingGroupingenerated/model.py.Usage
```python
gl = Groundlight()
pipelines = gl.list_detector_pipelines(detector)
active = next(p for p in pipelines if p.is_active_pipeline and p.cached_vizlogic_key)
pg = gl.create_priming_group(
name="door-detector-primer",
source_ml_pipeline_id=active.id,
canonical_query="Is the door open?",
disable_shadow_pipelines=True,
)
new_detector = gl.create_detector(
name="new-door-detector",
query="Is the door open?",
priming_group_id=pg.id,
)
```