orca-sdk 0.0.95__py3-none-any.whl → 0.0.97__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 +1 -5
- orca_sdk/_generated_api_client/api/__init__.py +22 -2
- orca_sdk/_generated_api_client/api/{datasource/create_datasource_datasource_post.py → auth/create_org_plan_auth_org_plan_post.py} +32 -31
- orca_sdk/_generated_api_client/api/auth/get_org_plan_auth_org_plan_get.py +122 -0
- orca_sdk/_generated_api_client/api/auth/update_org_plan_auth_org_plan_put.py +168 -0
- orca_sdk/_generated_api_client/api/datasource/create_datasource_from_content_datasource_post.py +224 -0
- orca_sdk/_generated_api_client/api/datasource/create_datasource_from_files_datasource_upload_post.py +229 -0
- orca_sdk/_generated_api_client/api/task/list_tasks_task_get.py +21 -26
- orca_sdk/_generated_api_client/api/telemetry/generate_memory_suggestions_telemetry_prediction_prediction_id_memory_suggestions_post.py +239 -0
- orca_sdk/_generated_api_client/api/telemetry/get_action_recommendation_telemetry_prediction_prediction_id_action_get.py +192 -0
- orca_sdk/_generated_api_client/models/__init__.py +54 -4
- orca_sdk/_generated_api_client/models/action_recommendation.py +82 -0
- orca_sdk/_generated_api_client/models/action_recommendation_action.py +11 -0
- orca_sdk/_generated_api_client/models/add_memory_recommendations.py +85 -0
- orca_sdk/_generated_api_client/models/add_memory_suggestion.py +79 -0
- orca_sdk/_generated_api_client/models/body_create_datasource_from_files_datasource_upload_post.py +145 -0
- orca_sdk/_generated_api_client/models/class_representatives.py +92 -0
- orca_sdk/_generated_api_client/models/classification_model_metadata.py +14 -0
- orca_sdk/_generated_api_client/models/clone_memoryset_request.py +40 -0
- orca_sdk/_generated_api_client/models/constraint_violation_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/constraint_violation_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/create_classification_model_request.py +40 -0
- orca_sdk/_generated_api_client/models/create_datasource_from_content_request.py +101 -0
- orca_sdk/_generated_api_client/models/create_memoryset_request.py +40 -0
- orca_sdk/_generated_api_client/models/create_org_plan_request.py +73 -0
- orca_sdk/_generated_api_client/models/create_org_plan_request_tier.py +11 -0
- orca_sdk/_generated_api_client/models/create_regression_model_request.py +20 -0
- orca_sdk/_generated_api_client/models/embed_request.py +20 -0
- orca_sdk/_generated_api_client/models/embedding_evaluation_payload.py +28 -10
- orca_sdk/_generated_api_client/models/embedding_evaluation_request.py +28 -10
- orca_sdk/_generated_api_client/models/embedding_model_result.py +9 -0
- orca_sdk/_generated_api_client/models/filter_item.py +31 -23
- orca_sdk/_generated_api_client/models/filter_item_field_type_1_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/filter_item_field_type_2_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/filter_item_field_type_2_item_type_1.py +2 -0
- orca_sdk/_generated_api_client/models/internal_server_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/internal_server_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/labeled_memory.py +5 -5
- orca_sdk/_generated_api_client/models/labeled_memory_update.py +16 -16
- orca_sdk/_generated_api_client/models/labeled_memory_with_feedback_metrics.py +5 -5
- orca_sdk/_generated_api_client/models/lookup_request.py +20 -0
- orca_sdk/_generated_api_client/models/memory_metrics.py +98 -0
- orca_sdk/_generated_api_client/models/memoryset_analysis_configs.py +33 -0
- orca_sdk/_generated_api_client/models/memoryset_class_patterns_analysis_config.py +79 -0
- orca_sdk/_generated_api_client/models/memoryset_class_patterns_metrics.py +138 -0
- orca_sdk/_generated_api_client/models/memoryset_metadata.py +42 -0
- orca_sdk/_generated_api_client/models/memoryset_metrics.py +33 -0
- orca_sdk/_generated_api_client/models/memoryset_update.py +20 -0
- orca_sdk/_generated_api_client/models/not_found_error_response.py +6 -7
- orca_sdk/_generated_api_client/models/not_found_error_response_resource_type_0.py +1 -0
- orca_sdk/_generated_api_client/models/not_found_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/org_plan.py +99 -0
- orca_sdk/_generated_api_client/models/org_plan_tier.py +11 -0
- orca_sdk/_generated_api_client/models/paginated_task.py +108 -0
- orca_sdk/_generated_api_client/models/predictive_model_update.py +20 -0
- orca_sdk/_generated_api_client/models/pretrained_embedding_model_metadata.py +8 -0
- orca_sdk/_generated_api_client/models/regression_model_metadata.py +14 -0
- orca_sdk/_generated_api_client/models/scored_memory_update.py +9 -9
- orca_sdk/_generated_api_client/models/service_unavailable_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/service_unavailable_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_field_type_0_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_field_type_1_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_field_type_1_item_type_1.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_filter_item.py +42 -30
- orca_sdk/_generated_api_client/models/telemetry_sort_options.py +42 -30
- orca_sdk/_generated_api_client/models/unauthenticated_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/unauthenticated_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/unauthorized_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/unauthorized_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/update_org_plan_request.py +73 -0
- orca_sdk/_generated_api_client/models/update_org_plan_request_tier.py +11 -0
- orca_sdk/_shared/metrics.py +1 -1
- orca_sdk/classification_model.py +4 -1
- orca_sdk/classification_model_test.py +53 -0
- orca_sdk/credentials.py +15 -1
- orca_sdk/datasource.py +180 -41
- orca_sdk/datasource_test.py +194 -0
- orca_sdk/embedding_model.py +51 -13
- orca_sdk/embedding_model_test.py +27 -0
- orca_sdk/job.py +15 -14
- orca_sdk/job_test.py +34 -0
- orca_sdk/memoryset.py +47 -7
- orca_sdk/regression_model_test.py +0 -1
- orca_sdk/telemetry.py +94 -3
- {orca_sdk-0.0.95.dist-info → orca_sdk-0.0.97.dist-info}/METADATA +18 -1
- {orca_sdk-0.0.95.dist-info → orca_sdk-0.0.97.dist-info}/RECORD +87 -56
- orca_sdk/_generated_api_client/models/body_create_datasource_datasource_post.py +0 -207
- orca_sdk/_generated_api_client/models/labeled_memory_metrics.py +0 -246
- {orca_sdk-0.0.95.dist-info → orca_sdk-0.0.97.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
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, Type, TypeVar
|
|
15
|
+
|
|
16
|
+
from attrs import define as _attrs_define
|
|
17
|
+
from attrs import field as _attrs_field
|
|
18
|
+
|
|
19
|
+
from ..models.action_recommendation_action import ActionRecommendationAction
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="ActionRecommendation")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class ActionRecommendation:
|
|
26
|
+
"""Recommended actions to take based on the prediction and explanation
|
|
27
|
+
|
|
28
|
+
Attributes:
|
|
29
|
+
action (ActionRecommendationAction): The recommended action to take
|
|
30
|
+
rationale (str): Explanation for why this action was recommended
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
action: ActionRecommendationAction
|
|
34
|
+
rationale: str
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
|
38
|
+
action = self.action.value if isinstance(self.action, Enum) else self.action
|
|
39
|
+
|
|
40
|
+
rationale = self.rationale
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"action": action,
|
|
47
|
+
"rationale": rationale,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return field_dict
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
55
|
+
d = src_dict.copy()
|
|
56
|
+
action = ActionRecommendationAction(d.pop("action"))
|
|
57
|
+
|
|
58
|
+
rationale = d.pop("rationale")
|
|
59
|
+
|
|
60
|
+
action_recommendation = cls(
|
|
61
|
+
action=action,
|
|
62
|
+
rationale=rationale,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
action_recommendation.additional_properties = d
|
|
66
|
+
return action_recommendation
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def additional_keys(self) -> list[str]:
|
|
70
|
+
return list(self.additional_properties.keys())
|
|
71
|
+
|
|
72
|
+
def __getitem__(self, key: str) -> Any:
|
|
73
|
+
return self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
76
|
+
self.additional_properties[key] = value
|
|
77
|
+
|
|
78
|
+
def __delitem__(self, key: str) -> None:
|
|
79
|
+
del self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __contains__(self, key: str) -> bool:
|
|
82
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ActionRecommendationAction(str, Enum):
|
|
5
|
+
ADD_MEMORIES = "add_memories"
|
|
6
|
+
DETECT_MISLABELS = "detect_mislabels"
|
|
7
|
+
FINETUNING = "finetuning"
|
|
8
|
+
REMOVE_DUPLICATES = "remove_duplicates"
|
|
9
|
+
|
|
10
|
+
def __str__(self) -> str:
|
|
11
|
+
return str(self.value)
|
|
@@ -0,0 +1,85 @@
|
|
|
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, List, Type, TypeVar
|
|
14
|
+
|
|
15
|
+
from attrs import define as _attrs_define
|
|
16
|
+
from attrs import field as _attrs_field
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from ..models.add_memory_suggestion import AddMemorySuggestion
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="AddMemoryRecommendations")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class AddMemoryRecommendations:
|
|
27
|
+
"""Recommendations for memories to add
|
|
28
|
+
|
|
29
|
+
Attributes:
|
|
30
|
+
memories (List['AddMemorySuggestion']):
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
memories: List["AddMemorySuggestion"]
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
memories = []
|
|
38
|
+
for memories_item_data in self.memories:
|
|
39
|
+
memories_item = memories_item_data.to_dict()
|
|
40
|
+
memories.append(memories_item)
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"memories": memories,
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
return field_dict
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
54
|
+
from ..models.add_memory_suggestion import AddMemorySuggestion
|
|
55
|
+
|
|
56
|
+
d = src_dict.copy()
|
|
57
|
+
memories = []
|
|
58
|
+
_memories = d.pop("memories")
|
|
59
|
+
for memories_item_data in _memories:
|
|
60
|
+
memories_item = AddMemorySuggestion.from_dict(memories_item_data)
|
|
61
|
+
|
|
62
|
+
memories.append(memories_item)
|
|
63
|
+
|
|
64
|
+
add_memory_recommendations = cls(
|
|
65
|
+
memories=memories,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
add_memory_recommendations.additional_properties = d
|
|
69
|
+
return add_memory_recommendations
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def additional_keys(self) -> list[str]:
|
|
73
|
+
return list(self.additional_properties.keys())
|
|
74
|
+
|
|
75
|
+
def __getitem__(self, key: str) -> Any:
|
|
76
|
+
return self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
79
|
+
self.additional_properties[key] = value
|
|
80
|
+
|
|
81
|
+
def __delitem__(self, key: str) -> None:
|
|
82
|
+
del self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __contains__(self, key: str) -> bool:
|
|
85
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
|
14
|
+
|
|
15
|
+
from attrs import define as _attrs_define
|
|
16
|
+
from attrs import field as _attrs_field
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="AddMemorySuggestion")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class AddMemorySuggestion:
|
|
23
|
+
"""A suggested memory to add to the memory store
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
value (str):
|
|
27
|
+
label (str):
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
value: str
|
|
31
|
+
label: str
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
value = self.value
|
|
36
|
+
|
|
37
|
+
label = self.label
|
|
38
|
+
|
|
39
|
+
field_dict: dict[str, Any] = {}
|
|
40
|
+
field_dict.update(self.additional_properties)
|
|
41
|
+
field_dict.update(
|
|
42
|
+
{
|
|
43
|
+
"value": value,
|
|
44
|
+
"label": label,
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
return field_dict
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
52
|
+
d = src_dict.copy()
|
|
53
|
+
value = d.pop("value")
|
|
54
|
+
|
|
55
|
+
label = d.pop("label")
|
|
56
|
+
|
|
57
|
+
add_memory_suggestion = cls(
|
|
58
|
+
value=value,
|
|
59
|
+
label=label,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
add_memory_suggestion.additional_properties = d
|
|
63
|
+
return add_memory_suggestion
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def additional_keys(self) -> list[str]:
|
|
67
|
+
return list(self.additional_properties.keys())
|
|
68
|
+
|
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
|
70
|
+
return self.additional_properties[key]
|
|
71
|
+
|
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
73
|
+
self.additional_properties[key] = value
|
|
74
|
+
|
|
75
|
+
def __delitem__(self, key: str) -> None:
|
|
76
|
+
del self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __contains__(self, key: str) -> bool:
|
|
79
|
+
return key in self.additional_properties
|
orca_sdk/_generated_api_client/models/body_create_datasource_from_files_datasource_upload_post.py
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
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 json
|
|
14
|
+
from io import BytesIO
|
|
15
|
+
from typing import Any, List, Tuple, Type, TypeVar, Union, cast
|
|
16
|
+
|
|
17
|
+
from attrs import define as _attrs_define
|
|
18
|
+
from attrs import field as _attrs_field
|
|
19
|
+
|
|
20
|
+
from ..types import UNSET, File, Unset
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="BodyCreateDatasourceFromFilesDatasourceUploadPost")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class BodyCreateDatasourceFromFilesDatasourceUploadPost:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
files (List[File]):
|
|
30
|
+
name (str):
|
|
31
|
+
description (Union[None, Unset, str]):
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
files: List[File]
|
|
35
|
+
name: str
|
|
36
|
+
description: Union[None, Unset, str] = UNSET
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
def to_dict(self) -> dict[str, Any]:
|
|
40
|
+
files = []
|
|
41
|
+
for files_item_data in self.files:
|
|
42
|
+
files_item = files_item_data.to_tuple()
|
|
43
|
+
|
|
44
|
+
files.append(files_item)
|
|
45
|
+
|
|
46
|
+
name = self.name
|
|
47
|
+
|
|
48
|
+
description: Union[None, Unset, str]
|
|
49
|
+
if isinstance(self.description, Unset):
|
|
50
|
+
description = UNSET
|
|
51
|
+
else:
|
|
52
|
+
description = self.description
|
|
53
|
+
|
|
54
|
+
field_dict: dict[str, Any] = {}
|
|
55
|
+
field_dict.update(self.additional_properties)
|
|
56
|
+
field_dict.update(
|
|
57
|
+
{
|
|
58
|
+
"files": files,
|
|
59
|
+
"name": name,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
if description is not UNSET:
|
|
63
|
+
field_dict["description"] = description
|
|
64
|
+
|
|
65
|
+
return field_dict
|
|
66
|
+
|
|
67
|
+
def to_multipart(self) -> dict[str, Any]:
|
|
68
|
+
_temp_files = []
|
|
69
|
+
for files_item_data in self.files:
|
|
70
|
+
files_item = files_item_data.to_tuple()
|
|
71
|
+
|
|
72
|
+
_temp_files.append(files_item)
|
|
73
|
+
files = (None, json.dumps(_temp_files).encode(), "application/json")
|
|
74
|
+
|
|
75
|
+
name = (None, str(self.name).encode(), "text/plain")
|
|
76
|
+
|
|
77
|
+
description: Union[Tuple[None, bytes, str], Unset]
|
|
78
|
+
|
|
79
|
+
if isinstance(self.description, Unset):
|
|
80
|
+
description = UNSET
|
|
81
|
+
elif isinstance(self.description, str):
|
|
82
|
+
description = (None, str(self.description).encode(), "text/plain")
|
|
83
|
+
else:
|
|
84
|
+
description = (None, str(self.description).encode(), "text/plain")
|
|
85
|
+
|
|
86
|
+
field_dict: dict[str, Any] = {}
|
|
87
|
+
for prop_name, prop in self.additional_properties.items():
|
|
88
|
+
field_dict[prop_name] = (None, str(prop).encode(), "text/plain")
|
|
89
|
+
|
|
90
|
+
field_dict.update(
|
|
91
|
+
{
|
|
92
|
+
"files": files,
|
|
93
|
+
"name": name,
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
if description is not UNSET:
|
|
97
|
+
field_dict["description"] = description
|
|
98
|
+
|
|
99
|
+
return field_dict
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
103
|
+
d = src_dict.copy()
|
|
104
|
+
files = []
|
|
105
|
+
_files = d.pop("files")
|
|
106
|
+
for files_item_data in _files:
|
|
107
|
+
files_item = File(payload=BytesIO(files_item_data))
|
|
108
|
+
|
|
109
|
+
files.append(files_item)
|
|
110
|
+
|
|
111
|
+
name = d.pop("name")
|
|
112
|
+
|
|
113
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
114
|
+
if data is None:
|
|
115
|
+
return data
|
|
116
|
+
if isinstance(data, Unset):
|
|
117
|
+
return data
|
|
118
|
+
return cast(Union[None, Unset, str], data)
|
|
119
|
+
|
|
120
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
121
|
+
|
|
122
|
+
body_create_datasource_from_files_datasource_upload_post = cls(
|
|
123
|
+
files=files,
|
|
124
|
+
name=name,
|
|
125
|
+
description=description,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
body_create_datasource_from_files_datasource_upload_post.additional_properties = d
|
|
129
|
+
return body_create_datasource_from_files_datasource_upload_post
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def additional_keys(self) -> list[str]:
|
|
133
|
+
return list(self.additional_properties.keys())
|
|
134
|
+
|
|
135
|
+
def __getitem__(self, key: str) -> Any:
|
|
136
|
+
return self.additional_properties[key]
|
|
137
|
+
|
|
138
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
139
|
+
self.additional_properties[key] = value
|
|
140
|
+
|
|
141
|
+
def __delitem__(self, key: str) -> None:
|
|
142
|
+
del self.additional_properties[key]
|
|
143
|
+
|
|
144
|
+
def __contains__(self, key: str) -> bool:
|
|
145
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,92 @@
|
|
|
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, List, 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="ClassRepresentatives")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class ClassRepresentatives:
|
|
23
|
+
"""
|
|
24
|
+
Attributes:
|
|
25
|
+
label (int):
|
|
26
|
+
label_name (Union[None, str]):
|
|
27
|
+
representative_memory_ids (List[str]):
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
label: int
|
|
31
|
+
label_name: Union[None, str]
|
|
32
|
+
representative_memory_ids: List[str]
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
label = self.label
|
|
37
|
+
|
|
38
|
+
label_name: Union[None, str]
|
|
39
|
+
label_name = self.label_name
|
|
40
|
+
|
|
41
|
+
representative_memory_ids = self.representative_memory_ids
|
|
42
|
+
|
|
43
|
+
field_dict: dict[str, Any] = {}
|
|
44
|
+
field_dict.update(self.additional_properties)
|
|
45
|
+
field_dict.update(
|
|
46
|
+
{
|
|
47
|
+
"label": label,
|
|
48
|
+
"label_name": label_name,
|
|
49
|
+
"representative_memory_ids": representative_memory_ids,
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
57
|
+
d = src_dict.copy()
|
|
58
|
+
label = d.pop("label")
|
|
59
|
+
|
|
60
|
+
def _parse_label_name(data: object) -> Union[None, str]:
|
|
61
|
+
if data is None:
|
|
62
|
+
return data
|
|
63
|
+
return cast(Union[None, str], data)
|
|
64
|
+
|
|
65
|
+
label_name = _parse_label_name(d.pop("label_name"))
|
|
66
|
+
|
|
67
|
+
representative_memory_ids = cast(List[str], d.pop("representative_memory_ids"))
|
|
68
|
+
|
|
69
|
+
class_representatives = cls(
|
|
70
|
+
label=label,
|
|
71
|
+
label_name=label_name,
|
|
72
|
+
representative_memory_ids=representative_memory_ids,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
class_representatives.additional_properties = d
|
|
76
|
+
return class_representatives
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def additional_keys(self) -> list[str]:
|
|
80
|
+
return list(self.additional_properties.keys())
|
|
81
|
+
|
|
82
|
+
def __getitem__(self, key: str) -> Any:
|
|
83
|
+
return self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
86
|
+
self.additional_properties[key] = value
|
|
87
|
+
|
|
88
|
+
def __delitem__(self, key: str) -> None:
|
|
89
|
+
del self.additional_properties[key]
|
|
90
|
+
|
|
91
|
+
def __contains__(self, key: str) -> bool:
|
|
92
|
+
return key in self.additional_properties
|
|
@@ -31,6 +31,7 @@ class ClassificationModelMetadata:
|
|
|
31
31
|
org_id (str):
|
|
32
32
|
name (str):
|
|
33
33
|
description (Union[None, str]):
|
|
34
|
+
notes (Union[None, str]):
|
|
34
35
|
version (int):
|
|
35
36
|
memoryset_id (str):
|
|
36
37
|
memory_lookup_count (int):
|
|
@@ -49,6 +50,7 @@ class ClassificationModelMetadata:
|
|
|
49
50
|
org_id: str
|
|
50
51
|
name: str
|
|
51
52
|
description: Union[None, str]
|
|
53
|
+
notes: Union[None, str]
|
|
52
54
|
version: int
|
|
53
55
|
memoryset_id: str
|
|
54
56
|
memory_lookup_count: int
|
|
@@ -73,6 +75,9 @@ class ClassificationModelMetadata:
|
|
|
73
75
|
description: Union[None, str]
|
|
74
76
|
description = self.description
|
|
75
77
|
|
|
78
|
+
notes: Union[None, str]
|
|
79
|
+
notes = self.notes
|
|
80
|
+
|
|
76
81
|
version = self.version
|
|
77
82
|
|
|
78
83
|
memoryset_id = self.memoryset_id
|
|
@@ -107,6 +112,7 @@ class ClassificationModelMetadata:
|
|
|
107
112
|
"org_id": org_id,
|
|
108
113
|
"name": name,
|
|
109
114
|
"description": description,
|
|
115
|
+
"notes": notes,
|
|
110
116
|
"version": version,
|
|
111
117
|
"memoryset_id": memoryset_id,
|
|
112
118
|
"memory_lookup_count": memory_lookup_count,
|
|
@@ -140,6 +146,13 @@ class ClassificationModelMetadata:
|
|
|
140
146
|
|
|
141
147
|
description = _parse_description(d.pop("description"))
|
|
142
148
|
|
|
149
|
+
def _parse_notes(data: object) -> Union[None, str]:
|
|
150
|
+
if data is None:
|
|
151
|
+
return data
|
|
152
|
+
return cast(Union[None, str], data)
|
|
153
|
+
|
|
154
|
+
notes = _parse_notes(d.pop("notes"))
|
|
155
|
+
|
|
143
156
|
version = d.pop("version")
|
|
144
157
|
|
|
145
158
|
memoryset_id = d.pop("memoryset_id")
|
|
@@ -179,6 +192,7 @@ class ClassificationModelMetadata:
|
|
|
179
192
|
org_id=org_id,
|
|
180
193
|
name=name,
|
|
181
194
|
description=description,
|
|
195
|
+
notes=notes,
|
|
182
196
|
version=version,
|
|
183
197
|
memoryset_id=memoryset_id,
|
|
184
198
|
memory_lookup_count=memory_lookup_count,
|
|
@@ -28,16 +28,20 @@ class CloneMemorysetRequest:
|
|
|
28
28
|
Attributes:
|
|
29
29
|
name (str):
|
|
30
30
|
description (Union[None, Unset, str]):
|
|
31
|
+
notes (Union[None, Unset, str]):
|
|
31
32
|
pretrained_embedding_model_name (Union[None, PretrainedEmbeddingModelName, Unset]):
|
|
32
33
|
finetuned_embedding_model_id (Union[None, Unset, str]):
|
|
33
34
|
max_seq_length_override (Union[None, Unset, int]):
|
|
35
|
+
prompt (Union[None, Unset, str]):
|
|
34
36
|
"""
|
|
35
37
|
|
|
36
38
|
name: str
|
|
37
39
|
description: Union[None, Unset, str] = UNSET
|
|
40
|
+
notes: Union[None, Unset, str] = UNSET
|
|
38
41
|
pretrained_embedding_model_name: Union[None, PretrainedEmbeddingModelName, Unset] = UNSET
|
|
39
42
|
finetuned_embedding_model_id: Union[None, Unset, str] = UNSET
|
|
40
43
|
max_seq_length_override: Union[None, Unset, int] = UNSET
|
|
44
|
+
prompt: Union[None, Unset, str] = UNSET
|
|
41
45
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
42
46
|
|
|
43
47
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -49,6 +53,12 @@ class CloneMemorysetRequest:
|
|
|
49
53
|
else:
|
|
50
54
|
description = self.description
|
|
51
55
|
|
|
56
|
+
notes: Union[None, Unset, str]
|
|
57
|
+
if isinstance(self.notes, Unset):
|
|
58
|
+
notes = UNSET
|
|
59
|
+
else:
|
|
60
|
+
notes = self.notes
|
|
61
|
+
|
|
52
62
|
pretrained_embedding_model_name: Union[None, Unset, str]
|
|
53
63
|
if isinstance(self.pretrained_embedding_model_name, Unset):
|
|
54
64
|
pretrained_embedding_model_name = UNSET
|
|
@@ -73,6 +83,12 @@ class CloneMemorysetRequest:
|
|
|
73
83
|
else:
|
|
74
84
|
max_seq_length_override = self.max_seq_length_override
|
|
75
85
|
|
|
86
|
+
prompt: Union[None, Unset, str]
|
|
87
|
+
if isinstance(self.prompt, Unset):
|
|
88
|
+
prompt = UNSET
|
|
89
|
+
else:
|
|
90
|
+
prompt = self.prompt
|
|
91
|
+
|
|
76
92
|
field_dict: dict[str, Any] = {}
|
|
77
93
|
field_dict.update(self.additional_properties)
|
|
78
94
|
field_dict.update(
|
|
@@ -82,12 +98,16 @@ class CloneMemorysetRequest:
|
|
|
82
98
|
)
|
|
83
99
|
if description is not UNSET:
|
|
84
100
|
field_dict["description"] = description
|
|
101
|
+
if notes is not UNSET:
|
|
102
|
+
field_dict["notes"] = notes
|
|
85
103
|
if pretrained_embedding_model_name is not UNSET:
|
|
86
104
|
field_dict["pretrained_embedding_model_name"] = pretrained_embedding_model_name
|
|
87
105
|
if finetuned_embedding_model_id is not UNSET:
|
|
88
106
|
field_dict["finetuned_embedding_model_id"] = finetuned_embedding_model_id
|
|
89
107
|
if max_seq_length_override is not UNSET:
|
|
90
108
|
field_dict["max_seq_length_override"] = max_seq_length_override
|
|
109
|
+
if prompt is not UNSET:
|
|
110
|
+
field_dict["prompt"] = prompt
|
|
91
111
|
|
|
92
112
|
return field_dict
|
|
93
113
|
|
|
@@ -105,6 +125,15 @@ class CloneMemorysetRequest:
|
|
|
105
125
|
|
|
106
126
|
description = _parse_description(d.pop("description", UNSET))
|
|
107
127
|
|
|
128
|
+
def _parse_notes(data: object) -> Union[None, Unset, str]:
|
|
129
|
+
if data is None:
|
|
130
|
+
return data
|
|
131
|
+
if isinstance(data, Unset):
|
|
132
|
+
return data
|
|
133
|
+
return cast(Union[None, Unset, str], data)
|
|
134
|
+
|
|
135
|
+
notes = _parse_notes(d.pop("notes", UNSET))
|
|
136
|
+
|
|
108
137
|
def _parse_pretrained_embedding_model_name(data: object) -> Union[None, PretrainedEmbeddingModelName, Unset]:
|
|
109
138
|
if data is None:
|
|
110
139
|
return data
|
|
@@ -142,12 +171,23 @@ class CloneMemorysetRequest:
|
|
|
142
171
|
|
|
143
172
|
max_seq_length_override = _parse_max_seq_length_override(d.pop("max_seq_length_override", UNSET))
|
|
144
173
|
|
|
174
|
+
def _parse_prompt(data: object) -> Union[None, Unset, str]:
|
|
175
|
+
if data is None:
|
|
176
|
+
return data
|
|
177
|
+
if isinstance(data, Unset):
|
|
178
|
+
return data
|
|
179
|
+
return cast(Union[None, Unset, str], data)
|
|
180
|
+
|
|
181
|
+
prompt = _parse_prompt(d.pop("prompt", UNSET))
|
|
182
|
+
|
|
145
183
|
clone_memoryset_request = cls(
|
|
146
184
|
name=name,
|
|
147
185
|
description=description,
|
|
186
|
+
notes=notes,
|
|
148
187
|
pretrained_embedding_model_name=pretrained_embedding_model_name,
|
|
149
188
|
finetuned_embedding_model_id=finetuned_embedding_model_id,
|
|
150
189
|
max_seq_length_override=max_seq_length_override,
|
|
190
|
+
prompt=prompt,
|
|
151
191
|
)
|
|
152
192
|
|
|
153
193
|
clone_memoryset_request.additional_properties = d
|
|
@@ -10,11 +10,14 @@ The main change is:
|
|
|
10
10
|
|
|
11
11
|
# flake8: noqa: C901
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from enum import Enum
|
|
14
|
+
from typing import Any, Type, TypeVar
|
|
14
15
|
|
|
15
16
|
from attrs import define as _attrs_define
|
|
16
17
|
from attrs import field as _attrs_field
|
|
17
18
|
|
|
19
|
+
from ..models.constraint_violation_error_response_status_code import ConstraintViolationErrorResponseStatusCode
|
|
20
|
+
|
|
18
21
|
T = TypeVar("T", bound="ConstraintViolationErrorResponse")
|
|
19
22
|
|
|
20
23
|
|
|
@@ -22,16 +25,16 @@ T = TypeVar("T", bound="ConstraintViolationErrorResponse")
|
|
|
22
25
|
class ConstraintViolationErrorResponse:
|
|
23
26
|
"""
|
|
24
27
|
Attributes:
|
|
25
|
-
status_code (
|
|
28
|
+
status_code (ConstraintViolationErrorResponseStatusCode):
|
|
26
29
|
constraint (str):
|
|
27
30
|
"""
|
|
28
31
|
|
|
29
|
-
status_code:
|
|
32
|
+
status_code: ConstraintViolationErrorResponseStatusCode
|
|
30
33
|
constraint: str
|
|
31
34
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
35
|
|
|
33
36
|
def to_dict(self) -> dict[str, Any]:
|
|
34
|
-
status_code = self.status_code
|
|
37
|
+
status_code = self.status_code.value if isinstance(self.status_code, Enum) else self.status_code
|
|
35
38
|
|
|
36
39
|
constraint = self.constraint
|
|
37
40
|
|
|
@@ -49,9 +52,7 @@ class ConstraintViolationErrorResponse:
|
|
|
49
52
|
@classmethod
|
|
50
53
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
51
54
|
d = src_dict.copy()
|
|
52
|
-
status_code =
|
|
53
|
-
if status_code != 409:
|
|
54
|
-
raise ValueError(f"status_code must match const 409, got '{status_code}'")
|
|
55
|
+
status_code = ConstraintViolationErrorResponseStatusCode(d.pop("status_code"))
|
|
55
56
|
|
|
56
57
|
constraint = d.pop("constraint")
|
|
57
58
|
|