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
|
@@ -11,55 +11,62 @@ The main change is:
|
|
|
11
11
|
# flake8: noqa: C901
|
|
12
12
|
|
|
13
13
|
from enum import Enum
|
|
14
|
-
from typing import Any, List, Type, TypeVar, Union, cast
|
|
14
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
|
|
15
15
|
|
|
16
16
|
from attrs import define as _attrs_define
|
|
17
17
|
from attrs import field as _attrs_field
|
|
18
18
|
|
|
19
|
+
from ..models.create_memoryset_request_index_type import CreateMemorysetRequestIndexType
|
|
19
20
|
from ..models.pretrained_embedding_model_name import PretrainedEmbeddingModelName
|
|
20
21
|
from ..types import UNSET, Unset
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from ..models.create_memoryset_request_index_params import CreateMemorysetRequestIndexParams
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
T = TypeVar("T", bound="CreateMemorysetRequest")
|
|
23
28
|
|
|
24
29
|
|
|
25
30
|
@_attrs_define
|
|
26
|
-
class
|
|
31
|
+
class CreateMemorysetRequest:
|
|
27
32
|
"""
|
|
28
33
|
Attributes:
|
|
29
34
|
name (str):
|
|
30
|
-
|
|
35
|
+
datasource_id (str):
|
|
31
36
|
datasource_value_column (str):
|
|
32
37
|
description (Union[None, Unset, str]):
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
datasource_label_column (Union[None, Unset, str]):
|
|
39
|
+
datasource_score_column (Union[None, Unset, str]):
|
|
35
40
|
datasource_source_id_column (Union[None, Unset, str]):
|
|
36
41
|
remove_duplicates (Union[Unset, bool]): Default: True.
|
|
37
42
|
pretrained_embedding_model_name (Union[None, PretrainedEmbeddingModelName, Unset]):
|
|
38
43
|
finetuned_embedding_model_id (Union[None, Unset, str]):
|
|
39
|
-
finetuned_embedding_model_name (Union[None, Unset, str]):
|
|
40
44
|
max_seq_length_override (Union[None, Unset, int]):
|
|
41
45
|
label_names (Union[List[str], None, Unset]):
|
|
46
|
+
index_type (Union[Unset, CreateMemorysetRequestIndexType]): Default: CreateMemorysetRequestIndexType.FLAT.
|
|
47
|
+
index_params (Union[Unset, CreateMemorysetRequestIndexParams]):
|
|
42
48
|
"""
|
|
43
49
|
|
|
44
50
|
name: str
|
|
45
|
-
|
|
51
|
+
datasource_id: str
|
|
46
52
|
datasource_value_column: str
|
|
47
53
|
description: Union[None, Unset, str] = UNSET
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
datasource_label_column: Union[None, Unset, str] = UNSET
|
|
55
|
+
datasource_score_column: Union[None, Unset, str] = UNSET
|
|
50
56
|
datasource_source_id_column: Union[None, Unset, str] = UNSET
|
|
51
57
|
remove_duplicates: Union[Unset, bool] = True
|
|
52
58
|
pretrained_embedding_model_name: Union[None, PretrainedEmbeddingModelName, Unset] = UNSET
|
|
53
59
|
finetuned_embedding_model_id: Union[None, Unset, str] = UNSET
|
|
54
|
-
finetuned_embedding_model_name: Union[None, Unset, str] = UNSET
|
|
55
60
|
max_seq_length_override: Union[None, Unset, int] = UNSET
|
|
56
61
|
label_names: Union[List[str], None, Unset] = UNSET
|
|
62
|
+
index_type: Union[Unset, CreateMemorysetRequestIndexType] = CreateMemorysetRequestIndexType.FLAT
|
|
63
|
+
index_params: Union[Unset, "CreateMemorysetRequestIndexParams"] = UNSET
|
|
57
64
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
58
65
|
|
|
59
66
|
def to_dict(self) -> dict[str, Any]:
|
|
60
67
|
name = self.name
|
|
61
68
|
|
|
62
|
-
|
|
69
|
+
datasource_id = self.datasource_id
|
|
63
70
|
|
|
64
71
|
datasource_value_column = self.datasource_value_column
|
|
65
72
|
|
|
@@ -69,17 +76,17 @@ class CreateLabeledMemorysetRequest:
|
|
|
69
76
|
else:
|
|
70
77
|
description = self.description
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
if isinstance(self.
|
|
74
|
-
|
|
79
|
+
datasource_label_column: Union[None, Unset, str]
|
|
80
|
+
if isinstance(self.datasource_label_column, Unset):
|
|
81
|
+
datasource_label_column = UNSET
|
|
75
82
|
else:
|
|
76
|
-
|
|
83
|
+
datasource_label_column = self.datasource_label_column
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
if isinstance(self.
|
|
80
|
-
|
|
85
|
+
datasource_score_column: Union[None, Unset, str]
|
|
86
|
+
if isinstance(self.datasource_score_column, Unset):
|
|
87
|
+
datasource_score_column = UNSET
|
|
81
88
|
else:
|
|
82
|
-
|
|
89
|
+
datasource_score_column = self.datasource_score_column
|
|
83
90
|
|
|
84
91
|
datasource_source_id_column: Union[None, Unset, str]
|
|
85
92
|
if isinstance(self.datasource_source_id_column, Unset):
|
|
@@ -107,12 +114,6 @@ class CreateLabeledMemorysetRequest:
|
|
|
107
114
|
else:
|
|
108
115
|
finetuned_embedding_model_id = self.finetuned_embedding_model_id
|
|
109
116
|
|
|
110
|
-
finetuned_embedding_model_name: Union[None, Unset, str]
|
|
111
|
-
if isinstance(self.finetuned_embedding_model_name, Unset):
|
|
112
|
-
finetuned_embedding_model_name = UNSET
|
|
113
|
-
else:
|
|
114
|
-
finetuned_embedding_model_name = self.finetuned_embedding_model_name
|
|
115
|
-
|
|
116
117
|
max_seq_length_override: Union[None, Unset, int]
|
|
117
118
|
if isinstance(self.max_seq_length_override, Unset):
|
|
118
119
|
max_seq_length_override = UNSET
|
|
@@ -128,21 +129,29 @@ class CreateLabeledMemorysetRequest:
|
|
|
128
129
|
else:
|
|
129
130
|
label_names = self.label_names
|
|
130
131
|
|
|
132
|
+
index_type: Union[Unset, str] = UNSET
|
|
133
|
+
if not isinstance(self.index_type, Unset):
|
|
134
|
+
index_type = self.index_type.value
|
|
135
|
+
|
|
136
|
+
index_params: Union[Unset, Dict[str, Any]] = UNSET
|
|
137
|
+
if not isinstance(self.index_params, Unset):
|
|
138
|
+
index_params = self.index_params.to_dict()
|
|
139
|
+
|
|
131
140
|
field_dict: dict[str, Any] = {}
|
|
132
141
|
field_dict.update(self.additional_properties)
|
|
133
142
|
field_dict.update(
|
|
134
143
|
{
|
|
135
144
|
"name": name,
|
|
136
|
-
"
|
|
145
|
+
"datasource_id": datasource_id,
|
|
137
146
|
"datasource_value_column": datasource_value_column,
|
|
138
147
|
}
|
|
139
148
|
)
|
|
140
149
|
if description is not UNSET:
|
|
141
150
|
field_dict["description"] = description
|
|
142
|
-
if
|
|
143
|
-
field_dict["
|
|
144
|
-
if
|
|
145
|
-
field_dict["
|
|
151
|
+
if datasource_label_column is not UNSET:
|
|
152
|
+
field_dict["datasource_label_column"] = datasource_label_column
|
|
153
|
+
if datasource_score_column is not UNSET:
|
|
154
|
+
field_dict["datasource_score_column"] = datasource_score_column
|
|
146
155
|
if datasource_source_id_column is not UNSET:
|
|
147
156
|
field_dict["datasource_source_id_column"] = datasource_source_id_column
|
|
148
157
|
if remove_duplicates is not UNSET:
|
|
@@ -151,21 +160,25 @@ class CreateLabeledMemorysetRequest:
|
|
|
151
160
|
field_dict["pretrained_embedding_model_name"] = pretrained_embedding_model_name
|
|
152
161
|
if finetuned_embedding_model_id is not UNSET:
|
|
153
162
|
field_dict["finetuned_embedding_model_id"] = finetuned_embedding_model_id
|
|
154
|
-
if finetuned_embedding_model_name is not UNSET:
|
|
155
|
-
field_dict["finetuned_embedding_model_name"] = finetuned_embedding_model_name
|
|
156
163
|
if max_seq_length_override is not UNSET:
|
|
157
164
|
field_dict["max_seq_length_override"] = max_seq_length_override
|
|
158
165
|
if label_names is not UNSET:
|
|
159
166
|
field_dict["label_names"] = label_names
|
|
167
|
+
if index_type is not UNSET:
|
|
168
|
+
field_dict["index_type"] = index_type
|
|
169
|
+
if index_params is not UNSET:
|
|
170
|
+
field_dict["index_params"] = index_params
|
|
160
171
|
|
|
161
172
|
return field_dict
|
|
162
173
|
|
|
163
174
|
@classmethod
|
|
164
175
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
176
|
+
from ..models.create_memoryset_request_index_params import CreateMemorysetRequestIndexParams
|
|
177
|
+
|
|
165
178
|
d = src_dict.copy()
|
|
166
179
|
name = d.pop("name")
|
|
167
180
|
|
|
168
|
-
|
|
181
|
+
datasource_id = d.pop("datasource_id")
|
|
169
182
|
|
|
170
183
|
datasource_value_column = d.pop("datasource_value_column")
|
|
171
184
|
|
|
@@ -178,23 +191,23 @@ class CreateLabeledMemorysetRequest:
|
|
|
178
191
|
|
|
179
192
|
description = _parse_description(d.pop("description", UNSET))
|
|
180
193
|
|
|
181
|
-
def
|
|
194
|
+
def _parse_datasource_label_column(data: object) -> Union[None, Unset, str]:
|
|
182
195
|
if data is None:
|
|
183
196
|
return data
|
|
184
197
|
if isinstance(data, Unset):
|
|
185
198
|
return data
|
|
186
199
|
return cast(Union[None, Unset, str], data)
|
|
187
200
|
|
|
188
|
-
|
|
201
|
+
datasource_label_column = _parse_datasource_label_column(d.pop("datasource_label_column", UNSET))
|
|
189
202
|
|
|
190
|
-
def
|
|
203
|
+
def _parse_datasource_score_column(data: object) -> Union[None, Unset, str]:
|
|
191
204
|
if data is None:
|
|
192
205
|
return data
|
|
193
206
|
if isinstance(data, Unset):
|
|
194
207
|
return data
|
|
195
208
|
return cast(Union[None, Unset, str], data)
|
|
196
209
|
|
|
197
|
-
|
|
210
|
+
datasource_score_column = _parse_datasource_score_column(d.pop("datasource_score_column", UNSET))
|
|
198
211
|
|
|
199
212
|
def _parse_datasource_source_id_column(data: object) -> Union[None, Unset, str]:
|
|
200
213
|
if data is None:
|
|
@@ -235,17 +248,6 @@ class CreateLabeledMemorysetRequest:
|
|
|
235
248
|
|
|
236
249
|
finetuned_embedding_model_id = _parse_finetuned_embedding_model_id(d.pop("finetuned_embedding_model_id", UNSET))
|
|
237
250
|
|
|
238
|
-
def _parse_finetuned_embedding_model_name(data: object) -> Union[None, Unset, str]:
|
|
239
|
-
if data is None:
|
|
240
|
-
return data
|
|
241
|
-
if isinstance(data, Unset):
|
|
242
|
-
return data
|
|
243
|
-
return cast(Union[None, Unset, str], data)
|
|
244
|
-
|
|
245
|
-
finetuned_embedding_model_name = _parse_finetuned_embedding_model_name(
|
|
246
|
-
d.pop("finetuned_embedding_model_name", UNSET)
|
|
247
|
-
)
|
|
248
|
-
|
|
249
251
|
def _parse_max_seq_length_override(data: object) -> Union[None, Unset, int]:
|
|
250
252
|
if data is None:
|
|
251
253
|
return data
|
|
@@ -272,24 +274,39 @@ class CreateLabeledMemorysetRequest:
|
|
|
272
274
|
|
|
273
275
|
label_names = _parse_label_names(d.pop("label_names", UNSET))
|
|
274
276
|
|
|
275
|
-
|
|
277
|
+
_index_type = d.pop("index_type", UNSET)
|
|
278
|
+
index_type: Union[Unset, CreateMemorysetRequestIndexType]
|
|
279
|
+
if isinstance(_index_type, Unset):
|
|
280
|
+
index_type = UNSET
|
|
281
|
+
else:
|
|
282
|
+
index_type = CreateMemorysetRequestIndexType(_index_type)
|
|
283
|
+
|
|
284
|
+
_index_params = d.pop("index_params", UNSET)
|
|
285
|
+
index_params: Union[Unset, CreateMemorysetRequestIndexParams]
|
|
286
|
+
if isinstance(_index_params, Unset):
|
|
287
|
+
index_params = UNSET
|
|
288
|
+
else:
|
|
289
|
+
index_params = CreateMemorysetRequestIndexParams.from_dict(_index_params)
|
|
290
|
+
|
|
291
|
+
create_memoryset_request = cls(
|
|
276
292
|
name=name,
|
|
277
|
-
|
|
293
|
+
datasource_id=datasource_id,
|
|
278
294
|
datasource_value_column=datasource_value_column,
|
|
279
295
|
description=description,
|
|
280
|
-
|
|
281
|
-
|
|
296
|
+
datasource_label_column=datasource_label_column,
|
|
297
|
+
datasource_score_column=datasource_score_column,
|
|
282
298
|
datasource_source_id_column=datasource_source_id_column,
|
|
283
299
|
remove_duplicates=remove_duplicates,
|
|
284
300
|
pretrained_embedding_model_name=pretrained_embedding_model_name,
|
|
285
301
|
finetuned_embedding_model_id=finetuned_embedding_model_id,
|
|
286
|
-
finetuned_embedding_model_name=finetuned_embedding_model_name,
|
|
287
302
|
max_seq_length_override=max_seq_length_override,
|
|
288
303
|
label_names=label_names,
|
|
304
|
+
index_type=index_type,
|
|
305
|
+
index_params=index_params,
|
|
289
306
|
)
|
|
290
307
|
|
|
291
|
-
|
|
292
|
-
return
|
|
308
|
+
create_memoryset_request.additional_properties = d
|
|
309
|
+
return create_memoryset_request
|
|
293
310
|
|
|
294
311
|
@property
|
|
295
312
|
def additional_keys(self) -> list[str]:
|
|
@@ -0,0 +1,66 @@
|
|
|
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 Any, Type, TypeVar, Union, cast
|
|
14
|
+
|
|
15
|
+
from attrs import define as _attrs_define
|
|
16
|
+
from attrs import field as _attrs_field
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="CreateMemorysetRequestIndexParams")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class CreateMemorysetRequestIndexParams:
|
|
23
|
+
""" """
|
|
24
|
+
|
|
25
|
+
additional_properties: dict[str, Union[float, int, str]] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
field_dict: dict[str, Any] = {}
|
|
29
|
+
for prop_name, prop in self.additional_properties.items():
|
|
30
|
+
field_dict[prop_name] = prop
|
|
31
|
+
|
|
32
|
+
return field_dict
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
36
|
+
d = src_dict.copy()
|
|
37
|
+
create_memoryset_request_index_params = cls()
|
|
38
|
+
|
|
39
|
+
additional_properties = {}
|
|
40
|
+
for prop_name, prop_dict in d.items():
|
|
41
|
+
|
|
42
|
+
def _parse_additional_property(data: object) -> Union[float, int, str]:
|
|
43
|
+
return cast(Union[float, int, str], data)
|
|
44
|
+
|
|
45
|
+
additional_property = _parse_additional_property(prop_dict)
|
|
46
|
+
|
|
47
|
+
additional_properties[prop_name] = additional_property
|
|
48
|
+
|
|
49
|
+
create_memoryset_request_index_params.additional_properties = additional_properties
|
|
50
|
+
return create_memoryset_request_index_params
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def additional_keys(self) -> list[str]:
|
|
54
|
+
return list(self.additional_properties.keys())
|
|
55
|
+
|
|
56
|
+
def __getitem__(self, key: str) -> Union[float, int, str]:
|
|
57
|
+
return self.additional_properties[key]
|
|
58
|
+
|
|
59
|
+
def __setitem__(self, key: str, value: Union[float, int, str]) -> None:
|
|
60
|
+
self.additional_properties[key] = value
|
|
61
|
+
|
|
62
|
+
def __delitem__(self, key: str) -> None:
|
|
63
|
+
del self.additional_properties[key]
|
|
64
|
+
|
|
65
|
+
def __contains__(self, key: str) -> bool:
|
|
66
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CreateMemorysetRequestIndexType(str, Enum):
|
|
5
|
+
DISKANN = "DISKANN"
|
|
6
|
+
FLAT = "FLAT"
|
|
7
|
+
HNSW = "HNSW"
|
|
8
|
+
IVF_FLAT = "IVF_FLAT"
|
|
9
|
+
IVF_PQ = "IVF_PQ"
|
|
10
|
+
IVF_SQ8 = "IVF_SQ8"
|
|
11
|
+
|
|
12
|
+
def __str__(self) -> str:
|
|
13
|
+
return str(self.value)
|
|
@@ -0,0 +1,137 @@
|
|
|
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 Any, Type, TypeVar, Union, cast
|
|
14
|
+
|
|
15
|
+
from attrs import define as _attrs_define
|
|
16
|
+
from attrs import field as _attrs_field
|
|
17
|
+
|
|
18
|
+
from ..models.rar_head_type import RARHeadType
|
|
19
|
+
from ..types import UNSET, Unset
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="CreateRegressionModelRequest")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class CreateRegressionModelRequest:
|
|
26
|
+
"""
|
|
27
|
+
Attributes:
|
|
28
|
+
name (str):
|
|
29
|
+
memoryset_id (str):
|
|
30
|
+
description (Union[None, Unset, str]):
|
|
31
|
+
memory_lookup_count (Union[None, Unset, int]):
|
|
32
|
+
head_type (Union[Unset, RARHeadType]):
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
name: str
|
|
36
|
+
memoryset_id: str
|
|
37
|
+
description: Union[None, Unset, str] = UNSET
|
|
38
|
+
memory_lookup_count: Union[None, Unset, int] = UNSET
|
|
39
|
+
head_type: Union[Unset, RARHeadType] = UNSET
|
|
40
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
41
|
+
|
|
42
|
+
def to_dict(self) -> dict[str, Any]:
|
|
43
|
+
name = self.name
|
|
44
|
+
|
|
45
|
+
memoryset_id = self.memoryset_id
|
|
46
|
+
|
|
47
|
+
description: Union[None, Unset, str]
|
|
48
|
+
if isinstance(self.description, Unset):
|
|
49
|
+
description = UNSET
|
|
50
|
+
else:
|
|
51
|
+
description = self.description
|
|
52
|
+
|
|
53
|
+
memory_lookup_count: Union[None, Unset, int]
|
|
54
|
+
if isinstance(self.memory_lookup_count, Unset):
|
|
55
|
+
memory_lookup_count = UNSET
|
|
56
|
+
else:
|
|
57
|
+
memory_lookup_count = self.memory_lookup_count
|
|
58
|
+
|
|
59
|
+
head_type: Union[Unset, str] = UNSET
|
|
60
|
+
if not isinstance(self.head_type, Unset):
|
|
61
|
+
head_type = self.head_type.value
|
|
62
|
+
|
|
63
|
+
field_dict: dict[str, Any] = {}
|
|
64
|
+
field_dict.update(self.additional_properties)
|
|
65
|
+
field_dict.update(
|
|
66
|
+
{
|
|
67
|
+
"name": name,
|
|
68
|
+
"memoryset_id": memoryset_id,
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
if description is not UNSET:
|
|
72
|
+
field_dict["description"] = description
|
|
73
|
+
if memory_lookup_count is not UNSET:
|
|
74
|
+
field_dict["memory_lookup_count"] = memory_lookup_count
|
|
75
|
+
if head_type is not UNSET:
|
|
76
|
+
field_dict["head_type"] = head_type
|
|
77
|
+
|
|
78
|
+
return field_dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
82
|
+
d = src_dict.copy()
|
|
83
|
+
name = d.pop("name")
|
|
84
|
+
|
|
85
|
+
memoryset_id = d.pop("memoryset_id")
|
|
86
|
+
|
|
87
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
88
|
+
if data is None:
|
|
89
|
+
return data
|
|
90
|
+
if isinstance(data, Unset):
|
|
91
|
+
return data
|
|
92
|
+
return cast(Union[None, Unset, str], data)
|
|
93
|
+
|
|
94
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
95
|
+
|
|
96
|
+
def _parse_memory_lookup_count(data: object) -> Union[None, Unset, int]:
|
|
97
|
+
if data is None:
|
|
98
|
+
return data
|
|
99
|
+
if isinstance(data, Unset):
|
|
100
|
+
return data
|
|
101
|
+
return cast(Union[None, Unset, int], data)
|
|
102
|
+
|
|
103
|
+
memory_lookup_count = _parse_memory_lookup_count(d.pop("memory_lookup_count", UNSET))
|
|
104
|
+
|
|
105
|
+
_head_type = d.pop("head_type", UNSET)
|
|
106
|
+
head_type: Union[Unset, RARHeadType]
|
|
107
|
+
if isinstance(_head_type, Unset):
|
|
108
|
+
head_type = UNSET
|
|
109
|
+
else:
|
|
110
|
+
head_type = RARHeadType(_head_type)
|
|
111
|
+
|
|
112
|
+
create_regression_model_request = cls(
|
|
113
|
+
name=name,
|
|
114
|
+
memoryset_id=memoryset_id,
|
|
115
|
+
description=description,
|
|
116
|
+
memory_lookup_count=memory_lookup_count,
|
|
117
|
+
head_type=head_type,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
create_regression_model_request.additional_properties = d
|
|
121
|
+
return create_regression_model_request
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def additional_keys(self) -> list[str]:
|
|
125
|
+
return list(self.additional_properties.keys())
|
|
126
|
+
|
|
127
|
+
def __getitem__(self, key: str) -> Any:
|
|
128
|
+
return self.additional_properties[key]
|
|
129
|
+
|
|
130
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
131
|
+
self.additional_properties[key] = value
|
|
132
|
+
|
|
133
|
+
def __delitem__(self, key: str) -> None:
|
|
134
|
+
del self.additional_properties[key]
|
|
135
|
+
|
|
136
|
+
def __contains__(self, key: str) -> bool:
|
|
137
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,187 @@
|
|
|
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 enum import Enum
|
|
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
|
+
|
|
19
|
+
from ..models.pretrained_embedding_model_name import PretrainedEmbeddingModelName
|
|
20
|
+
from ..types import UNSET, Unset
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="EmbeddingEvaluationPayload")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class EmbeddingEvaluationPayload:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
value_column (str):
|
|
30
|
+
label_column (str):
|
|
31
|
+
source_id_column (Union[None, str]):
|
|
32
|
+
datasource_id (str):
|
|
33
|
+
neighbor_count (Union[Unset, int]): Default: 5.
|
|
34
|
+
label_names (Union[List[str], None, Unset]):
|
|
35
|
+
embedding_models (Union[List[PretrainedEmbeddingModelName], None, Unset]):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
value_column: str
|
|
39
|
+
label_column: str
|
|
40
|
+
source_id_column: Union[None, str]
|
|
41
|
+
datasource_id: str
|
|
42
|
+
neighbor_count: Union[Unset, int] = 5
|
|
43
|
+
label_names: Union[List[str], None, Unset] = UNSET
|
|
44
|
+
embedding_models: Union[List[PretrainedEmbeddingModelName], None, Unset] = UNSET
|
|
45
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
46
|
+
|
|
47
|
+
def to_dict(self) -> dict[str, Any]:
|
|
48
|
+
value_column = self.value_column
|
|
49
|
+
|
|
50
|
+
label_column = self.label_column
|
|
51
|
+
|
|
52
|
+
source_id_column: Union[None, str]
|
|
53
|
+
source_id_column = self.source_id_column
|
|
54
|
+
|
|
55
|
+
datasource_id = self.datasource_id
|
|
56
|
+
|
|
57
|
+
neighbor_count = self.neighbor_count
|
|
58
|
+
|
|
59
|
+
label_names: Union[List[str], None, Unset]
|
|
60
|
+
if isinstance(self.label_names, Unset):
|
|
61
|
+
label_names = UNSET
|
|
62
|
+
elif isinstance(self.label_names, list):
|
|
63
|
+
label_names = self.label_names
|
|
64
|
+
|
|
65
|
+
else:
|
|
66
|
+
label_names = self.label_names
|
|
67
|
+
|
|
68
|
+
embedding_models: Union[List[str], None, Unset]
|
|
69
|
+
if isinstance(self.embedding_models, Unset):
|
|
70
|
+
embedding_models = UNSET
|
|
71
|
+
elif isinstance(self.embedding_models, list):
|
|
72
|
+
embedding_models = []
|
|
73
|
+
for embedding_models_type_0_item_data in self.embedding_models:
|
|
74
|
+
embedding_models_type_0_item = (
|
|
75
|
+
embedding_models_type_0_item_data.value
|
|
76
|
+
if isinstance(embedding_models_type_0_item_data, Enum)
|
|
77
|
+
else embedding_models_type_0_item_data
|
|
78
|
+
)
|
|
79
|
+
embedding_models.append(embedding_models_type_0_item)
|
|
80
|
+
|
|
81
|
+
else:
|
|
82
|
+
embedding_models = self.embedding_models
|
|
83
|
+
|
|
84
|
+
field_dict: dict[str, Any] = {}
|
|
85
|
+
field_dict.update(self.additional_properties)
|
|
86
|
+
field_dict.update(
|
|
87
|
+
{
|
|
88
|
+
"value_column": value_column,
|
|
89
|
+
"label_column": label_column,
|
|
90
|
+
"source_id_column": source_id_column,
|
|
91
|
+
"datasource_id": datasource_id,
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
if neighbor_count is not UNSET:
|
|
95
|
+
field_dict["neighbor_count"] = neighbor_count
|
|
96
|
+
if label_names is not UNSET:
|
|
97
|
+
field_dict["label_names"] = label_names
|
|
98
|
+
if embedding_models is not UNSET:
|
|
99
|
+
field_dict["embedding_models"] = embedding_models
|
|
100
|
+
|
|
101
|
+
return field_dict
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
105
|
+
d = src_dict.copy()
|
|
106
|
+
value_column = d.pop("value_column")
|
|
107
|
+
|
|
108
|
+
label_column = d.pop("label_column")
|
|
109
|
+
|
|
110
|
+
def _parse_source_id_column(data: object) -> Union[None, str]:
|
|
111
|
+
if data is None:
|
|
112
|
+
return data
|
|
113
|
+
return cast(Union[None, str], data)
|
|
114
|
+
|
|
115
|
+
source_id_column = _parse_source_id_column(d.pop("source_id_column"))
|
|
116
|
+
|
|
117
|
+
datasource_id = d.pop("datasource_id")
|
|
118
|
+
|
|
119
|
+
neighbor_count = d.pop("neighbor_count", UNSET)
|
|
120
|
+
|
|
121
|
+
def _parse_label_names(data: object) -> Union[List[str], None, Unset]:
|
|
122
|
+
if data is None:
|
|
123
|
+
return data
|
|
124
|
+
if isinstance(data, Unset):
|
|
125
|
+
return data
|
|
126
|
+
try:
|
|
127
|
+
if not isinstance(data, list):
|
|
128
|
+
raise TypeError()
|
|
129
|
+
label_names_type_0 = cast(List[str], data)
|
|
130
|
+
|
|
131
|
+
return label_names_type_0
|
|
132
|
+
except: # noqa: E722
|
|
133
|
+
pass
|
|
134
|
+
return cast(Union[List[str], None, Unset], data)
|
|
135
|
+
|
|
136
|
+
label_names = _parse_label_names(d.pop("label_names", UNSET))
|
|
137
|
+
|
|
138
|
+
def _parse_embedding_models(data: object) -> Union[List[PretrainedEmbeddingModelName], None, Unset]:
|
|
139
|
+
if data is None:
|
|
140
|
+
return data
|
|
141
|
+
if isinstance(data, Unset):
|
|
142
|
+
return data
|
|
143
|
+
try:
|
|
144
|
+
if not isinstance(data, list):
|
|
145
|
+
raise TypeError()
|
|
146
|
+
embedding_models_type_0 = []
|
|
147
|
+
_embedding_models_type_0 = data
|
|
148
|
+
for embedding_models_type_0_item_data in _embedding_models_type_0:
|
|
149
|
+
embedding_models_type_0_item = PretrainedEmbeddingModelName(embedding_models_type_0_item_data)
|
|
150
|
+
|
|
151
|
+
embedding_models_type_0.append(embedding_models_type_0_item)
|
|
152
|
+
|
|
153
|
+
return embedding_models_type_0
|
|
154
|
+
except: # noqa: E722
|
|
155
|
+
pass
|
|
156
|
+
return cast(Union[List[PretrainedEmbeddingModelName], None, Unset], data)
|
|
157
|
+
|
|
158
|
+
embedding_models = _parse_embedding_models(d.pop("embedding_models", UNSET))
|
|
159
|
+
|
|
160
|
+
embedding_evaluation_payload = cls(
|
|
161
|
+
value_column=value_column,
|
|
162
|
+
label_column=label_column,
|
|
163
|
+
source_id_column=source_id_column,
|
|
164
|
+
datasource_id=datasource_id,
|
|
165
|
+
neighbor_count=neighbor_count,
|
|
166
|
+
label_names=label_names,
|
|
167
|
+
embedding_models=embedding_models,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
embedding_evaluation_payload.additional_properties = d
|
|
171
|
+
return embedding_evaluation_payload
|
|
172
|
+
|
|
173
|
+
@property
|
|
174
|
+
def additional_keys(self) -> list[str]:
|
|
175
|
+
return list(self.additional_properties.keys())
|
|
176
|
+
|
|
177
|
+
def __getitem__(self, key: str) -> Any:
|
|
178
|
+
return self.additional_properties[key]
|
|
179
|
+
|
|
180
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
181
|
+
self.additional_properties[key] = value
|
|
182
|
+
|
|
183
|
+
def __delitem__(self, key: str) -> None:
|
|
184
|
+
del self.additional_properties[key]
|
|
185
|
+
|
|
186
|
+
def __contains__(self, key: str) -> bool:
|
|
187
|
+
return key in self.additional_properties
|