Skip to content

Commit bb5adb3

Browse files
author
Preetam Joshi
committed
Adding more doc strings
1 parent 5f0948c commit bb5adb3

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

aimon/decorators/detect.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,33 @@
22
import os
33

44
from aimon import Client
5+
from .evaluate import Application, Model
56

7+
class DetectResult:
8+
"""
9+
A class to represent the result of an AIMon detection operation.
610
7-
class Application:
8-
def __init__(self, name, stage="evaluation", type="text", metadata={}):
9-
self.name = name
10-
self.stage = stage
11-
self.type = type
12-
self.metadata = metadata
13-
11+
This class encapsulates the status of the detection operation, the response from the detection service,
12+
and optionally, the response from publishing the result to the AIMon UI.
1413
15-
class Model:
16-
def __init__(self, name, model_type, metadata={}):
17-
self.name = name
18-
self.model_type = model_type
19-
self.metadata = metadata
14+
Attributes:
15+
-----------
16+
status : int
17+
The HTTP status code of the detection operation.
18+
detect_response : object
19+
The response object from the AIMon synchronous detection.
20+
publish_response : list, optional
21+
The response from publishing the result to the AIMon UI, if applicable. This is also
22+
populated when the detect operation is run in async mode.
23+
24+
Methods:
25+
--------
26+
__str__()
27+
Returns a string representation of the DetectResult object.
28+
__repr__()
29+
Returns a string representation of the DetectResult object (same as __str__).
30+
"""
2031

21-
class DetectResult:
2232
def __init__(self, status, detect_response, publish=None):
2333
self.status = status
2434
self.detect_response = detect_response

0 commit comments

Comments
 (0)