Skip to content

Commit

Permalink
Make human_review available in ask_ml. Such a counterintuitive statem…
Browse files Browse the repository at this point in the history
…ent tells us we may need to re-review the intended mental model of using the sdk
  • Loading branch information
brandon-groundlight committed Aug 26, 2024
1 parent 2a62912 commit f5f2b41
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/groundlight/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ def ask_ml( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-loca
detector: Union[Detector, str],
image: Union[str, bytes, Image.Image, BytesIO, BufferedReader, np.ndarray],
wait: Optional[float] = None,
human_review: Optional[str] = None,
metadata: Union[dict, str, None] = None,
inspection_id: Optional[str] = None,
) -> ImageQuery:
Expand All @@ -559,6 +560,14 @@ def ask_ml( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-loca
:param wait: How long to wait (in seconds) for any answer.
:param human_review: While ask_ml will return the first answer Groundlight can provide,
human_review will control whether the image is sent for human review later to improve
the model going forward.
If `None` or `DEFAULT`, send the image query for human review
only if the ML prediction is not confident.
If set to `ALWAYS`, always send the image query for human review.
If set to `NEVER`, never send the image query for human review.
:param metadata: A dictionary or JSON string of custom key/value metadata to associate with
the image query (limited to 1KB). You can retrieve this metadata later by calling
`get_image_query()`.
Expand All @@ -569,6 +578,7 @@ def ask_ml( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-loca
detector,
image,
wait=0,
human_review=human_review,
metadata=metadata,
inspection_id=inspection_id,
)
Expand Down

0 comments on commit f5f2b41

Please sign in to comment.