orca-sdk 0.0.93__py3-none-any.whl → 0.0.95__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orca_sdk/__init__.py +13 -4
- orca_sdk/_generated_api_client/api/__init__.py +84 -34
- orca_sdk/_generated_api_client/api/classification_model/create_classification_model_classification_model_post.py +170 -0
- orca_sdk/_generated_api_client/api/classification_model/{get_model_classification_model_name_or_id_get.py → delete_classification_model_classification_model_name_or_id_delete.py} +20 -20
- orca_sdk/_generated_api_client/api/classification_model/{delete_evaluation_classification_model_model_name_or_id_evaluation_task_id_delete.py → delete_classification_model_evaluation_classification_model_model_name_or_id_evaluation_task_id_delete.py} +4 -4
- orca_sdk/_generated_api_client/api/classification_model/{create_evaluation_classification_model_model_name_or_id_evaluation_post.py → evaluate_classification_model_classification_model_model_name_or_id_evaluation_post.py} +14 -14
- orca_sdk/_generated_api_client/api/classification_model/get_classification_model_classification_model_name_or_id_get.py +156 -0
- orca_sdk/_generated_api_client/api/classification_model/{get_evaluation_classification_model_model_name_or_id_evaluation_task_id_get.py → get_classification_model_evaluation_classification_model_model_name_or_id_evaluation_task_id_get.py} +16 -16
- orca_sdk/_generated_api_client/api/classification_model/{list_evaluations_classification_model_model_name_or_id_evaluation_get.py → list_classification_model_evaluations_classification_model_model_name_or_id_evaluation_get.py} +16 -16
- orca_sdk/_generated_api_client/api/classification_model/list_classification_models_classification_model_get.py +127 -0
- orca_sdk/_generated_api_client/api/classification_model/{predict_gpu_classification_model_name_or_id_prediction_post.py → predict_label_gpu_classification_model_name_or_id_prediction_post.py} +14 -14
- orca_sdk/_generated_api_client/api/classification_model/update_classification_model_classification_model_name_or_id_patch.py +183 -0
- orca_sdk/_generated_api_client/api/datasource/download_datasource_datasource_name_or_id_download_get.py +172 -0
- orca_sdk/_generated_api_client/api/memoryset/clone_memoryset_memoryset_name_or_id_clone_post.py +22 -22
- orca_sdk/_generated_api_client/api/memoryset/create_memoryset_memoryset_post.py +22 -22
- orca_sdk/_generated_api_client/api/memoryset/get_memories_memoryset_name_or_id_memories_get_post.py +38 -16
- orca_sdk/_generated_api_client/api/memoryset/get_memory_memoryset_name_or_id_memory_memory_id_get.py +29 -12
- orca_sdk/_generated_api_client/api/memoryset/get_memoryset_memoryset_name_or_id_get.py +12 -12
- orca_sdk/_generated_api_client/api/memoryset/insert_memories_gpu_memoryset_name_or_id_memory_post.py +17 -14
- orca_sdk/_generated_api_client/api/memoryset/list_memorysets_memoryset_get.py +72 -19
- orca_sdk/_generated_api_client/api/memoryset/memoryset_lookup_gpu_memoryset_name_or_id_lookup_post.py +31 -12
- orca_sdk/_generated_api_client/api/memoryset/potential_duplicate_groups_memoryset_name_or_id_potential_duplicate_groups_get.py +49 -20
- orca_sdk/_generated_api_client/api/memoryset/query_memoryset_memoryset_name_or_id_memories_post.py +38 -16
- orca_sdk/_generated_api_client/api/memoryset/update_memories_gpu_memoryset_name_or_id_memories_patch.py +54 -29
- orca_sdk/_generated_api_client/api/memoryset/update_memory_gpu_memoryset_name_or_id_memory_patch.py +44 -26
- orca_sdk/_generated_api_client/api/memoryset/update_memoryset_memoryset_name_or_id_patch.py +22 -22
- orca_sdk/_generated_api_client/api/predictive_model/__init__.py +0 -0
- orca_sdk/_generated_api_client/api/predictive_model/list_predictive_models_predictive_model_get.py +150 -0
- orca_sdk/_generated_api_client/api/regression_model/__init__.py +0 -0
- orca_sdk/_generated_api_client/api/{classification_model/create_model_classification_model_post.py → regression_model/create_regression_model_regression_model_post.py} +27 -27
- orca_sdk/_generated_api_client/api/regression_model/delete_regression_model_evaluation_regression_model_model_name_or_id_evaluation_task_id_delete.py +168 -0
- orca_sdk/_generated_api_client/api/{classification_model/delete_model_classification_model_name_or_id_delete.py → regression_model/delete_regression_model_regression_model_name_or_id_delete.py} +5 -5
- orca_sdk/_generated_api_client/api/regression_model/evaluate_regression_model_regression_model_model_name_or_id_evaluation_post.py +183 -0
- orca_sdk/_generated_api_client/api/regression_model/get_regression_model_evaluation_regression_model_model_name_or_id_evaluation_task_id_get.py +170 -0
- orca_sdk/_generated_api_client/api/regression_model/get_regression_model_regression_model_name_or_id_get.py +156 -0
- orca_sdk/_generated_api_client/api/regression_model/list_regression_model_evaluations_regression_model_model_name_or_id_evaluation_get.py +161 -0
- orca_sdk/_generated_api_client/api/{classification_model/list_models_classification_model_get.py → regression_model/list_regression_models_regression_model_get.py} +17 -17
- orca_sdk/_generated_api_client/api/regression_model/predict_score_gpu_regression_model_name_or_id_prediction_post.py +190 -0
- orca_sdk/_generated_api_client/api/{classification_model/update_model_classification_model_name_or_id_patch.py → regression_model/update_regression_model_regression_model_name_or_id_patch.py} +27 -27
- orca_sdk/_generated_api_client/api/task/get_task_task_task_id_get.py +156 -0
- orca_sdk/_generated_api_client/api/task/list_tasks_task_get.py +60 -10
- orca_sdk/_generated_api_client/api/telemetry/count_predictions_telemetry_prediction_count_post.py +10 -10
- orca_sdk/_generated_api_client/api/telemetry/get_prediction_telemetry_prediction_prediction_id_get.py +35 -12
- orca_sdk/_generated_api_client/api/telemetry/list_memories_with_feedback_telemetry_memories_post.py +20 -12
- orca_sdk/_generated_api_client/api/telemetry/list_predictions_telemetry_prediction_post.py +35 -12
- orca_sdk/_generated_api_client/models/__init__.py +90 -24
- orca_sdk/_generated_api_client/models/base_score_prediction_result.py +108 -0
- orca_sdk/_generated_api_client/models/{evaluation_request.py → classification_evaluation_request.py} +13 -45
- orca_sdk/_generated_api_client/models/{classification_evaluation_result.py → classification_metrics.py} +106 -56
- orca_sdk/_generated_api_client/models/{rac_model_metadata.py → classification_model_metadata.py} +51 -43
- orca_sdk/_generated_api_client/models/{prediction_request.py → classification_prediction_request.py} +31 -6
- orca_sdk/_generated_api_client/models/{clone_labeled_memoryset_request.py → clone_memoryset_request.py} +5 -5
- orca_sdk/_generated_api_client/models/column_info.py +31 -0
- orca_sdk/_generated_api_client/models/count_predictions_request.py +195 -0
- orca_sdk/_generated_api_client/models/{create_rac_model_request.py → create_classification_model_request.py} +25 -57
- orca_sdk/_generated_api_client/models/{create_labeled_memoryset_request.py → create_memoryset_request.py} +73 -56
- orca_sdk/_generated_api_client/models/create_memoryset_request_index_params.py +66 -0
- orca_sdk/_generated_api_client/models/create_memoryset_request_index_type.py +13 -0
- orca_sdk/_generated_api_client/models/create_regression_model_request.py +137 -0
- orca_sdk/_generated_api_client/models/embedding_evaluation_payload.py +187 -0
- orca_sdk/_generated_api_client/models/embedding_evaluation_response.py +10 -0
- orca_sdk/_generated_api_client/models/evaluation_response.py +22 -9
- orca_sdk/_generated_api_client/models/evaluation_response_classification_metrics.py +140 -0
- orca_sdk/_generated_api_client/models/evaluation_response_regression_metrics.py +140 -0
- orca_sdk/_generated_api_client/models/http_validation_error.py +86 -0
- orca_sdk/_generated_api_client/models/list_predictions_request.py +62 -0
- orca_sdk/_generated_api_client/models/memory_type.py +9 -0
- orca_sdk/_generated_api_client/models/memoryset_analysis_configs.py +0 -20
- orca_sdk/_generated_api_client/models/{labeled_memoryset_metadata.py → memoryset_metadata.py} +73 -13
- orca_sdk/_generated_api_client/models/memoryset_metadata_index_params.py +55 -0
- orca_sdk/_generated_api_client/models/memoryset_metadata_index_type.py +13 -0
- orca_sdk/_generated_api_client/models/{labeled_memoryset_update.py → memoryset_update.py} +19 -31
- orca_sdk/_generated_api_client/models/not_found_error_response_resource_type_0.py +1 -0
- orca_sdk/_generated_api_client/models/{paginated_labeled_memory_with_feedback_metrics.py → paginated_union_labeled_memory_with_feedback_metrics_scored_memory_with_feedback_metrics.py} +37 -10
- orca_sdk/_generated_api_client/models/{precision_recall_curve.py → pr_curve.py} +5 -13
- orca_sdk/_generated_api_client/models/{rac_model_update.py → predictive_model_update.py} +14 -5
- orca_sdk/_generated_api_client/models/pretrained_embedding_model_metadata.py +11 -1
- orca_sdk/_generated_api_client/models/pretrained_embedding_model_name.py +5 -0
- orca_sdk/_generated_api_client/models/rar_head_type.py +8 -0
- orca_sdk/_generated_api_client/models/regression_evaluation_request.py +148 -0
- orca_sdk/_generated_api_client/models/regression_metrics.py +172 -0
- orca_sdk/_generated_api_client/models/regression_model_metadata.py +177 -0
- orca_sdk/_generated_api_client/models/regression_prediction_request.py +195 -0
- orca_sdk/_generated_api_client/models/roc_curve.py +0 -8
- orca_sdk/_generated_api_client/models/score_prediction_memory_lookup.py +196 -0
- orca_sdk/_generated_api_client/models/score_prediction_memory_lookup_metadata.py +68 -0
- orca_sdk/_generated_api_client/models/score_prediction_with_memories_and_feedback.py +252 -0
- orca_sdk/_generated_api_client/models/scored_memory.py +172 -0
- orca_sdk/_generated_api_client/models/scored_memory_insert.py +128 -0
- orca_sdk/_generated_api_client/models/scored_memory_insert_metadata.py +68 -0
- orca_sdk/_generated_api_client/models/scored_memory_lookup.py +180 -0
- orca_sdk/_generated_api_client/models/scored_memory_lookup_metadata.py +68 -0
- orca_sdk/_generated_api_client/models/scored_memory_metadata.py +68 -0
- orca_sdk/_generated_api_client/models/scored_memory_update.py +171 -0
- orca_sdk/_generated_api_client/models/scored_memory_update_metadata_type_0.py +68 -0
- orca_sdk/_generated_api_client/models/scored_memory_with_feedback_metrics.py +193 -0
- orca_sdk/_generated_api_client/models/scored_memory_with_feedback_metrics_feedback_metrics.py +68 -0
- orca_sdk/_generated_api_client/models/scored_memory_with_feedback_metrics_metadata.py +68 -0
- orca_sdk/_generated_api_client/models/update_prediction_request.py +20 -0
- orca_sdk/_generated_api_client/models/validation_error.py +99 -0
- orca_sdk/_shared/__init__.py +9 -1
- orca_sdk/_shared/metrics.py +257 -87
- orca_sdk/_shared/metrics_test.py +136 -77
- orca_sdk/_utils/data_parsing.py +0 -3
- orca_sdk/_utils/data_parsing_test.py +0 -3
- orca_sdk/_utils/prediction_result_ui.py +55 -23
- orca_sdk/classification_model.py +184 -174
- orca_sdk/classification_model_test.py +178 -142
- orca_sdk/conftest.py +77 -26
- orca_sdk/datasource.py +34 -0
- orca_sdk/datasource_test.py +9 -1
- orca_sdk/embedding_model.py +136 -14
- orca_sdk/embedding_model_test.py +10 -6
- orca_sdk/job.py +329 -0
- orca_sdk/job_test.py +48 -0
- orca_sdk/memoryset.py +882 -161
- orca_sdk/memoryset_test.py +58 -23
- orca_sdk/regression_model.py +647 -0
- orca_sdk/regression_model_test.py +338 -0
- orca_sdk/telemetry.py +225 -106
- orca_sdk/telemetry_test.py +34 -30
- {orca_sdk-0.0.93.dist-info → orca_sdk-0.0.95.dist-info}/METADATA +2 -4
- {orca_sdk-0.0.93.dist-info → orca_sdk-0.0.95.dist-info}/RECORD +124 -74
- orca_sdk/_utils/task.py +0 -73
- {orca_sdk-0.0.93.dist-info → orca_sdk-0.0.95.dist-info}/WHEEL +0 -0
|
@@ -21,6 +21,7 @@ from dateutil.parser import isoparse
|
|
|
21
21
|
from ..models.task_status import TaskStatus
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
|
+
from ..models.embedding_evaluation_payload import EmbeddingEvaluationPayload
|
|
24
25
|
from ..models.embedding_evaluation_result import EmbeddingEvaluationResult
|
|
25
26
|
|
|
26
27
|
|
|
@@ -36,6 +37,7 @@ class EmbeddingEvaluationResponse:
|
|
|
36
37
|
datasource_id (str):
|
|
37
38
|
status (TaskStatus): Status of task in the task queue
|
|
38
39
|
result (Union['EmbeddingEvaluationResult', None]):
|
|
40
|
+
payload (EmbeddingEvaluationPayload):
|
|
39
41
|
created_at (datetime.datetime):
|
|
40
42
|
updated_at (datetime.datetime):
|
|
41
43
|
"""
|
|
@@ -45,6 +47,7 @@ class EmbeddingEvaluationResponse:
|
|
|
45
47
|
datasource_id: str
|
|
46
48
|
status: TaskStatus
|
|
47
49
|
result: Union["EmbeddingEvaluationResult", None]
|
|
50
|
+
payload: "EmbeddingEvaluationPayload"
|
|
48
51
|
created_at: datetime.datetime
|
|
49
52
|
updated_at: datetime.datetime
|
|
50
53
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
@@ -66,6 +69,8 @@ class EmbeddingEvaluationResponse:
|
|
|
66
69
|
else:
|
|
67
70
|
result = self.result
|
|
68
71
|
|
|
72
|
+
payload = self.payload.to_dict()
|
|
73
|
+
|
|
69
74
|
created_at = self.created_at.isoformat()
|
|
70
75
|
|
|
71
76
|
updated_at = self.updated_at.isoformat()
|
|
@@ -79,6 +84,7 @@ class EmbeddingEvaluationResponse:
|
|
|
79
84
|
"datasource_id": datasource_id,
|
|
80
85
|
"status": status,
|
|
81
86
|
"result": result,
|
|
87
|
+
"payload": payload,
|
|
82
88
|
"created_at": created_at,
|
|
83
89
|
"updated_at": updated_at,
|
|
84
90
|
}
|
|
@@ -88,6 +94,7 @@ class EmbeddingEvaluationResponse:
|
|
|
88
94
|
|
|
89
95
|
@classmethod
|
|
90
96
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
97
|
+
from ..models.embedding_evaluation_payload import EmbeddingEvaluationPayload
|
|
91
98
|
from ..models.embedding_evaluation_result import EmbeddingEvaluationResult
|
|
92
99
|
|
|
93
100
|
d = src_dict.copy()
|
|
@@ -114,6 +121,8 @@ class EmbeddingEvaluationResponse:
|
|
|
114
121
|
|
|
115
122
|
result = _parse_result(d.pop("result"))
|
|
116
123
|
|
|
124
|
+
payload = EmbeddingEvaluationPayload.from_dict(d.pop("payload"))
|
|
125
|
+
|
|
117
126
|
created_at = isoparse(d.pop("created_at"))
|
|
118
127
|
|
|
119
128
|
updated_at = isoparse(d.pop("updated_at"))
|
|
@@ -124,6 +133,7 @@ class EmbeddingEvaluationResponse:
|
|
|
124
133
|
datasource_id=datasource_id,
|
|
125
134
|
status=status,
|
|
126
135
|
result=result,
|
|
136
|
+
payload=payload,
|
|
127
137
|
created_at=created_at,
|
|
128
138
|
updated_at=updated_at,
|
|
129
139
|
)
|
|
@@ -21,7 +21,8 @@ from dateutil.parser import isoparse
|
|
|
21
21
|
from ..models.task_status import TaskStatus
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
|
-
from ..models.
|
|
24
|
+
from ..models.classification_metrics import ClassificationMetrics
|
|
25
|
+
from ..models.regression_metrics import RegressionMetrics
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
T = TypeVar("T", bound="EvaluationResponse")
|
|
@@ -34,7 +35,7 @@ class EvaluationResponse:
|
|
|
34
35
|
task_id (str):
|
|
35
36
|
org_id (str):
|
|
36
37
|
status (TaskStatus): Status of task in the task queue
|
|
37
|
-
result (Union['
|
|
38
|
+
result (Union['ClassificationMetrics', 'RegressionMetrics', None]):
|
|
38
39
|
created_at (datetime.datetime):
|
|
39
40
|
updated_at (datetime.datetime):
|
|
40
41
|
"""
|
|
@@ -42,13 +43,14 @@ class EvaluationResponse:
|
|
|
42
43
|
task_id: str
|
|
43
44
|
org_id: str
|
|
44
45
|
status: TaskStatus
|
|
45
|
-
result: Union["
|
|
46
|
+
result: Union["ClassificationMetrics", "RegressionMetrics", None]
|
|
46
47
|
created_at: datetime.datetime
|
|
47
48
|
updated_at: datetime.datetime
|
|
48
49
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
49
50
|
|
|
50
51
|
def to_dict(self) -> dict[str, Any]:
|
|
51
|
-
from ..models.
|
|
52
|
+
from ..models.classification_metrics import ClassificationMetrics
|
|
53
|
+
from ..models.regression_metrics import RegressionMetrics
|
|
52
54
|
|
|
53
55
|
task_id = self.task_id
|
|
54
56
|
|
|
@@ -57,7 +59,9 @@ class EvaluationResponse:
|
|
|
57
59
|
status = self.status.value if isinstance(self.status, Enum) else self.status
|
|
58
60
|
|
|
59
61
|
result: Union[Dict[str, Any], None]
|
|
60
|
-
if isinstance(self.result,
|
|
62
|
+
if isinstance(self.result, ClassificationMetrics):
|
|
63
|
+
result = self.result.to_dict()
|
|
64
|
+
elif isinstance(self.result, RegressionMetrics):
|
|
61
65
|
result = self.result.to_dict()
|
|
62
66
|
else:
|
|
63
67
|
result = self.result
|
|
@@ -83,7 +87,8 @@ class EvaluationResponse:
|
|
|
83
87
|
|
|
84
88
|
@classmethod
|
|
85
89
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
86
|
-
from ..models.
|
|
90
|
+
from ..models.classification_metrics import ClassificationMetrics
|
|
91
|
+
from ..models.regression_metrics import RegressionMetrics
|
|
87
92
|
|
|
88
93
|
d = src_dict.copy()
|
|
89
94
|
task_id = d.pop("task_id")
|
|
@@ -92,18 +97,26 @@ class EvaluationResponse:
|
|
|
92
97
|
|
|
93
98
|
status = TaskStatus(d.pop("status"))
|
|
94
99
|
|
|
95
|
-
def _parse_result(data: object) -> Union["
|
|
100
|
+
def _parse_result(data: object) -> Union["ClassificationMetrics", "RegressionMetrics", None]:
|
|
96
101
|
if data is None:
|
|
97
102
|
return data
|
|
98
103
|
try:
|
|
99
104
|
if not isinstance(data, dict):
|
|
100
105
|
raise TypeError()
|
|
101
|
-
result_type_0 =
|
|
106
|
+
result_type_0 = ClassificationMetrics.from_dict(data)
|
|
102
107
|
|
|
103
108
|
return result_type_0
|
|
104
109
|
except: # noqa: E722
|
|
105
110
|
pass
|
|
106
|
-
|
|
111
|
+
try:
|
|
112
|
+
if not isinstance(data, dict):
|
|
113
|
+
raise TypeError()
|
|
114
|
+
result_type_1 = RegressionMetrics.from_dict(data)
|
|
115
|
+
|
|
116
|
+
return result_type_1
|
|
117
|
+
except: # noqa: E722
|
|
118
|
+
pass
|
|
119
|
+
return cast(Union["ClassificationMetrics", "RegressionMetrics", None], data)
|
|
107
120
|
|
|
108
121
|
result = _parse_result(d.pop("result"))
|
|
109
122
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file is generated by the openapi-python-client tool via the generate_api_client.py script
|
|
3
|
+
|
|
4
|
+
It is a customized template from the openapi-python-client tool's default template:
|
|
5
|
+
https://github.com/openapi-generators/openapi-python-client/blob/861ef5622f10fc96d240dc9becb0edf94e61446c/openapi_python_client/templates/model.py.jinja
|
|
6
|
+
|
|
7
|
+
The main change is:
|
|
8
|
+
- Fix typing issues
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
# flake8: noqa: C901
|
|
12
|
+
|
|
13
|
+
import datetime
|
|
14
|
+
from enum import Enum
|
|
15
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union, cast
|
|
16
|
+
|
|
17
|
+
from attrs import define as _attrs_define
|
|
18
|
+
from attrs import field as _attrs_field
|
|
19
|
+
from dateutil.parser import isoparse
|
|
20
|
+
|
|
21
|
+
from ..models.task_status import TaskStatus
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from ..models.classification_metrics import ClassificationMetrics
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
T = TypeVar("T", bound="EvaluationResponseClassificationMetrics")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@_attrs_define
|
|
31
|
+
class EvaluationResponseClassificationMetrics:
|
|
32
|
+
"""
|
|
33
|
+
Attributes:
|
|
34
|
+
task_id (str):
|
|
35
|
+
org_id (str):
|
|
36
|
+
status (TaskStatus): Status of task in the task queue
|
|
37
|
+
result (Union['ClassificationMetrics', None]):
|
|
38
|
+
created_at (datetime.datetime):
|
|
39
|
+
updated_at (datetime.datetime):
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
task_id: str
|
|
43
|
+
org_id: str
|
|
44
|
+
status: TaskStatus
|
|
45
|
+
result: Union["ClassificationMetrics", None]
|
|
46
|
+
created_at: datetime.datetime
|
|
47
|
+
updated_at: datetime.datetime
|
|
48
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
49
|
+
|
|
50
|
+
def to_dict(self) -> dict[str, Any]:
|
|
51
|
+
from ..models.classification_metrics import ClassificationMetrics
|
|
52
|
+
|
|
53
|
+
task_id = self.task_id
|
|
54
|
+
|
|
55
|
+
org_id = self.org_id
|
|
56
|
+
|
|
57
|
+
status = self.status.value if isinstance(self.status, Enum) else self.status
|
|
58
|
+
|
|
59
|
+
result: Union[Dict[str, Any], None]
|
|
60
|
+
if isinstance(self.result, ClassificationMetrics):
|
|
61
|
+
result = self.result.to_dict()
|
|
62
|
+
else:
|
|
63
|
+
result = self.result
|
|
64
|
+
|
|
65
|
+
created_at = self.created_at.isoformat()
|
|
66
|
+
|
|
67
|
+
updated_at = self.updated_at.isoformat()
|
|
68
|
+
|
|
69
|
+
field_dict: dict[str, Any] = {}
|
|
70
|
+
field_dict.update(self.additional_properties)
|
|
71
|
+
field_dict.update(
|
|
72
|
+
{
|
|
73
|
+
"task_id": task_id,
|
|
74
|
+
"org_id": org_id,
|
|
75
|
+
"status": status,
|
|
76
|
+
"result": result,
|
|
77
|
+
"created_at": created_at,
|
|
78
|
+
"updated_at": updated_at,
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return field_dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
86
|
+
from ..models.classification_metrics import ClassificationMetrics
|
|
87
|
+
|
|
88
|
+
d = src_dict.copy()
|
|
89
|
+
task_id = d.pop("task_id")
|
|
90
|
+
|
|
91
|
+
org_id = d.pop("org_id")
|
|
92
|
+
|
|
93
|
+
status = TaskStatus(d.pop("status"))
|
|
94
|
+
|
|
95
|
+
def _parse_result(data: object) -> Union["ClassificationMetrics", None]:
|
|
96
|
+
if data is None:
|
|
97
|
+
return data
|
|
98
|
+
try:
|
|
99
|
+
if not isinstance(data, dict):
|
|
100
|
+
raise TypeError()
|
|
101
|
+
result_type_0 = ClassificationMetrics.from_dict(data)
|
|
102
|
+
|
|
103
|
+
return result_type_0
|
|
104
|
+
except: # noqa: E722
|
|
105
|
+
pass
|
|
106
|
+
return cast(Union["ClassificationMetrics", None], data)
|
|
107
|
+
|
|
108
|
+
result = _parse_result(d.pop("result"))
|
|
109
|
+
|
|
110
|
+
created_at = isoparse(d.pop("created_at"))
|
|
111
|
+
|
|
112
|
+
updated_at = isoparse(d.pop("updated_at"))
|
|
113
|
+
|
|
114
|
+
evaluation_response_classification_metrics = cls(
|
|
115
|
+
task_id=task_id,
|
|
116
|
+
org_id=org_id,
|
|
117
|
+
status=status,
|
|
118
|
+
result=result,
|
|
119
|
+
created_at=created_at,
|
|
120
|
+
updated_at=updated_at,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
evaluation_response_classification_metrics.additional_properties = d
|
|
124
|
+
return evaluation_response_classification_metrics
|
|
125
|
+
|
|
126
|
+
@property
|
|
127
|
+
def additional_keys(self) -> list[str]:
|
|
128
|
+
return list(self.additional_properties.keys())
|
|
129
|
+
|
|
130
|
+
def __getitem__(self, key: str) -> Any:
|
|
131
|
+
return self.additional_properties[key]
|
|
132
|
+
|
|
133
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
134
|
+
self.additional_properties[key] = value
|
|
135
|
+
|
|
136
|
+
def __delitem__(self, key: str) -> None:
|
|
137
|
+
del self.additional_properties[key]
|
|
138
|
+
|
|
139
|
+
def __contains__(self, key: str) -> bool:
|
|
140
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file is generated by the openapi-python-client tool via the generate_api_client.py script
|
|
3
|
+
|
|
4
|
+
It is a customized template from the openapi-python-client tool's default template:
|
|
5
|
+
https://github.com/openapi-generators/openapi-python-client/blob/861ef5622f10fc96d240dc9becb0edf94e61446c/openapi_python_client/templates/model.py.jinja
|
|
6
|
+
|
|
7
|
+
The main change is:
|
|
8
|
+
- Fix typing issues
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
# flake8: noqa: C901
|
|
12
|
+
|
|
13
|
+
import datetime
|
|
14
|
+
from enum import Enum
|
|
15
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union, cast
|
|
16
|
+
|
|
17
|
+
from attrs import define as _attrs_define
|
|
18
|
+
from attrs import field as _attrs_field
|
|
19
|
+
from dateutil.parser import isoparse
|
|
20
|
+
|
|
21
|
+
from ..models.task_status import TaskStatus
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from ..models.regression_metrics import RegressionMetrics
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
T = TypeVar("T", bound="EvaluationResponseRegressionMetrics")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@_attrs_define
|
|
31
|
+
class EvaluationResponseRegressionMetrics:
|
|
32
|
+
"""
|
|
33
|
+
Attributes:
|
|
34
|
+
task_id (str):
|
|
35
|
+
org_id (str):
|
|
36
|
+
status (TaskStatus): Status of task in the task queue
|
|
37
|
+
result (Union['RegressionMetrics', None]):
|
|
38
|
+
created_at (datetime.datetime):
|
|
39
|
+
updated_at (datetime.datetime):
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
task_id: str
|
|
43
|
+
org_id: str
|
|
44
|
+
status: TaskStatus
|
|
45
|
+
result: Union["RegressionMetrics", None]
|
|
46
|
+
created_at: datetime.datetime
|
|
47
|
+
updated_at: datetime.datetime
|
|
48
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
49
|
+
|
|
50
|
+
def to_dict(self) -> dict[str, Any]:
|
|
51
|
+
from ..models.regression_metrics import RegressionMetrics
|
|
52
|
+
|
|
53
|
+
task_id = self.task_id
|
|
54
|
+
|
|
55
|
+
org_id = self.org_id
|
|
56
|
+
|
|
57
|
+
status = self.status.value if isinstance(self.status, Enum) else self.status
|
|
58
|
+
|
|
59
|
+
result: Union[Dict[str, Any], None]
|
|
60
|
+
if isinstance(self.result, RegressionMetrics):
|
|
61
|
+
result = self.result.to_dict()
|
|
62
|
+
else:
|
|
63
|
+
result = self.result
|
|
64
|
+
|
|
65
|
+
created_at = self.created_at.isoformat()
|
|
66
|
+
|
|
67
|
+
updated_at = self.updated_at.isoformat()
|
|
68
|
+
|
|
69
|
+
field_dict: dict[str, Any] = {}
|
|
70
|
+
field_dict.update(self.additional_properties)
|
|
71
|
+
field_dict.update(
|
|
72
|
+
{
|
|
73
|
+
"task_id": task_id,
|
|
74
|
+
"org_id": org_id,
|
|
75
|
+
"status": status,
|
|
76
|
+
"result": result,
|
|
77
|
+
"created_at": created_at,
|
|
78
|
+
"updated_at": updated_at,
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return field_dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
86
|
+
from ..models.regression_metrics import RegressionMetrics
|
|
87
|
+
|
|
88
|
+
d = src_dict.copy()
|
|
89
|
+
task_id = d.pop("task_id")
|
|
90
|
+
|
|
91
|
+
org_id = d.pop("org_id")
|
|
92
|
+
|
|
93
|
+
status = TaskStatus(d.pop("status"))
|
|
94
|
+
|
|
95
|
+
def _parse_result(data: object) -> Union["RegressionMetrics", None]:
|
|
96
|
+
if data is None:
|
|
97
|
+
return data
|
|
98
|
+
try:
|
|
99
|
+
if not isinstance(data, dict):
|
|
100
|
+
raise TypeError()
|
|
101
|
+
result_type_0 = RegressionMetrics.from_dict(data)
|
|
102
|
+
|
|
103
|
+
return result_type_0
|
|
104
|
+
except: # noqa: E722
|
|
105
|
+
pass
|
|
106
|
+
return cast(Union["RegressionMetrics", None], data)
|
|
107
|
+
|
|
108
|
+
result = _parse_result(d.pop("result"))
|
|
109
|
+
|
|
110
|
+
created_at = isoparse(d.pop("created_at"))
|
|
111
|
+
|
|
112
|
+
updated_at = isoparse(d.pop("updated_at"))
|
|
113
|
+
|
|
114
|
+
evaluation_response_regression_metrics = cls(
|
|
115
|
+
task_id=task_id,
|
|
116
|
+
org_id=org_id,
|
|
117
|
+
status=status,
|
|
118
|
+
result=result,
|
|
119
|
+
created_at=created_at,
|
|
120
|
+
updated_at=updated_at,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
evaluation_response_regression_metrics.additional_properties = d
|
|
124
|
+
return evaluation_response_regression_metrics
|
|
125
|
+
|
|
126
|
+
@property
|
|
127
|
+
def additional_keys(self) -> list[str]:
|
|
128
|
+
return list(self.additional_properties.keys())
|
|
129
|
+
|
|
130
|
+
def __getitem__(self, key: str) -> Any:
|
|
131
|
+
return self.additional_properties[key]
|
|
132
|
+
|
|
133
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
134
|
+
self.additional_properties[key] = value
|
|
135
|
+
|
|
136
|
+
def __delitem__(self, key: str) -> None:
|
|
137
|
+
del self.additional_properties[key]
|
|
138
|
+
|
|
139
|
+
def __contains__(self, key: str) -> bool:
|
|
140
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file is generated by the openapi-python-client tool via the generate_api_client.py script
|
|
3
|
+
|
|
4
|
+
It is a customized template from the openapi-python-client tool's default template:
|
|
5
|
+
https://github.com/openapi-generators/openapi-python-client/blob/861ef5622f10fc96d240dc9becb0edf94e61446c/openapi_python_client/templates/model.py.jinja
|
|
6
|
+
|
|
7
|
+
The main change is:
|
|
8
|
+
- Fix typing issues
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
# flake8: noqa: C901
|
|
12
|
+
|
|
13
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
|
14
|
+
|
|
15
|
+
from attrs import define as _attrs_define
|
|
16
|
+
from attrs import field as _attrs_field
|
|
17
|
+
|
|
18
|
+
from ..types import UNSET, Unset
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from ..models.validation_error import ValidationError
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
T = TypeVar("T", bound="HTTPValidationError")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class HTTPValidationError:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
detail (Union[Unset, List['ValidationError']]):
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
detail: Union[Unset, List["ValidationError"]] = UNSET
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
|
38
|
+
detail: Union[Unset, List[Dict[str, Any]]] = UNSET
|
|
39
|
+
if not isinstance(self.detail, Unset):
|
|
40
|
+
detail = []
|
|
41
|
+
for detail_item_data in self.detail:
|
|
42
|
+
detail_item = detail_item_data.to_dict()
|
|
43
|
+
detail.append(detail_item)
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update({})
|
|
48
|
+
if detail is not UNSET:
|
|
49
|
+
field_dict["detail"] = detail
|
|
50
|
+
|
|
51
|
+
return field_dict
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
55
|
+
from ..models.validation_error import ValidationError
|
|
56
|
+
|
|
57
|
+
d = src_dict.copy()
|
|
58
|
+
detail = []
|
|
59
|
+
_detail = d.pop("detail", UNSET)
|
|
60
|
+
for detail_item_data in _detail or []:
|
|
61
|
+
detail_item = ValidationError.from_dict(detail_item_data)
|
|
62
|
+
|
|
63
|
+
detail.append(detail_item)
|
|
64
|
+
|
|
65
|
+
http_validation_error = cls(
|
|
66
|
+
detail=detail,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
http_validation_error.additional_properties = d
|
|
70
|
+
return http_validation_error
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def additional_keys(self) -> list[str]:
|
|
74
|
+
return list(self.additional_properties.keys())
|
|
75
|
+
|
|
76
|
+
def __getitem__(self, key: str) -> Any:
|
|
77
|
+
return self.additional_properties[key]
|
|
78
|
+
|
|
79
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
80
|
+
self.additional_properties[key] = value
|
|
81
|
+
|
|
82
|
+
def __delitem__(self, key: str) -> None:
|
|
83
|
+
del self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __contains__(self, key: str) -> bool:
|
|
86
|
+
return key in self.additional_properties
|
|
@@ -10,11 +10,13 @@ The main change is:
|
|
|
10
10
|
|
|
11
11
|
# flake8: noqa: C901
|
|
12
12
|
|
|
13
|
+
import datetime
|
|
13
14
|
from enum import Enum
|
|
14
15
|
from typing import Any, List, Type, TypeVar, Union, cast
|
|
15
16
|
|
|
16
17
|
from attrs import define as _attrs_define
|
|
17
18
|
from attrs import field as _attrs_field
|
|
19
|
+
from dateutil.parser import isoparse
|
|
18
20
|
|
|
19
21
|
from ..models.prediction_sort_item_item_type_0 import PredictionSortItemItemType0
|
|
20
22
|
from ..models.prediction_sort_item_item_type_1 import PredictionSortItemItemType1
|
|
@@ -30,6 +32,8 @@ class ListPredictionsRequest:
|
|
|
30
32
|
model_id (Union[None, Unset, str]):
|
|
31
33
|
tag (Union[None, Unset, str]):
|
|
32
34
|
prediction_ids (Union[List[str], None, Unset]):
|
|
35
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
36
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
33
37
|
limit (Union[None, Unset, int]):
|
|
34
38
|
offset (Union[None, Unset, int]): Default: 0.
|
|
35
39
|
sort (Union[Unset, List[List[Union[PredictionSortItemItemType0, PredictionSortItemItemType1]]]]):
|
|
@@ -39,6 +43,8 @@ class ListPredictionsRequest:
|
|
|
39
43
|
model_id: Union[None, Unset, str] = UNSET
|
|
40
44
|
tag: Union[None, Unset, str] = UNSET
|
|
41
45
|
prediction_ids: Union[List[str], None, Unset] = UNSET
|
|
46
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET
|
|
47
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET
|
|
42
48
|
limit: Union[None, Unset, int] = UNSET
|
|
43
49
|
offset: Union[None, Unset, int] = 0
|
|
44
50
|
sort: Union[Unset, List[List[Union[PredictionSortItemItemType0, PredictionSortItemItemType1]]]] = UNSET
|
|
@@ -67,6 +73,22 @@ class ListPredictionsRequest:
|
|
|
67
73
|
else:
|
|
68
74
|
prediction_ids = self.prediction_ids
|
|
69
75
|
|
|
76
|
+
start_timestamp: Union[None, Unset, str]
|
|
77
|
+
if isinstance(self.start_timestamp, Unset):
|
|
78
|
+
start_timestamp = UNSET
|
|
79
|
+
elif isinstance(self.start_timestamp, datetime.datetime):
|
|
80
|
+
start_timestamp = self.start_timestamp.isoformat()
|
|
81
|
+
else:
|
|
82
|
+
start_timestamp = self.start_timestamp
|
|
83
|
+
|
|
84
|
+
end_timestamp: Union[None, Unset, str]
|
|
85
|
+
if isinstance(self.end_timestamp, Unset):
|
|
86
|
+
end_timestamp = UNSET
|
|
87
|
+
elif isinstance(self.end_timestamp, datetime.datetime):
|
|
88
|
+
end_timestamp = self.end_timestamp.isoformat()
|
|
89
|
+
else:
|
|
90
|
+
end_timestamp = self.end_timestamp
|
|
91
|
+
|
|
70
92
|
limit: Union[None, Unset, int]
|
|
71
93
|
if isinstance(self.limit, Unset):
|
|
72
94
|
limit = UNSET
|
|
@@ -118,6 +140,10 @@ class ListPredictionsRequest:
|
|
|
118
140
|
field_dict["tag"] = tag
|
|
119
141
|
if prediction_ids is not UNSET:
|
|
120
142
|
field_dict["prediction_ids"] = prediction_ids
|
|
143
|
+
if start_timestamp is not UNSET:
|
|
144
|
+
field_dict["start_timestamp"] = start_timestamp
|
|
145
|
+
if end_timestamp is not UNSET:
|
|
146
|
+
field_dict["end_timestamp"] = end_timestamp
|
|
121
147
|
if limit is not UNSET:
|
|
122
148
|
field_dict["limit"] = limit
|
|
123
149
|
if offset is not UNSET:
|
|
@@ -168,6 +194,40 @@ class ListPredictionsRequest:
|
|
|
168
194
|
|
|
169
195
|
prediction_ids = _parse_prediction_ids(d.pop("prediction_ids", UNSET))
|
|
170
196
|
|
|
197
|
+
def _parse_start_timestamp(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
198
|
+
if data is None:
|
|
199
|
+
return data
|
|
200
|
+
if isinstance(data, Unset):
|
|
201
|
+
return data
|
|
202
|
+
try:
|
|
203
|
+
if not isinstance(data, str):
|
|
204
|
+
raise TypeError()
|
|
205
|
+
start_timestamp_type_0 = isoparse(data)
|
|
206
|
+
|
|
207
|
+
return start_timestamp_type_0
|
|
208
|
+
except: # noqa: E722
|
|
209
|
+
pass
|
|
210
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
211
|
+
|
|
212
|
+
start_timestamp = _parse_start_timestamp(d.pop("start_timestamp", UNSET))
|
|
213
|
+
|
|
214
|
+
def _parse_end_timestamp(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
215
|
+
if data is None:
|
|
216
|
+
return data
|
|
217
|
+
if isinstance(data, Unset):
|
|
218
|
+
return data
|
|
219
|
+
try:
|
|
220
|
+
if not isinstance(data, str):
|
|
221
|
+
raise TypeError()
|
|
222
|
+
end_timestamp_type_0 = isoparse(data)
|
|
223
|
+
|
|
224
|
+
return end_timestamp_type_0
|
|
225
|
+
except: # noqa: E722
|
|
226
|
+
pass
|
|
227
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
228
|
+
|
|
229
|
+
end_timestamp = _parse_end_timestamp(d.pop("end_timestamp", UNSET))
|
|
230
|
+
|
|
171
231
|
def _parse_limit(data: object) -> Union[None, Unset, int]:
|
|
172
232
|
if data is None:
|
|
173
233
|
return data
|
|
@@ -231,6 +291,8 @@ class ListPredictionsRequest:
|
|
|
231
291
|
model_id=model_id,
|
|
232
292
|
tag=tag,
|
|
233
293
|
prediction_ids=prediction_ids,
|
|
294
|
+
start_timestamp=start_timestamp,
|
|
295
|
+
end_timestamp=end_timestamp,
|
|
234
296
|
limit=limit,
|
|
235
297
|
offset=offset,
|
|
236
298
|
sort=sort,
|
|
@@ -13,7 +13,6 @@ The main change is:
|
|
|
13
13
|
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union, cast
|
|
14
14
|
|
|
15
15
|
from attrs import define as _attrs_define
|
|
16
|
-
from attrs import field as _attrs_field
|
|
17
16
|
|
|
18
17
|
from ..types import UNSET, Unset
|
|
19
18
|
|
|
@@ -44,7 +43,6 @@ class MemorysetAnalysisConfigs:
|
|
|
44
43
|
duplicate: Union["MemorysetDuplicateAnalysisConfig", None, Unset] = UNSET
|
|
45
44
|
projection: Union["MemorysetProjectionAnalysisConfig", None, Unset] = UNSET
|
|
46
45
|
cluster: Union["MemorysetClusterAnalysisConfig", None, Unset] = UNSET
|
|
47
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
48
46
|
|
|
49
47
|
def to_dict(self) -> dict[str, Any]:
|
|
50
48
|
from ..models.memoryset_cluster_analysis_config import MemorysetClusterAnalysisConfig
|
|
@@ -94,7 +92,6 @@ class MemorysetAnalysisConfigs:
|
|
|
94
92
|
cluster = self.cluster
|
|
95
93
|
|
|
96
94
|
field_dict: dict[str, Any] = {}
|
|
97
|
-
field_dict.update(self.additional_properties)
|
|
98
95
|
field_dict.update({})
|
|
99
96
|
if neighbor is not UNSET:
|
|
100
97
|
field_dict["neighbor"] = neighbor
|
|
@@ -212,21 +209,4 @@ class MemorysetAnalysisConfigs:
|
|
|
212
209
|
cluster=cluster,
|
|
213
210
|
)
|
|
214
211
|
|
|
215
|
-
memoryset_analysis_configs.additional_properties = d
|
|
216
212
|
return memoryset_analysis_configs
|
|
217
|
-
|
|
218
|
-
@property
|
|
219
|
-
def additional_keys(self) -> list[str]:
|
|
220
|
-
return list(self.additional_properties.keys())
|
|
221
|
-
|
|
222
|
-
def __getitem__(self, key: str) -> Any:
|
|
223
|
-
return self.additional_properties[key]
|
|
224
|
-
|
|
225
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
226
|
-
self.additional_properties[key] = value
|
|
227
|
-
|
|
228
|
-
def __delitem__(self, key: str) -> None:
|
|
229
|
-
del self.additional_properties[key]
|
|
230
|
-
|
|
231
|
-
def __contains__(self, key: str) -> bool:
|
|
232
|
-
return key in self.additional_properties
|