orca-sdk 0.0.94__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 +80 -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 +24 -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/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 +84 -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/{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/memory_type.py +9 -0
- 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/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/_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 +183 -175
- orca_sdk/classification_model_test.py +147 -157
- orca_sdk/conftest.py +76 -26
- orca_sdk/datasource_test.py +0 -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 +56 -23
- orca_sdk/regression_model.py +647 -0
- orca_sdk/regression_model_test.py +338 -0
- orca_sdk/telemetry.py +223 -106
- orca_sdk/telemetry_test.py +34 -30
- {orca_sdk-0.0.94.dist-info → orca_sdk-0.0.95.dist-info}/METADATA +2 -4
- {orca_sdk-0.0.94.dist-info → orca_sdk-0.0.95.dist-info}/RECORD +115 -69
- orca_sdk/_utils/task.py +0 -73
- {orca_sdk-0.0.94.dist-info → orca_sdk-0.0.95.dist-info}/WHEEL +0 -0
|
@@ -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
|
|
@@ -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
|