Skip to content

Commit

Permalink
Doc fix for create detector (#316)
Browse files Browse the repository at this point in the history
Quick fix to make the other create detector methods more easily
discovered

---------

Co-authored-by: Auto-format Bot <autoformatbot@groundlight.ai>
  • Loading branch information
brandon-groundlight and Auto-format Bot authored Feb 21, 2025
1 parent cec8e61 commit 81e1e09
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/groundlight/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def _verify_connectivity(self) -> None:
f"Error connecting to Groundlight using API token '{self.api_token_prefix}...'"
f" at endpoint '{self.endpoint}'. Endpoint might be invalid or unreachable? "
"Check https://status.groundlight.ai/ for service status."
f"Original Error was: {str(e)}"
)
raise GroundlightClientError(msg) from e

Expand Down Expand Up @@ -361,6 +362,10 @@ def create_detector( # noqa: PLR0913
"""
Create a new Detector with a given name and query.
Counting and Multiclass detectors are in Beta, and can be created through the
ExperimentalApi via the :meth:`ExperimentalApi.create_counting_detector` and
:meth:`ExperimentalApi.create_multiclass_detector` methods.
**Example usage**::
gl = Groundlight()
Expand All @@ -383,8 +388,8 @@ def create_detector( # noqa: PLR0913
# Create a detector in a specific group
detector = gl.create_detector(
name="vehicle-counter",
query="How many vehicles are in the parking lot?",
name="vehicle-monitor",
query="Are there vehicles are in the parking lot?",
group_name="parking-monitoring",
patience_time=60.0
)
Expand Down

0 comments on commit 81e1e09

Please sign in to comment.