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
|
@@ -19,11 +19,11 @@ from attrs import field as _attrs_field
|
|
|
19
19
|
from ..models.pretrained_embedding_model_name import PretrainedEmbeddingModelName
|
|
20
20
|
from ..types import UNSET, Unset
|
|
21
21
|
|
|
22
|
-
T = TypeVar("T", bound="
|
|
22
|
+
T = TypeVar("T", bound="CloneMemorysetRequest")
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
@_attrs_define
|
|
26
|
-
class
|
|
26
|
+
class CloneMemorysetRequest:
|
|
27
27
|
"""
|
|
28
28
|
Attributes:
|
|
29
29
|
name (str):
|
|
@@ -142,7 +142,7 @@ class CloneLabeledMemorysetRequest:
|
|
|
142
142
|
|
|
143
143
|
max_seq_length_override = _parse_max_seq_length_override(d.pop("max_seq_length_override", UNSET))
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
clone_memoryset_request = cls(
|
|
146
146
|
name=name,
|
|
147
147
|
description=description,
|
|
148
148
|
pretrained_embedding_model_name=pretrained_embedding_model_name,
|
|
@@ -150,8 +150,8 @@ class CloneLabeledMemorysetRequest:
|
|
|
150
150
|
max_seq_length_override=max_seq_length_override,
|
|
151
151
|
)
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
return
|
|
153
|
+
clone_memoryset_request.additional_properties = d
|
|
154
|
+
return clone_memoryset_request
|
|
155
155
|
|
|
156
156
|
@property
|
|
157
157
|
def additional_keys(self) -> list[str]:
|
|
@@ -30,11 +30,13 @@ class ColumnInfo:
|
|
|
30
30
|
name (str):
|
|
31
31
|
type (ColumnType): The type of a column in a datasource
|
|
32
32
|
enum_options (Union[List[str], None, Unset]):
|
|
33
|
+
int_values (Union[List[int], None, Unset]):
|
|
33
34
|
"""
|
|
34
35
|
|
|
35
36
|
name: str
|
|
36
37
|
type: ColumnType
|
|
37
38
|
enum_options: Union[List[str], None, Unset] = UNSET
|
|
39
|
+
int_values: Union[List[int], None, Unset] = UNSET
|
|
38
40
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
39
41
|
|
|
40
42
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -51,6 +53,15 @@ class ColumnInfo:
|
|
|
51
53
|
else:
|
|
52
54
|
enum_options = self.enum_options
|
|
53
55
|
|
|
56
|
+
int_values: Union[List[int], None, Unset]
|
|
57
|
+
if isinstance(self.int_values, Unset):
|
|
58
|
+
int_values = UNSET
|
|
59
|
+
elif isinstance(self.int_values, list):
|
|
60
|
+
int_values = self.int_values
|
|
61
|
+
|
|
62
|
+
else:
|
|
63
|
+
int_values = self.int_values
|
|
64
|
+
|
|
54
65
|
field_dict: dict[str, Any] = {}
|
|
55
66
|
field_dict.update(self.additional_properties)
|
|
56
67
|
field_dict.update(
|
|
@@ -61,6 +72,8 @@ class ColumnInfo:
|
|
|
61
72
|
)
|
|
62
73
|
if enum_options is not UNSET:
|
|
63
74
|
field_dict["enum_options"] = enum_options
|
|
75
|
+
if int_values is not UNSET:
|
|
76
|
+
field_dict["int_values"] = int_values
|
|
64
77
|
|
|
65
78
|
return field_dict
|
|
66
79
|
|
|
@@ -88,10 +101,28 @@ class ColumnInfo:
|
|
|
88
101
|
|
|
89
102
|
enum_options = _parse_enum_options(d.pop("enum_options", UNSET))
|
|
90
103
|
|
|
104
|
+
def _parse_int_values(data: object) -> Union[List[int], None, Unset]:
|
|
105
|
+
if data is None:
|
|
106
|
+
return data
|
|
107
|
+
if isinstance(data, Unset):
|
|
108
|
+
return data
|
|
109
|
+
try:
|
|
110
|
+
if not isinstance(data, list):
|
|
111
|
+
raise TypeError()
|
|
112
|
+
int_values_type_0 = cast(List[int], data)
|
|
113
|
+
|
|
114
|
+
return int_values_type_0
|
|
115
|
+
except: # noqa: E722
|
|
116
|
+
pass
|
|
117
|
+
return cast(Union[List[int], None, Unset], data)
|
|
118
|
+
|
|
119
|
+
int_values = _parse_int_values(d.pop("int_values", UNSET))
|
|
120
|
+
|
|
91
121
|
column_info = cls(
|
|
92
122
|
name=name,
|
|
93
123
|
type=type,
|
|
94
124
|
enum_options=enum_options,
|
|
125
|
+
int_values=int_values,
|
|
95
126
|
)
|
|
96
127
|
|
|
97
128
|
column_info.additional_properties = d
|
|
@@ -0,0 +1,195 @@
|
|
|
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 typing import Any, List, Type, TypeVar, Union, cast
|
|
15
|
+
|
|
16
|
+
from attrs import define as _attrs_define
|
|
17
|
+
from attrs import field as _attrs_field
|
|
18
|
+
from dateutil.parser import isoparse
|
|
19
|
+
|
|
20
|
+
from ..types import UNSET, Unset
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="CountPredictionsRequest")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class CountPredictionsRequest:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
model_id (Union[None, Unset, str]):
|
|
30
|
+
tag (Union[None, Unset, str]):
|
|
31
|
+
prediction_ids (Union[List[str], None, Unset]):
|
|
32
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
33
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
model_id: Union[None, Unset, str] = UNSET
|
|
37
|
+
tag: Union[None, Unset, str] = UNSET
|
|
38
|
+
prediction_ids: Union[List[str], None, Unset] = UNSET
|
|
39
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET
|
|
40
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET
|
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
model_id: Union[None, Unset, str]
|
|
45
|
+
if isinstance(self.model_id, Unset):
|
|
46
|
+
model_id = UNSET
|
|
47
|
+
else:
|
|
48
|
+
model_id = self.model_id
|
|
49
|
+
|
|
50
|
+
tag: Union[None, Unset, str]
|
|
51
|
+
if isinstance(self.tag, Unset):
|
|
52
|
+
tag = UNSET
|
|
53
|
+
else:
|
|
54
|
+
tag = self.tag
|
|
55
|
+
|
|
56
|
+
prediction_ids: Union[List[str], None, Unset]
|
|
57
|
+
if isinstance(self.prediction_ids, Unset):
|
|
58
|
+
prediction_ids = UNSET
|
|
59
|
+
elif isinstance(self.prediction_ids, list):
|
|
60
|
+
prediction_ids = self.prediction_ids
|
|
61
|
+
|
|
62
|
+
else:
|
|
63
|
+
prediction_ids = self.prediction_ids
|
|
64
|
+
|
|
65
|
+
start_timestamp: Union[None, Unset, str]
|
|
66
|
+
if isinstance(self.start_timestamp, Unset):
|
|
67
|
+
start_timestamp = UNSET
|
|
68
|
+
elif isinstance(self.start_timestamp, datetime.datetime):
|
|
69
|
+
start_timestamp = self.start_timestamp.isoformat()
|
|
70
|
+
else:
|
|
71
|
+
start_timestamp = self.start_timestamp
|
|
72
|
+
|
|
73
|
+
end_timestamp: Union[None, Unset, str]
|
|
74
|
+
if isinstance(self.end_timestamp, Unset):
|
|
75
|
+
end_timestamp = UNSET
|
|
76
|
+
elif isinstance(self.end_timestamp, datetime.datetime):
|
|
77
|
+
end_timestamp = self.end_timestamp.isoformat()
|
|
78
|
+
else:
|
|
79
|
+
end_timestamp = self.end_timestamp
|
|
80
|
+
|
|
81
|
+
field_dict: dict[str, Any] = {}
|
|
82
|
+
field_dict.update(self.additional_properties)
|
|
83
|
+
field_dict.update({})
|
|
84
|
+
if model_id is not UNSET:
|
|
85
|
+
field_dict["model_id"] = model_id
|
|
86
|
+
if tag is not UNSET:
|
|
87
|
+
field_dict["tag"] = tag
|
|
88
|
+
if prediction_ids is not UNSET:
|
|
89
|
+
field_dict["prediction_ids"] = prediction_ids
|
|
90
|
+
if start_timestamp is not UNSET:
|
|
91
|
+
field_dict["start_timestamp"] = start_timestamp
|
|
92
|
+
if end_timestamp is not UNSET:
|
|
93
|
+
field_dict["end_timestamp"] = end_timestamp
|
|
94
|
+
|
|
95
|
+
return field_dict
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
99
|
+
d = src_dict.copy()
|
|
100
|
+
|
|
101
|
+
def _parse_model_id(data: object) -> Union[None, Unset, str]:
|
|
102
|
+
if data is None:
|
|
103
|
+
return data
|
|
104
|
+
if isinstance(data, Unset):
|
|
105
|
+
return data
|
|
106
|
+
return cast(Union[None, Unset, str], data)
|
|
107
|
+
|
|
108
|
+
model_id = _parse_model_id(d.pop("model_id", UNSET))
|
|
109
|
+
|
|
110
|
+
def _parse_tag(data: object) -> Union[None, Unset, str]:
|
|
111
|
+
if data is None:
|
|
112
|
+
return data
|
|
113
|
+
if isinstance(data, Unset):
|
|
114
|
+
return data
|
|
115
|
+
return cast(Union[None, Unset, str], data)
|
|
116
|
+
|
|
117
|
+
tag = _parse_tag(d.pop("tag", UNSET))
|
|
118
|
+
|
|
119
|
+
def _parse_prediction_ids(data: object) -> Union[List[str], None, Unset]:
|
|
120
|
+
if data is None:
|
|
121
|
+
return data
|
|
122
|
+
if isinstance(data, Unset):
|
|
123
|
+
return data
|
|
124
|
+
try:
|
|
125
|
+
if not isinstance(data, list):
|
|
126
|
+
raise TypeError()
|
|
127
|
+
prediction_ids_type_0 = cast(List[str], data)
|
|
128
|
+
|
|
129
|
+
return prediction_ids_type_0
|
|
130
|
+
except: # noqa: E722
|
|
131
|
+
pass
|
|
132
|
+
return cast(Union[List[str], None, Unset], data)
|
|
133
|
+
|
|
134
|
+
prediction_ids = _parse_prediction_ids(d.pop("prediction_ids", UNSET))
|
|
135
|
+
|
|
136
|
+
def _parse_start_timestamp(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
137
|
+
if data is None:
|
|
138
|
+
return data
|
|
139
|
+
if isinstance(data, Unset):
|
|
140
|
+
return data
|
|
141
|
+
try:
|
|
142
|
+
if not isinstance(data, str):
|
|
143
|
+
raise TypeError()
|
|
144
|
+
start_timestamp_type_0 = isoparse(data)
|
|
145
|
+
|
|
146
|
+
return start_timestamp_type_0
|
|
147
|
+
except: # noqa: E722
|
|
148
|
+
pass
|
|
149
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
150
|
+
|
|
151
|
+
start_timestamp = _parse_start_timestamp(d.pop("start_timestamp", UNSET))
|
|
152
|
+
|
|
153
|
+
def _parse_end_timestamp(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
154
|
+
if data is None:
|
|
155
|
+
return data
|
|
156
|
+
if isinstance(data, Unset):
|
|
157
|
+
return data
|
|
158
|
+
try:
|
|
159
|
+
if not isinstance(data, str):
|
|
160
|
+
raise TypeError()
|
|
161
|
+
end_timestamp_type_0 = isoparse(data)
|
|
162
|
+
|
|
163
|
+
return end_timestamp_type_0
|
|
164
|
+
except: # noqa: E722
|
|
165
|
+
pass
|
|
166
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
167
|
+
|
|
168
|
+
end_timestamp = _parse_end_timestamp(d.pop("end_timestamp", UNSET))
|
|
169
|
+
|
|
170
|
+
count_predictions_request = cls(
|
|
171
|
+
model_id=model_id,
|
|
172
|
+
tag=tag,
|
|
173
|
+
prediction_ids=prediction_ids,
|
|
174
|
+
start_timestamp=start_timestamp,
|
|
175
|
+
end_timestamp=end_timestamp,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
count_predictions_request.additional_properties = d
|
|
179
|
+
return count_predictions_request
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def additional_keys(self) -> list[str]:
|
|
183
|
+
return list(self.additional_properties.keys())
|
|
184
|
+
|
|
185
|
+
def __getitem__(self, key: str) -> Any:
|
|
186
|
+
return self.additional_properties[key]
|
|
187
|
+
|
|
188
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
189
|
+
self.additional_properties[key] = value
|
|
190
|
+
|
|
191
|
+
def __delitem__(self, key: str) -> None:
|
|
192
|
+
del self.additional_properties[key]
|
|
193
|
+
|
|
194
|
+
def __contains__(self, key: str) -> bool:
|
|
195
|
+
return key in self.additional_properties
|
|
@@ -18,55 +18,49 @@ from attrs import field as _attrs_field
|
|
|
18
18
|
from ..models.rac_head_type import RACHeadType
|
|
19
19
|
from ..types import UNSET, Unset
|
|
20
20
|
|
|
21
|
-
T = TypeVar("T", bound="
|
|
21
|
+
T = TypeVar("T", bound="CreateClassificationModelRequest")
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@_attrs_define
|
|
25
|
-
class
|
|
25
|
+
class CreateClassificationModelRequest:
|
|
26
26
|
"""
|
|
27
27
|
Attributes:
|
|
28
28
|
name (str):
|
|
29
|
+
memoryset_id (str):
|
|
29
30
|
description (Union[None, Unset, str]):
|
|
30
|
-
|
|
31
|
-
memoryset_name (Union[None, Unset, str]):
|
|
31
|
+
memory_lookup_count (Union[None, Unset, int]):
|
|
32
32
|
head_type (Union[Unset, RACHeadType]):
|
|
33
33
|
weigh_memories (Union[None, Unset, bool]):
|
|
34
34
|
min_memory_weight (Union[None, Unset, float]):
|
|
35
|
-
memory_lookup_count (Union[None, Unset, int]):
|
|
36
35
|
num_classes (Union[None, Unset, int]):
|
|
37
36
|
"""
|
|
38
37
|
|
|
39
38
|
name: str
|
|
39
|
+
memoryset_id: str
|
|
40
40
|
description: Union[None, Unset, str] = UNSET
|
|
41
|
-
|
|
42
|
-
memoryset_name: Union[None, Unset, str] = UNSET
|
|
41
|
+
memory_lookup_count: Union[None, Unset, int] = UNSET
|
|
43
42
|
head_type: Union[Unset, RACHeadType] = UNSET
|
|
44
43
|
weigh_memories: Union[None, Unset, bool] = UNSET
|
|
45
44
|
min_memory_weight: Union[None, Unset, float] = UNSET
|
|
46
|
-
memory_lookup_count: Union[None, Unset, int] = UNSET
|
|
47
45
|
num_classes: Union[None, Unset, int] = UNSET
|
|
48
46
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
49
47
|
|
|
50
48
|
def to_dict(self) -> dict[str, Any]:
|
|
51
49
|
name = self.name
|
|
52
50
|
|
|
51
|
+
memoryset_id = self.memoryset_id
|
|
52
|
+
|
|
53
53
|
description: Union[None, Unset, str]
|
|
54
54
|
if isinstance(self.description, Unset):
|
|
55
55
|
description = UNSET
|
|
56
56
|
else:
|
|
57
57
|
description = self.description
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
if isinstance(self.
|
|
61
|
-
|
|
62
|
-
else:
|
|
63
|
-
memoryset_id = self.memoryset_id
|
|
64
|
-
|
|
65
|
-
memoryset_name: Union[None, Unset, str]
|
|
66
|
-
if isinstance(self.memoryset_name, Unset):
|
|
67
|
-
memoryset_name = UNSET
|
|
59
|
+
memory_lookup_count: Union[None, Unset, int]
|
|
60
|
+
if isinstance(self.memory_lookup_count, Unset):
|
|
61
|
+
memory_lookup_count = UNSET
|
|
68
62
|
else:
|
|
69
|
-
|
|
63
|
+
memory_lookup_count = self.memory_lookup_count
|
|
70
64
|
|
|
71
65
|
head_type: Union[Unset, str] = UNSET
|
|
72
66
|
if not isinstance(self.head_type, Unset):
|
|
@@ -84,12 +78,6 @@ class CreateRACModelRequest:
|
|
|
84
78
|
else:
|
|
85
79
|
min_memory_weight = self.min_memory_weight
|
|
86
80
|
|
|
87
|
-
memory_lookup_count: Union[None, Unset, int]
|
|
88
|
-
if isinstance(self.memory_lookup_count, Unset):
|
|
89
|
-
memory_lookup_count = UNSET
|
|
90
|
-
else:
|
|
91
|
-
memory_lookup_count = self.memory_lookup_count
|
|
92
|
-
|
|
93
81
|
num_classes: Union[None, Unset, int]
|
|
94
82
|
if isinstance(self.num_classes, Unset):
|
|
95
83
|
num_classes = UNSET
|
|
@@ -101,22 +89,19 @@ class CreateRACModelRequest:
|
|
|
101
89
|
field_dict.update(
|
|
102
90
|
{
|
|
103
91
|
"name": name,
|
|
92
|
+
"memoryset_id": memoryset_id,
|
|
104
93
|
}
|
|
105
94
|
)
|
|
106
95
|
if description is not UNSET:
|
|
107
96
|
field_dict["description"] = description
|
|
108
|
-
if
|
|
109
|
-
field_dict["
|
|
110
|
-
if memoryset_name is not UNSET:
|
|
111
|
-
field_dict["memoryset_name"] = memoryset_name
|
|
97
|
+
if memory_lookup_count is not UNSET:
|
|
98
|
+
field_dict["memory_lookup_count"] = memory_lookup_count
|
|
112
99
|
if head_type is not UNSET:
|
|
113
100
|
field_dict["head_type"] = head_type
|
|
114
101
|
if weigh_memories is not UNSET:
|
|
115
102
|
field_dict["weigh_memories"] = weigh_memories
|
|
116
103
|
if min_memory_weight is not UNSET:
|
|
117
104
|
field_dict["min_memory_weight"] = min_memory_weight
|
|
118
|
-
if memory_lookup_count is not UNSET:
|
|
119
|
-
field_dict["memory_lookup_count"] = memory_lookup_count
|
|
120
105
|
if num_classes is not UNSET:
|
|
121
106
|
field_dict["num_classes"] = num_classes
|
|
122
107
|
|
|
@@ -127,6 +112,8 @@ class CreateRACModelRequest:
|
|
|
127
112
|
d = src_dict.copy()
|
|
128
113
|
name = d.pop("name")
|
|
129
114
|
|
|
115
|
+
memoryset_id = d.pop("memoryset_id")
|
|
116
|
+
|
|
130
117
|
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
131
118
|
if data is None:
|
|
132
119
|
return data
|
|
@@ -136,23 +123,14 @@ class CreateRACModelRequest:
|
|
|
136
123
|
|
|
137
124
|
description = _parse_description(d.pop("description", UNSET))
|
|
138
125
|
|
|
139
|
-
def
|
|
140
|
-
if data is None:
|
|
141
|
-
return data
|
|
142
|
-
if isinstance(data, Unset):
|
|
143
|
-
return data
|
|
144
|
-
return cast(Union[None, Unset, str], data)
|
|
145
|
-
|
|
146
|
-
memoryset_id = _parse_memoryset_id(d.pop("memoryset_id", UNSET))
|
|
147
|
-
|
|
148
|
-
def _parse_memoryset_name(data: object) -> Union[None, Unset, str]:
|
|
126
|
+
def _parse_memory_lookup_count(data: object) -> Union[None, Unset, int]:
|
|
149
127
|
if data is None:
|
|
150
128
|
return data
|
|
151
129
|
if isinstance(data, Unset):
|
|
152
130
|
return data
|
|
153
|
-
return cast(Union[None, Unset,
|
|
131
|
+
return cast(Union[None, Unset, int], data)
|
|
154
132
|
|
|
155
|
-
|
|
133
|
+
memory_lookup_count = _parse_memory_lookup_count(d.pop("memory_lookup_count", UNSET))
|
|
156
134
|
|
|
157
135
|
_head_type = d.pop("head_type", UNSET)
|
|
158
136
|
head_type: Union[Unset, RACHeadType]
|
|
@@ -179,15 +157,6 @@ class CreateRACModelRequest:
|
|
|
179
157
|
|
|
180
158
|
min_memory_weight = _parse_min_memory_weight(d.pop("min_memory_weight", UNSET))
|
|
181
159
|
|
|
182
|
-
def _parse_memory_lookup_count(data: object) -> Union[None, Unset, int]:
|
|
183
|
-
if data is None:
|
|
184
|
-
return data
|
|
185
|
-
if isinstance(data, Unset):
|
|
186
|
-
return data
|
|
187
|
-
return cast(Union[None, Unset, int], data)
|
|
188
|
-
|
|
189
|
-
memory_lookup_count = _parse_memory_lookup_count(d.pop("memory_lookup_count", UNSET))
|
|
190
|
-
|
|
191
160
|
def _parse_num_classes(data: object) -> Union[None, Unset, int]:
|
|
192
161
|
if data is None:
|
|
193
162
|
return data
|
|
@@ -197,20 +166,19 @@ class CreateRACModelRequest:
|
|
|
197
166
|
|
|
198
167
|
num_classes = _parse_num_classes(d.pop("num_classes", UNSET))
|
|
199
168
|
|
|
200
|
-
|
|
169
|
+
create_classification_model_request = cls(
|
|
201
170
|
name=name,
|
|
202
|
-
description=description,
|
|
203
171
|
memoryset_id=memoryset_id,
|
|
204
|
-
|
|
172
|
+
description=description,
|
|
173
|
+
memory_lookup_count=memory_lookup_count,
|
|
205
174
|
head_type=head_type,
|
|
206
175
|
weigh_memories=weigh_memories,
|
|
207
176
|
min_memory_weight=min_memory_weight,
|
|
208
|
-
memory_lookup_count=memory_lookup_count,
|
|
209
177
|
num_classes=num_classes,
|
|
210
178
|
)
|
|
211
179
|
|
|
212
|
-
|
|
213
|
-
return
|
|
180
|
+
create_classification_model_request.additional_properties = d
|
|
181
|
+
return create_classification_model_request
|
|
214
182
|
|
|
215
183
|
@property
|
|
216
184
|
def additional_keys(self) -> list[str]:
|