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,180 @@
|
|
|
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 TYPE_CHECKING, 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
|
+
if TYPE_CHECKING:
|
|
21
|
+
from ..models.memory_metrics import MemoryMetrics
|
|
22
|
+
from ..models.scored_memory_lookup_metadata import ScoredMemoryLookupMetadata
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
T = TypeVar("T", bound="ScoredMemoryLookup")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@_attrs_define
|
|
29
|
+
class ScoredMemoryLookup:
|
|
30
|
+
"""Single scored memory lookup result.
|
|
31
|
+
|
|
32
|
+
Attributes:
|
|
33
|
+
value (str):
|
|
34
|
+
embedding (List[float]):
|
|
35
|
+
source_id (Union[None, str]):
|
|
36
|
+
metadata (ScoredMemoryLookupMetadata):
|
|
37
|
+
memory_id (str):
|
|
38
|
+
memory_version (int):
|
|
39
|
+
created_at (datetime.datetime):
|
|
40
|
+
updated_at (datetime.datetime):
|
|
41
|
+
edited_at (datetime.datetime):
|
|
42
|
+
metrics (MemoryMetrics):
|
|
43
|
+
lookup_score (float):
|
|
44
|
+
score (float):
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
value: str
|
|
48
|
+
embedding: List[float]
|
|
49
|
+
source_id: Union[None, str]
|
|
50
|
+
metadata: "ScoredMemoryLookupMetadata"
|
|
51
|
+
memory_id: str
|
|
52
|
+
memory_version: int
|
|
53
|
+
created_at: datetime.datetime
|
|
54
|
+
updated_at: datetime.datetime
|
|
55
|
+
edited_at: datetime.datetime
|
|
56
|
+
metrics: "MemoryMetrics"
|
|
57
|
+
lookup_score: float
|
|
58
|
+
score: float
|
|
59
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> dict[str, Any]:
|
|
62
|
+
value: str
|
|
63
|
+
value = self.value
|
|
64
|
+
|
|
65
|
+
embedding = self.embedding
|
|
66
|
+
|
|
67
|
+
source_id: Union[None, str]
|
|
68
|
+
source_id = self.source_id
|
|
69
|
+
|
|
70
|
+
metadata = self.metadata.to_dict()
|
|
71
|
+
|
|
72
|
+
memory_id = self.memory_id
|
|
73
|
+
|
|
74
|
+
memory_version = self.memory_version
|
|
75
|
+
|
|
76
|
+
created_at = self.created_at.isoformat()
|
|
77
|
+
|
|
78
|
+
updated_at = self.updated_at.isoformat()
|
|
79
|
+
|
|
80
|
+
edited_at = self.edited_at.isoformat()
|
|
81
|
+
|
|
82
|
+
metrics = self.metrics.to_dict()
|
|
83
|
+
|
|
84
|
+
lookup_score = self.lookup_score
|
|
85
|
+
|
|
86
|
+
score = self.score
|
|
87
|
+
|
|
88
|
+
field_dict: dict[str, Any] = {}
|
|
89
|
+
field_dict.update(self.additional_properties)
|
|
90
|
+
field_dict.update(
|
|
91
|
+
{
|
|
92
|
+
"value": value,
|
|
93
|
+
"embedding": embedding,
|
|
94
|
+
"source_id": source_id,
|
|
95
|
+
"metadata": metadata,
|
|
96
|
+
"memory_id": memory_id,
|
|
97
|
+
"memory_version": memory_version,
|
|
98
|
+
"created_at": created_at,
|
|
99
|
+
"updated_at": updated_at,
|
|
100
|
+
"edited_at": edited_at,
|
|
101
|
+
"metrics": metrics,
|
|
102
|
+
"lookup_score": lookup_score,
|
|
103
|
+
"score": score,
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
return field_dict
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
111
|
+
from ..models.memory_metrics import MemoryMetrics
|
|
112
|
+
from ..models.scored_memory_lookup_metadata import ScoredMemoryLookupMetadata
|
|
113
|
+
|
|
114
|
+
d = src_dict.copy()
|
|
115
|
+
|
|
116
|
+
def _parse_value(data: object) -> str:
|
|
117
|
+
return cast(str, data)
|
|
118
|
+
|
|
119
|
+
value = _parse_value(d.pop("value"))
|
|
120
|
+
|
|
121
|
+
embedding = cast(List[float], d.pop("embedding"))
|
|
122
|
+
|
|
123
|
+
def _parse_source_id(data: object) -> Union[None, str]:
|
|
124
|
+
if data is None:
|
|
125
|
+
return data
|
|
126
|
+
return cast(Union[None, str], data)
|
|
127
|
+
|
|
128
|
+
source_id = _parse_source_id(d.pop("source_id"))
|
|
129
|
+
|
|
130
|
+
metadata = ScoredMemoryLookupMetadata.from_dict(d.pop("metadata"))
|
|
131
|
+
|
|
132
|
+
memory_id = d.pop("memory_id")
|
|
133
|
+
|
|
134
|
+
memory_version = d.pop("memory_version")
|
|
135
|
+
|
|
136
|
+
created_at = isoparse(d.pop("created_at"))
|
|
137
|
+
|
|
138
|
+
updated_at = isoparse(d.pop("updated_at"))
|
|
139
|
+
|
|
140
|
+
edited_at = isoparse(d.pop("edited_at"))
|
|
141
|
+
|
|
142
|
+
metrics = MemoryMetrics.from_dict(d.pop("metrics"))
|
|
143
|
+
|
|
144
|
+
lookup_score = d.pop("lookup_score")
|
|
145
|
+
|
|
146
|
+
score = d.pop("score")
|
|
147
|
+
|
|
148
|
+
scored_memory_lookup = cls(
|
|
149
|
+
value=value,
|
|
150
|
+
embedding=embedding,
|
|
151
|
+
source_id=source_id,
|
|
152
|
+
metadata=metadata,
|
|
153
|
+
memory_id=memory_id,
|
|
154
|
+
memory_version=memory_version,
|
|
155
|
+
created_at=created_at,
|
|
156
|
+
updated_at=updated_at,
|
|
157
|
+
edited_at=edited_at,
|
|
158
|
+
metrics=metrics,
|
|
159
|
+
lookup_score=lookup_score,
|
|
160
|
+
score=score,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
scored_memory_lookup.additional_properties = d
|
|
164
|
+
return scored_memory_lookup
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def additional_keys(self) -> list[str]:
|
|
168
|
+
return list(self.additional_properties.keys())
|
|
169
|
+
|
|
170
|
+
def __getitem__(self, key: str) -> Any:
|
|
171
|
+
return self.additional_properties[key]
|
|
172
|
+
|
|
173
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
174
|
+
self.additional_properties[key] = value
|
|
175
|
+
|
|
176
|
+
def __delitem__(self, key: str) -> None:
|
|
177
|
+
del self.additional_properties[key]
|
|
178
|
+
|
|
179
|
+
def __contains__(self, key: str) -> bool:
|
|
180
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,68 @@
|
|
|
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="ScoredMemoryLookupMetadata")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class ScoredMemoryLookupMetadata:
|
|
23
|
+
""" """
|
|
24
|
+
|
|
25
|
+
additional_properties: dict[str, Union[None, bool, 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
|
+
scored_memory_lookup_metadata = cls()
|
|
38
|
+
|
|
39
|
+
additional_properties = {}
|
|
40
|
+
for prop_name, prop_dict in d.items():
|
|
41
|
+
|
|
42
|
+
def _parse_additional_property(data: object) -> Union[None, bool, float, int, str]:
|
|
43
|
+
if data is None:
|
|
44
|
+
return data
|
|
45
|
+
return cast(Union[None, bool, float, int, str], data)
|
|
46
|
+
|
|
47
|
+
additional_property = _parse_additional_property(prop_dict)
|
|
48
|
+
|
|
49
|
+
additional_properties[prop_name] = additional_property
|
|
50
|
+
|
|
51
|
+
scored_memory_lookup_metadata.additional_properties = additional_properties
|
|
52
|
+
return scored_memory_lookup_metadata
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def additional_keys(self) -> list[str]:
|
|
56
|
+
return list(self.additional_properties.keys())
|
|
57
|
+
|
|
58
|
+
def __getitem__(self, key: str) -> Union[None, bool, float, int, str]:
|
|
59
|
+
return self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __setitem__(self, key: str, value: Union[None, bool, float, int, str]) -> None:
|
|
62
|
+
self.additional_properties[key] = value
|
|
63
|
+
|
|
64
|
+
def __delitem__(self, key: str) -> None:
|
|
65
|
+
del self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __contains__(self, key: str) -> bool:
|
|
68
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,68 @@
|
|
|
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="ScoredMemoryMetadata")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class ScoredMemoryMetadata:
|
|
23
|
+
""" """
|
|
24
|
+
|
|
25
|
+
additional_properties: dict[str, Union[None, bool, 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
|
+
scored_memory_metadata = cls()
|
|
38
|
+
|
|
39
|
+
additional_properties = {}
|
|
40
|
+
for prop_name, prop_dict in d.items():
|
|
41
|
+
|
|
42
|
+
def _parse_additional_property(data: object) -> Union[None, bool, float, int, str]:
|
|
43
|
+
if data is None:
|
|
44
|
+
return data
|
|
45
|
+
return cast(Union[None, bool, float, int, str], data)
|
|
46
|
+
|
|
47
|
+
additional_property = _parse_additional_property(prop_dict)
|
|
48
|
+
|
|
49
|
+
additional_properties[prop_name] = additional_property
|
|
50
|
+
|
|
51
|
+
scored_memory_metadata.additional_properties = additional_properties
|
|
52
|
+
return scored_memory_metadata
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def additional_keys(self) -> list[str]:
|
|
56
|
+
return list(self.additional_properties.keys())
|
|
57
|
+
|
|
58
|
+
def __getitem__(self, key: str) -> Union[None, bool, float, int, str]:
|
|
59
|
+
return self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __setitem__(self, key: str, value: Union[None, bool, float, int, str]) -> None:
|
|
62
|
+
self.additional_properties[key] = value
|
|
63
|
+
|
|
64
|
+
def __delitem__(self, key: str) -> None:
|
|
65
|
+
del self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __contains__(self, key: str) -> bool:
|
|
68
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file is generated by the openapi-python-client tool via the generate_api_client.py script
|
|
3
|
+
|
|
4
|
+
It is a customized template from the openapi-python-client tool's default template:
|
|
5
|
+
https://github.com/openapi-generators/openapi-python-client/blob/861ef5622f10fc96d240dc9becb0edf94e61446c/openapi_python_client/templates/model.py.jinja
|
|
6
|
+
|
|
7
|
+
The main change is:
|
|
8
|
+
- Fix typing issues
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
# flake8: noqa: C901
|
|
12
|
+
|
|
13
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union, cast
|
|
14
|
+
|
|
15
|
+
from attrs import define as _attrs_define
|
|
16
|
+
|
|
17
|
+
from ..types import UNSET, Unset
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from ..models.memory_metrics import MemoryMetrics
|
|
21
|
+
from ..models.scored_memory_update_metadata_type_0 import ScoredMemoryUpdateMetadataType0
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
T = TypeVar("T", bound="ScoredMemoryUpdate")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class ScoredMemoryUpdate:
|
|
29
|
+
"""Model for updating a scored memory (unset fields are kept as is).
|
|
30
|
+
|
|
31
|
+
Attributes:
|
|
32
|
+
memory_id (str):
|
|
33
|
+
value (Union[Unset, str]):
|
|
34
|
+
metadata (Union['ScoredMemoryUpdateMetadataType0', None, Unset]):
|
|
35
|
+
source_id (Union[None, Unset, str]):
|
|
36
|
+
score (Union[Unset, float]):
|
|
37
|
+
metrics (Union['MemoryMetrics', None, Unset]):
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
memory_id: str
|
|
41
|
+
value: Union[Unset, str] = UNSET
|
|
42
|
+
metadata: Union["ScoredMemoryUpdateMetadataType0", None, Unset] = UNSET
|
|
43
|
+
source_id: Union[None, Unset, str] = UNSET
|
|
44
|
+
score: Union[Unset, float] = UNSET
|
|
45
|
+
metrics: Union["MemoryMetrics", None, Unset] = UNSET
|
|
46
|
+
|
|
47
|
+
def to_dict(self) -> dict[str, Any]:
|
|
48
|
+
from ..models.memory_metrics import MemoryMetrics
|
|
49
|
+
from ..models.scored_memory_update_metadata_type_0 import ScoredMemoryUpdateMetadataType0
|
|
50
|
+
|
|
51
|
+
memory_id = self.memory_id
|
|
52
|
+
|
|
53
|
+
value: Union[Unset, str]
|
|
54
|
+
if isinstance(self.value, Unset):
|
|
55
|
+
value = UNSET
|
|
56
|
+
else:
|
|
57
|
+
value = self.value
|
|
58
|
+
|
|
59
|
+
metadata: Union[Dict[str, Any], None, Unset]
|
|
60
|
+
if isinstance(self.metadata, Unset):
|
|
61
|
+
metadata = UNSET
|
|
62
|
+
elif isinstance(self.metadata, ScoredMemoryUpdateMetadataType0):
|
|
63
|
+
metadata = self.metadata.to_dict()
|
|
64
|
+
else:
|
|
65
|
+
metadata = self.metadata
|
|
66
|
+
|
|
67
|
+
source_id: Union[None, Unset, str]
|
|
68
|
+
if isinstance(self.source_id, Unset):
|
|
69
|
+
source_id = UNSET
|
|
70
|
+
else:
|
|
71
|
+
source_id = self.source_id
|
|
72
|
+
|
|
73
|
+
score = self.score
|
|
74
|
+
|
|
75
|
+
metrics: Union[Dict[str, Any], None, Unset]
|
|
76
|
+
if isinstance(self.metrics, Unset):
|
|
77
|
+
metrics = UNSET
|
|
78
|
+
elif isinstance(self.metrics, MemoryMetrics):
|
|
79
|
+
metrics = self.metrics.to_dict()
|
|
80
|
+
else:
|
|
81
|
+
metrics = self.metrics
|
|
82
|
+
|
|
83
|
+
field_dict: dict[str, Any] = {}
|
|
84
|
+
field_dict.update(
|
|
85
|
+
{
|
|
86
|
+
"memory_id": memory_id,
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
if value is not UNSET:
|
|
90
|
+
field_dict["value"] = value
|
|
91
|
+
if metadata is not UNSET:
|
|
92
|
+
field_dict["metadata"] = metadata
|
|
93
|
+
if source_id is not UNSET:
|
|
94
|
+
field_dict["source_id"] = source_id
|
|
95
|
+
if score is not UNSET:
|
|
96
|
+
field_dict["score"] = score
|
|
97
|
+
if metrics is not UNSET:
|
|
98
|
+
field_dict["metrics"] = metrics
|
|
99
|
+
|
|
100
|
+
return field_dict
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
104
|
+
from ..models.memory_metrics import MemoryMetrics
|
|
105
|
+
from ..models.scored_memory_update_metadata_type_0 import ScoredMemoryUpdateMetadataType0
|
|
106
|
+
|
|
107
|
+
d = src_dict.copy()
|
|
108
|
+
memory_id = d.pop("memory_id")
|
|
109
|
+
|
|
110
|
+
def _parse_value(data: object) -> Union[Unset, str]:
|
|
111
|
+
if isinstance(data, Unset):
|
|
112
|
+
return data
|
|
113
|
+
return cast(Union[Unset, str], data)
|
|
114
|
+
|
|
115
|
+
value = _parse_value(d.pop("value", UNSET))
|
|
116
|
+
|
|
117
|
+
def _parse_metadata(data: object) -> Union["ScoredMemoryUpdateMetadataType0", None, Unset]:
|
|
118
|
+
if data is None:
|
|
119
|
+
return data
|
|
120
|
+
if isinstance(data, Unset):
|
|
121
|
+
return data
|
|
122
|
+
try:
|
|
123
|
+
if not isinstance(data, dict):
|
|
124
|
+
raise TypeError()
|
|
125
|
+
metadata_type_0 = ScoredMemoryUpdateMetadataType0.from_dict(data)
|
|
126
|
+
|
|
127
|
+
return metadata_type_0
|
|
128
|
+
except: # noqa: E722
|
|
129
|
+
pass
|
|
130
|
+
return cast(Union["ScoredMemoryUpdateMetadataType0", None, Unset], data)
|
|
131
|
+
|
|
132
|
+
metadata = _parse_metadata(d.pop("metadata", UNSET))
|
|
133
|
+
|
|
134
|
+
def _parse_source_id(data: object) -> Union[None, Unset, str]:
|
|
135
|
+
if data is None:
|
|
136
|
+
return data
|
|
137
|
+
if isinstance(data, Unset):
|
|
138
|
+
return data
|
|
139
|
+
return cast(Union[None, Unset, str], data)
|
|
140
|
+
|
|
141
|
+
source_id = _parse_source_id(d.pop("source_id", UNSET))
|
|
142
|
+
|
|
143
|
+
score = d.pop("score", UNSET)
|
|
144
|
+
|
|
145
|
+
def _parse_metrics(data: object) -> Union["MemoryMetrics", None, Unset]:
|
|
146
|
+
if data is None:
|
|
147
|
+
return data
|
|
148
|
+
if isinstance(data, Unset):
|
|
149
|
+
return data
|
|
150
|
+
try:
|
|
151
|
+
if not isinstance(data, dict):
|
|
152
|
+
raise TypeError()
|
|
153
|
+
metrics_type_0 = MemoryMetrics.from_dict(data)
|
|
154
|
+
|
|
155
|
+
return metrics_type_0
|
|
156
|
+
except: # noqa: E722
|
|
157
|
+
pass
|
|
158
|
+
return cast(Union["MemoryMetrics", None, Unset], data)
|
|
159
|
+
|
|
160
|
+
metrics = _parse_metrics(d.pop("metrics", UNSET))
|
|
161
|
+
|
|
162
|
+
scored_memory_update = cls(
|
|
163
|
+
memory_id=memory_id,
|
|
164
|
+
value=value,
|
|
165
|
+
metadata=metadata,
|
|
166
|
+
source_id=source_id,
|
|
167
|
+
score=score,
|
|
168
|
+
metrics=metrics,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
return scored_memory_update
|
|
@@ -0,0 +1,68 @@
|
|
|
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="ScoredMemoryUpdateMetadataType0")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class ScoredMemoryUpdateMetadataType0:
|
|
23
|
+
""" """
|
|
24
|
+
|
|
25
|
+
additional_properties: dict[str, Union[None, bool, 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
|
+
scored_memory_update_metadata_type_0 = cls()
|
|
38
|
+
|
|
39
|
+
additional_properties = {}
|
|
40
|
+
for prop_name, prop_dict in d.items():
|
|
41
|
+
|
|
42
|
+
def _parse_additional_property(data: object) -> Union[None, bool, float, int, str]:
|
|
43
|
+
if data is None:
|
|
44
|
+
return data
|
|
45
|
+
return cast(Union[None, bool, float, int, str], data)
|
|
46
|
+
|
|
47
|
+
additional_property = _parse_additional_property(prop_dict)
|
|
48
|
+
|
|
49
|
+
additional_properties[prop_name] = additional_property
|
|
50
|
+
|
|
51
|
+
scored_memory_update_metadata_type_0.additional_properties = additional_properties
|
|
52
|
+
return scored_memory_update_metadata_type_0
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def additional_keys(self) -> list[str]:
|
|
56
|
+
return list(self.additional_properties.keys())
|
|
57
|
+
|
|
58
|
+
def __getitem__(self, key: str) -> Union[None, bool, float, int, str]:
|
|
59
|
+
return self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __setitem__(self, key: str, value: Union[None, bool, float, int, str]) -> None:
|
|
62
|
+
self.additional_properties[key] = value
|
|
63
|
+
|
|
64
|
+
def __delitem__(self, key: str) -> None:
|
|
65
|
+
del self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __contains__(self, key: str) -> bool:
|
|
68
|
+
return key in self.additional_properties
|