|
2 | 2 | import os |
3 | 3 |
|
4 | 4 | from aimon import Client |
| 5 | +from .evaluate import Application, Model |
5 | 6 |
|
| 7 | +class DetectResult: |
| 8 | + """ |
| 9 | + A class to represent the result of an AIMon detection operation. |
6 | 10 |
|
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. |
14 | 13 |
|
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 | + """ |
20 | 31 |
|
21 | | -class DetectResult: |
22 | 32 | def __init__(self, status, detect_response, publish=None): |
23 | 33 | self.status = status |
24 | 34 | self.detect_response = detect_response |
|
0 commit comments