SDK Client

API Response Objects

pydantic model model.Detector

Groundlight Detectors provide answers to natural language questions about images.

Each detector can answer a single question, and multiple detectors can be strung together for more complex logic. Detectors can be created through the create_detector method, or through the create_[MODE]_detector methods for pro tier users

Show JSON schema
{
   "title": "Detector",
   "description": "Groundlight Detectors provide answers to natural language questions about images.\n\nEach detector can answer a single question, and multiple detectors can be strung together for\nmore complex logic. Detectors can be created through the create_detector method, or through the\ncreate_[MODE]_detector methods for pro tier users",
   "type": "object",
   "properties": {
      "id": {
         "description": "A unique ID for this object.",
         "title": "Id",
         "type": "string"
      },
      "type": {
         "$ref": "#/$defs/DetectorTypeEnum",
         "description": "The type of this object."
      },
      "created_at": {
         "description": "When this detector was created.",
         "format": "date-time",
         "title": "Created At",
         "type": "string"
      },
      "name": {
         "description": "A short, descriptive name for the detector.",
         "maxLength": 200,
         "title": "Name",
         "type": "string"
      },
      "query": {
         "description": "A question about the image.",
         "title": "Query",
         "type": "string"
      },
      "group_name": {
         "description": "Which group should this detector be part of?",
         "title": "Group Name",
         "type": "string"
      },
      "confidence_threshold": {
         "default": 0.9,
         "description": "If the detector's prediction is below this confidence threshold, send the image query for human review.",
         "maximum": 1.0,
         "minimum": 0.0,
         "title": "Confidence Threshold",
         "type": "number"
      },
      "patience_time": {
         "default": 30.0,
         "description": "How long Groundlight will attempt to generate a confident prediction",
         "maximum": 3600.0,
         "minimum": 0.0,
         "title": "Patience Time",
         "type": "number"
      },
      "metadata": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "description": "Metadata about the detector.",
         "title": "Metadata"
      },
      "mode": {
         "title": "Mode",
         "type": "string"
      },
      "mode_configuration": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Mode Configuration"
      },
      "status": {
         "anyOf": [
            {
               "$ref": "#/$defs/StatusEnum"
            },
            {
               "$ref": "#/$defs/BlankEnum"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Status"
      },
      "escalation_type": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Escalation Type"
      }
   },
   "$defs": {
      "BlankEnum": {
         "enum": [
            ""
         ],
         "title": "BlankEnum",
         "type": "string"
      },
      "DetectorTypeEnum": {
         "enum": [
            "detector"
         ],
         "title": "DetectorTypeEnum",
         "type": "string"
      },
      "StatusEnum": {
         "description": "* `ON` - ON\n* `OFF` - OFF",
         "enum": [
            "ON",
            "OFF"
         ],
         "title": "StatusEnum",
         "type": "string"
      }
   },
   "required": [
      "id",
      "type",
      "created_at",
      "name",
      "query",
      "group_name",
      "metadata",
      "mode",
      "mode_configuration"
   ]
}

Fields:
field confidence_threshold: confloat(ge=0.0, le=1.0) = 0.9

If the detector’s prediction is below this confidence threshold, send the image query for human review.

Constraints:
  • ge = 0.0

  • le = 1.0

field created_at: datetime [Required]

When this detector was created.

field escalation_type: str | None = None
field group_name: str [Required]

Which group should this detector be part of?

field id: str [Required]

A unique ID for this object.

field metadata: Dict[str, Any] | None [Required]

Metadata about the detector.

field mode: str [Required]
field mode_configuration: Dict[str, Any] | None [Required]
field name: constr(max_length=200) [Required]

A short, descriptive name for the detector.

Constraints:
  • max_length = 200

field patience_time: confloat(ge=0.0, le=3600.0) = 30.0

How long Groundlight will attempt to generate a confident prediction

Constraints:
  • ge = 0.0

  • le = 3600.0

field query: str [Required]

A question about the image.

field status: StatusEnum | BlankEnum | None = None
field type: DetectorTypeEnum [Required]

The type of this object.

pydantic model model.ImageQuery

ImageQuery objects are the answers to natural language questions about images created by detectors.

Show JSON schema
{
   "title": "ImageQuery",
   "description": "ImageQuery objects are the answers to natural language questions about images created by detectors.",
   "type": "object",
   "properties": {
      "metadata": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "description": "Metadata about the image query.",
         "title": "Metadata"
      },
      "id": {
         "description": "A unique ID for this object.",
         "title": "Id",
         "type": "string"
      },
      "type": {
         "$ref": "#/$defs/ImageQueryTypeEnum",
         "description": "The type of this object."
      },
      "created_at": {
         "description": "When was this detector created?",
         "format": "date-time",
         "title": "Created At",
         "type": "string"
      },
      "query": {
         "description": "A question about the image.",
         "title": "Query",
         "type": "string"
      },
      "detector_id": {
         "description": "Which detector was used on this image query?",
         "title": "Detector Id",
         "type": "string"
      },
      "result_type": {
         "$ref": "#/$defs/ResultTypeEnum",
         "description": "What type of result are we returning?"
      },
      "result": {
         "anyOf": [
            {
               "$ref": "#/$defs/BinaryClassificationResult"
            },
            {
               "$ref": "#/$defs/CountingResult"
            },
            {
               "$ref": "#/$defs/MultiClassificationResult"
            },
            {
               "$ref": "#/$defs/TextRecognitionResult"
            },
            {
               "$ref": "#/$defs/BoundingBoxResult"
            },
            {
               "type": "null"
            }
         ],
         "title": "Result"
      },
      "patience_time": {
         "description": "How long to wait for a confident response.",
         "title": "Patience Time",
         "type": "number"
      },
      "confidence_threshold": {
         "description": "Min confidence needed to accept the response of the image query.",
         "title": "Confidence Threshold",
         "type": "number"
      },
      "rois": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ROI"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "description": "An array of regions of interest (bounding boxes) collected on image",
         "title": "Rois"
      },
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "description": "A text field on image query.",
         "title": "Text"
      },
      "done_processing": {
         "default": false,
         "description": "EDGE ONLY - Whether the image query has completed escalating and will receive no new results.",
         "title": "Done Processing",
         "type": "boolean"
      }
   },
   "$defs": {
      "BBoxGeometry": {
         "description": "Mixin for serializers to handle data in the StrictBaseModel format",
         "properties": {
            "left": {
               "title": "Left",
               "type": "number"
            },
            "top": {
               "title": "Top",
               "type": "number"
            },
            "right": {
               "title": "Right",
               "type": "number"
            },
            "bottom": {
               "title": "Bottom",
               "type": "number"
            },
            "x": {
               "title": "X",
               "type": "number"
            },
            "y": {
               "title": "Y",
               "type": "number"
            }
         },
         "required": [
            "left",
            "top",
            "right",
            "bottom",
            "x",
            "y"
         ],
         "title": "BBoxGeometry",
         "type": "object"
      },
      "BinaryClassificationResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "label": {
               "title": "Label",
               "type": "string"
            }
         },
         "required": [
            "label"
         ],
         "title": "BinaryClassificationResult",
         "type": "object"
      },
      "BoundingBoxResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType5"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "label": {
               "title": "Label",
               "type": "string"
            }
         },
         "required": [
            "label"
         ],
         "title": "BoundingBoxResult",
         "type": "object"
      },
      "CountingResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType2"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "count": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Count"
            },
            "greater_than_max": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Greater Than Max"
            }
         },
         "required": [
            "count"
         ],
         "title": "CountingResult",
         "type": "object"
      },
      "ImageQueryTypeEnum": {
         "enum": [
            "image_query"
         ],
         "title": "ImageQueryTypeEnum",
         "type": "string"
      },
      "MultiClassificationResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType3"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "label": {
               "title": "Label",
               "type": "string"
            }
         },
         "required": [
            "label"
         ],
         "title": "MultiClassificationResult",
         "type": "object"
      },
      "ROI": {
         "description": "Mixin for serializers to handle data in the StrictBaseModel format",
         "properties": {
            "label": {
               "description": "The label of the bounding box.",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "The confidence of the bounding box.",
               "title": "Score",
               "type": "number"
            },
            "geometry": {
               "$ref": "#/$defs/BBoxGeometry"
            }
         },
         "required": [
            "label",
            "score",
            "geometry"
         ],
         "title": "ROI",
         "type": "object"
      },
      "ResultType": {
         "enum": [
            "binary_classification"
         ],
         "title": "ResultType",
         "type": "string"
      },
      "ResultType2": {
         "enum": [
            "counting"
         ],
         "title": "ResultType2",
         "type": "string"
      },
      "ResultType3": {
         "enum": [
            "multi_classification"
         ],
         "title": "ResultType3",
         "type": "string"
      },
      "ResultType4": {
         "enum": [
            "text_recognition"
         ],
         "title": "ResultType4",
         "type": "string"
      },
      "ResultType5": {
         "enum": [
            "bounding_box"
         ],
         "title": "ResultType5",
         "type": "string"
      },
      "ResultTypeEnum": {
         "enum": [
            "binary_classification",
            "counting",
            "multi_classification",
            "text_recognition",
            "bounding_box"
         ],
         "title": "ResultTypeEnum",
         "type": "string"
      },
      "TextRecognitionResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType4"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Text"
            },
            "truncated": {
               "title": "Truncated",
               "type": "boolean"
            }
         },
         "required": [
            "text",
            "truncated"
         ],
         "title": "TextRecognitionResult",
         "type": "object"
      }
   },
   "required": [
      "metadata",
      "id",
      "type",
      "created_at",
      "query",
      "detector_id",
      "result_type",
      "result",
      "patience_time",
      "confidence_threshold",
      "rois",
      "text"
   ]
}

Fields:
field confidence_threshold: float [Required]

Min confidence needed to accept the response of the image query.

field created_at: datetime [Required]

When was this detector created?

field detector_id: str [Required]

Which detector was used on this image query?

field done_processing: bool = False

EDGE ONLY - Whether the image query has completed escalating and will receive no new results.

field id: str [Required]

A unique ID for this object.

field metadata: Dict[str, Any] | None [Required]

Metadata about the image query.

field patience_time: float [Required]

How long to wait for a confident response.

field query: str [Required]

A question about the image.

field result: BinaryClassificationResult | CountingResult | MultiClassificationResult | TextRecognitionResult | BoundingBoxResult | None [Required]
field result_type: ResultTypeEnum [Required]

What type of result are we returning?

field rois: List[ROI] | None [Required]

An array of regions of interest (bounding boxes) collected on image

field text: str | None [Required]

A text field on image query.

field type: ImageQueryTypeEnum [Required]

The type of this object.

pydantic model model.PaginatedDetectorList

Show JSON schema
{
   "title": "PaginatedDetectorList",
   "type": "object",
   "properties": {
      "count": {
         "examples": [
            123
         ],
         "title": "Count",
         "type": "integer"
      },
      "next": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "http://api.example.org/accounts/?page=4"
         ],
         "title": "Next"
      },
      "previous": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "http://api.example.org/accounts/?page=2"
         ],
         "title": "Previous"
      },
      "results": {
         "items": {
            "$ref": "#/$defs/Detector"
         },
         "title": "Results",
         "type": "array"
      }
   },
   "$defs": {
      "BlankEnum": {
         "enum": [
            ""
         ],
         "title": "BlankEnum",
         "type": "string"
      },
      "Detector": {
         "description": "Groundlight Detectors provide answers to natural language questions about images.\n\nEach detector can answer a single question, and multiple detectors can be strung together for\nmore complex logic. Detectors can be created through the create_detector method, or through the\ncreate_[MODE]_detector methods for pro tier users",
         "properties": {
            "id": {
               "description": "A unique ID for this object.",
               "title": "Id",
               "type": "string"
            },
            "type": {
               "$ref": "#/$defs/DetectorTypeEnum",
               "description": "The type of this object."
            },
            "created_at": {
               "description": "When this detector was created.",
               "format": "date-time",
               "title": "Created At",
               "type": "string"
            },
            "name": {
               "description": "A short, descriptive name for the detector.",
               "maxLength": 200,
               "title": "Name",
               "type": "string"
            },
            "query": {
               "description": "A question about the image.",
               "title": "Query",
               "type": "string"
            },
            "group_name": {
               "description": "Which group should this detector be part of?",
               "title": "Group Name",
               "type": "string"
            },
            "confidence_threshold": {
               "default": 0.9,
               "description": "If the detector's prediction is below this confidence threshold, send the image query for human review.",
               "maximum": 1.0,
               "minimum": 0.0,
               "title": "Confidence Threshold",
               "type": "number"
            },
            "patience_time": {
               "default": 30.0,
               "description": "How long Groundlight will attempt to generate a confident prediction",
               "maximum": 3600.0,
               "minimum": 0.0,
               "title": "Patience Time",
               "type": "number"
            },
            "metadata": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Metadata about the detector.",
               "title": "Metadata"
            },
            "mode": {
               "title": "Mode",
               "type": "string"
            },
            "mode_configuration": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Mode Configuration"
            },
            "status": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StatusEnum"
                  },
                  {
                     "$ref": "#/$defs/BlankEnum"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Status"
            },
            "escalation_type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Escalation Type"
            }
         },
         "required": [
            "id",
            "type",
            "created_at",
            "name",
            "query",
            "group_name",
            "metadata",
            "mode",
            "mode_configuration"
         ],
         "title": "Detector",
         "type": "object"
      },
      "DetectorTypeEnum": {
         "enum": [
            "detector"
         ],
         "title": "DetectorTypeEnum",
         "type": "string"
      },
      "StatusEnum": {
         "description": "* `ON` - ON\n* `OFF` - OFF",
         "enum": [
            "ON",
            "OFF"
         ],
         "title": "StatusEnum",
         "type": "string"
      }
   },
   "required": [
      "count",
      "results"
   ]
}

Fields:
field count: int [Required]
field next: AnyUrl | None = None
field previous: AnyUrl | None = None
field results: List[Detector] [Required]
pydantic model model.PaginatedImageQueryList

Show JSON schema
{
   "title": "PaginatedImageQueryList",
   "type": "object",
   "properties": {
      "count": {
         "examples": [
            123
         ],
         "title": "Count",
         "type": "integer"
      },
      "next": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "http://api.example.org/accounts/?page=4"
         ],
         "title": "Next"
      },
      "previous": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "http://api.example.org/accounts/?page=2"
         ],
         "title": "Previous"
      },
      "results": {
         "items": {
            "$ref": "#/$defs/ImageQuery"
         },
         "title": "Results",
         "type": "array"
      }
   },
   "$defs": {
      "BBoxGeometry": {
         "description": "Mixin for serializers to handle data in the StrictBaseModel format",
         "properties": {
            "left": {
               "title": "Left",
               "type": "number"
            },
            "top": {
               "title": "Top",
               "type": "number"
            },
            "right": {
               "title": "Right",
               "type": "number"
            },
            "bottom": {
               "title": "Bottom",
               "type": "number"
            },
            "x": {
               "title": "X",
               "type": "number"
            },
            "y": {
               "title": "Y",
               "type": "number"
            }
         },
         "required": [
            "left",
            "top",
            "right",
            "bottom",
            "x",
            "y"
         ],
         "title": "BBoxGeometry",
         "type": "object"
      },
      "BinaryClassificationResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "label": {
               "title": "Label",
               "type": "string"
            }
         },
         "required": [
            "label"
         ],
         "title": "BinaryClassificationResult",
         "type": "object"
      },
      "BoundingBoxResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType5"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "label": {
               "title": "Label",
               "type": "string"
            }
         },
         "required": [
            "label"
         ],
         "title": "BoundingBoxResult",
         "type": "object"
      },
      "CountingResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType2"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "count": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Count"
            },
            "greater_than_max": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Greater Than Max"
            }
         },
         "required": [
            "count"
         ],
         "title": "CountingResult",
         "type": "object"
      },
      "ImageQuery": {
         "description": "ImageQuery objects are the answers to natural language questions about images created by detectors.",
         "properties": {
            "metadata": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Metadata about the image query.",
               "title": "Metadata"
            },
            "id": {
               "description": "A unique ID for this object.",
               "title": "Id",
               "type": "string"
            },
            "type": {
               "$ref": "#/$defs/ImageQueryTypeEnum",
               "description": "The type of this object."
            },
            "created_at": {
               "description": "When was this detector created?",
               "format": "date-time",
               "title": "Created At",
               "type": "string"
            },
            "query": {
               "description": "A question about the image.",
               "title": "Query",
               "type": "string"
            },
            "detector_id": {
               "description": "Which detector was used on this image query?",
               "title": "Detector Id",
               "type": "string"
            },
            "result_type": {
               "$ref": "#/$defs/ResultTypeEnum",
               "description": "What type of result are we returning?"
            },
            "result": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BinaryClassificationResult"
                  },
                  {
                     "$ref": "#/$defs/CountingResult"
                  },
                  {
                     "$ref": "#/$defs/MultiClassificationResult"
                  },
                  {
                     "$ref": "#/$defs/TextRecognitionResult"
                  },
                  {
                     "$ref": "#/$defs/BoundingBoxResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Result"
            },
            "patience_time": {
               "description": "How long to wait for a confident response.",
               "title": "Patience Time",
               "type": "number"
            },
            "confidence_threshold": {
               "description": "Min confidence needed to accept the response of the image query.",
               "title": "Confidence Threshold",
               "type": "number"
            },
            "rois": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ROI"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "An array of regions of interest (bounding boxes) collected on image",
               "title": "Rois"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "A text field on image query.",
               "title": "Text"
            },
            "done_processing": {
               "default": false,
               "description": "EDGE ONLY - Whether the image query has completed escalating and will receive no new results.",
               "title": "Done Processing",
               "type": "boolean"
            }
         },
         "required": [
            "metadata",
            "id",
            "type",
            "created_at",
            "query",
            "detector_id",
            "result_type",
            "result",
            "patience_time",
            "confidence_threshold",
            "rois",
            "text"
         ],
         "title": "ImageQuery",
         "type": "object"
      },
      "ImageQueryTypeEnum": {
         "enum": [
            "image_query"
         ],
         "title": "ImageQueryTypeEnum",
         "type": "string"
      },
      "MultiClassificationResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType3"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "label": {
               "title": "Label",
               "type": "string"
            }
         },
         "required": [
            "label"
         ],
         "title": "MultiClassificationResult",
         "type": "object"
      },
      "ROI": {
         "description": "Mixin for serializers to handle data in the StrictBaseModel format",
         "properties": {
            "label": {
               "description": "The label of the bounding box.",
               "title": "Label",
               "type": "string"
            },
            "score": {
               "description": "The confidence of the bounding box.",
               "title": "Score",
               "type": "number"
            },
            "geometry": {
               "$ref": "#/$defs/BBoxGeometry"
            }
         },
         "required": [
            "label",
            "score",
            "geometry"
         ],
         "title": "ROI",
         "type": "object"
      },
      "ResultType": {
         "enum": [
            "binary_classification"
         ],
         "title": "ResultType",
         "type": "string"
      },
      "ResultType2": {
         "enum": [
            "counting"
         ],
         "title": "ResultType2",
         "type": "string"
      },
      "ResultType3": {
         "enum": [
            "multi_classification"
         ],
         "title": "ResultType3",
         "type": "string"
      },
      "ResultType4": {
         "enum": [
            "text_recognition"
         ],
         "title": "ResultType4",
         "type": "string"
      },
      "ResultType5": {
         "enum": [
            "bounding_box"
         ],
         "title": "ResultType5",
         "type": "string"
      },
      "ResultTypeEnum": {
         "enum": [
            "binary_classification",
            "counting",
            "multi_classification",
            "text_recognition",
            "bounding_box"
         ],
         "title": "ResultTypeEnum",
         "type": "string"
      },
      "TextRecognitionResult": {
         "properties": {
            "confidence": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Confidence"
            },
            "source": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source"
            },
            "result_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResultType4"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "from_edge": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From Edge"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Text"
            },
            "truncated": {
               "title": "Truncated",
               "type": "boolean"
            }
         },
         "required": [
            "text",
            "truncated"
         ],
         "title": "TextRecognitionResult",
         "type": "object"
      }
   },
   "required": [
      "count",
      "results"
   ]
}

Fields:
field count: int [Required]
field next: AnyUrl | None = None
field previous: AnyUrl | None = None
field results: List[ImageQuery] [Required]
pydantic model model.Rule

Show JSON schema
{
   "title": "Rule",
   "type": "object",
   "properties": {
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "detector_id": {
         "title": "Detector Id",
         "type": "string"
      },
      "detector_name": {
         "title": "Detector Name",
         "type": "string"
      },
      "name": {
         "maxLength": 44,
         "title": "Name",
         "type": "string"
      },
      "enabled": {
         "default": true,
         "title": "Enabled",
         "type": "boolean"
      },
      "snooze_time_enabled": {
         "default": false,
         "title": "Snooze Time Enabled",
         "type": "boolean"
      },
      "snooze_time_value": {
         "default": 0,
         "minimum": 0,
         "title": "Snooze Time Value",
         "type": "integer"
      },
      "snooze_time_unit": {
         "$ref": "#/$defs/SnoozeTimeUnitEnum",
         "default": "DAYS"
      },
      "human_review_required": {
         "default": false,
         "title": "Human Review Required",
         "type": "boolean"
      },
      "condition": {
         "$ref": "#/$defs/Condition"
      },
      "action": {
         "anyOf": [
            {
               "$ref": "#/$defs/Action"
            },
            {
               "$ref": "#/$defs/ActionList"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Action"
      },
      "webhook_action": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/WebhookAction"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Webhook Action"
      }
   },
   "$defs": {
      "Action": {
         "properties": {
            "channel": {
               "$ref": "#/$defs/ChannelEnum"
            },
            "recipient": {
               "title": "Recipient",
               "type": "string"
            },
            "include_image": {
               "title": "Include Image",
               "type": "boolean"
            }
         },
         "required": [
            "channel",
            "recipient",
            "include_image"
         ],
         "title": "Action",
         "type": "object"
      },
      "ActionList": {
         "items": {
            "$ref": "#/$defs/Action"
         },
         "title": "ActionList",
         "type": "array"
      },
      "ChannelEnum": {
         "enum": [
            "TEXT",
            "EMAIL"
         ],
         "title": "ChannelEnum",
         "type": "string"
      },
      "Condition": {
         "properties": {
            "verb": {
               "title": "Verb",
               "type": "string"
            },
            "parameters": {
               "additionalProperties": true,
               "title": "Parameters",
               "type": "object"
            }
         },
         "required": [
            "verb",
            "parameters"
         ],
         "title": "Condition",
         "type": "object"
      },
      "PayloadTemplate": {
         "properties": {
            "template": {
               "title": "Template",
               "type": "string"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Headers"
            }
         },
         "required": [
            "template"
         ],
         "title": "PayloadTemplate",
         "type": "object"
      },
      "SnoozeTimeUnitEnum": {
         "description": "* `DAYS` - DAYS\n* `HOURS` - HOURS\n* `MINUTES` - MINUTES\n* `SECONDS` - SECONDS",
         "enum": [
            "DAYS",
            "HOURS",
            "MINUTES",
            "SECONDS"
         ],
         "title": "SnoozeTimeUnitEnum",
         "type": "string"
      },
      "WebhookAction": {
         "properties": {
            "url": {
               "format": "uri",
               "minLength": 1,
               "title": "Url",
               "type": "string"
            },
            "include_image": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Include Image"
            },
            "payload_template": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PayloadTemplate"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "last_message_failed": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Last Message Failed"
            },
            "last_failure_error": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Last Failure Error"
            },
            "last_failed_at": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Last Failed At"
            }
         },
         "required": [
            "url"
         ],
         "title": "WebhookAction",
         "type": "object"
      }
   },
   "required": [
      "id",
      "detector_id",
      "detector_name",
      "name",
      "condition"
   ]
}

Fields:
field action: Action | ActionList | None = None
field condition: Condition [Required]
field detector_id: str [Required]
field detector_name: str [Required]
field enabled: bool = True
field human_review_required: bool = False
field id: int [Required]
field name: constr(max_length=44) [Required]
Constraints:
  • max_length = 44

field snooze_time_enabled: bool = False
field snooze_time_unit: SnoozeTimeUnitEnum = 'DAYS'
field snooze_time_value: conint(ge=0) = 0
Constraints:
  • ge = 0

field webhook_action: List[WebhookAction] | None = None
pydantic model model.PaginatedRuleList

Show JSON schema
{
   "title": "PaginatedRuleList",
   "type": "object",
   "properties": {
      "count": {
         "examples": [
            123
         ],
         "title": "Count",
         "type": "integer"
      },
      "next": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "http://api.example.org/accounts/?page=4"
         ],
         "title": "Next"
      },
      "previous": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "http://api.example.org/accounts/?page=2"
         ],
         "title": "Previous"
      },
      "results": {
         "items": {
            "$ref": "#/$defs/Rule"
         },
         "title": "Results",
         "type": "array"
      }
   },
   "$defs": {
      "Action": {
         "properties": {
            "channel": {
               "$ref": "#/$defs/ChannelEnum"
            },
            "recipient": {
               "title": "Recipient",
               "type": "string"
            },
            "include_image": {
               "title": "Include Image",
               "type": "boolean"
            }
         },
         "required": [
            "channel",
            "recipient",
            "include_image"
         ],
         "title": "Action",
         "type": "object"
      },
      "ActionList": {
         "items": {
            "$ref": "#/$defs/Action"
         },
         "title": "ActionList",
         "type": "array"
      },
      "ChannelEnum": {
         "enum": [
            "TEXT",
            "EMAIL"
         ],
         "title": "ChannelEnum",
         "type": "string"
      },
      "Condition": {
         "properties": {
            "verb": {
               "title": "Verb",
               "type": "string"
            },
            "parameters": {
               "additionalProperties": true,
               "title": "Parameters",
               "type": "object"
            }
         },
         "required": [
            "verb",
            "parameters"
         ],
         "title": "Condition",
         "type": "object"
      },
      "PayloadTemplate": {
         "properties": {
            "template": {
               "title": "Template",
               "type": "string"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Headers"
            }
         },
         "required": [
            "template"
         ],
         "title": "PayloadTemplate",
         "type": "object"
      },
      "Rule": {
         "properties": {
            "id": {
               "title": "Id",
               "type": "integer"
            },
            "detector_id": {
               "title": "Detector Id",
               "type": "string"
            },
            "detector_name": {
               "title": "Detector Name",
               "type": "string"
            },
            "name": {
               "maxLength": 44,
               "title": "Name",
               "type": "string"
            },
            "enabled": {
               "default": true,
               "title": "Enabled",
               "type": "boolean"
            },
            "snooze_time_enabled": {
               "default": false,
               "title": "Snooze Time Enabled",
               "type": "boolean"
            },
            "snooze_time_value": {
               "default": 0,
               "minimum": 0,
               "title": "Snooze Time Value",
               "type": "integer"
            },
            "snooze_time_unit": {
               "$ref": "#/$defs/SnoozeTimeUnitEnum",
               "default": "DAYS"
            },
            "human_review_required": {
               "default": false,
               "title": "Human Review Required",
               "type": "boolean"
            },
            "condition": {
               "$ref": "#/$defs/Condition"
            },
            "action": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Action"
                  },
                  {
                     "$ref": "#/$defs/ActionList"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Action"
            },
            "webhook_action": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/WebhookAction"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Webhook Action"
            }
         },
         "required": [
            "id",
            "detector_id",
            "detector_name",
            "name",
            "condition"
         ],
         "title": "Rule",
         "type": "object"
      },
      "SnoozeTimeUnitEnum": {
         "description": "* `DAYS` - DAYS\n* `HOURS` - HOURS\n* `MINUTES` - MINUTES\n* `SECONDS` - SECONDS",
         "enum": [
            "DAYS",
            "HOURS",
            "MINUTES",
            "SECONDS"
         ],
         "title": "SnoozeTimeUnitEnum",
         "type": "string"
      },
      "WebhookAction": {
         "properties": {
            "url": {
               "format": "uri",
               "minLength": 1,
               "title": "Url",
               "type": "string"
            },
            "include_image": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Include Image"
            },
            "payload_template": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PayloadTemplate"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "last_message_failed": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Last Message Failed"
            },
            "last_failure_error": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Last Failure Error"
            },
            "last_failed_at": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Last Failed At"
            }
         },
         "required": [
            "url"
         ],
         "title": "WebhookAction",
         "type": "object"
      }
   },
   "required": [
      "count",
      "results"
   ]
}

Fields:
field count: int [Required]
field next: AnyUrl | None = None
field previous: AnyUrl | None = None
field results: List[Rule] [Required]