mapleflow 0.8.1__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.
- mapleflow/__init__.py +8 -0
- mapleflow/api/__init__.py +1 -0
- mapleflow/api/ai/__init__.py +1 -0
- mapleflow/api/ai/post_ai_chat.py +195 -0
- mapleflow/api/ai/post_ai_embeddings.py +191 -0
- mapleflow/api/ai/post_ai_images.py +195 -0
- mapleflow/api/ai/post_ai_speech.py +191 -0
- mapleflow/api/ai/post_ai_transcribe.py +189 -0
- mapleflow/api/images/__init__.py +1 -0
- mapleflow/api/images/post_images_bg_remove.py +235 -0
- mapleflow/api/utility/__init__.py +1 -0
- mapleflow/api/utility/get_currency.py +253 -0
- mapleflow/api/utility/get_weather.py +277 -0
- mapleflow/api/utility/post_translate.py +206 -0
- mapleflow/api/verify/__init__.py +1 -0
- mapleflow/api/verify/post_verify_face.py +190 -0
- mapleflow/api/verify/post_verify_labels.py +190 -0
- mapleflow/client.py +282 -0
- mapleflow/errors.py +16 -0
- mapleflow/models/__init__.py +99 -0
- mapleflow/models/get_currency_response_200.py +81 -0
- mapleflow/models/get_currency_response_400.py +81 -0
- mapleflow/models/get_currency_response_404.py +81 -0
- mapleflow/models/get_currency_response_502.py +81 -0
- mapleflow/models/get_weather_response_200.py +81 -0
- mapleflow/models/get_weather_response_400.py +81 -0
- mapleflow/models/get_weather_response_404.py +81 -0
- mapleflow/models/get_weather_response_502.py +81 -0
- mapleflow/models/get_weather_units.py +9 -0
- mapleflow/models/post_ai_chat_body.py +104 -0
- mapleflow/models/post_ai_chat_body_messages_item.py +69 -0
- mapleflow/models/post_ai_chat_body_model.py +9 -0
- mapleflow/models/post_ai_chat_response_200.py +72 -0
- mapleflow/models/post_ai_chat_response_400.py +69 -0
- mapleflow/models/post_ai_embeddings_body.py +98 -0
- mapleflow/models/post_ai_embeddings_body_model.py +8 -0
- mapleflow/models/post_ai_embeddings_response_200.py +72 -0
- mapleflow/models/post_ai_embeddings_response_400.py +69 -0
- mapleflow/models/post_ai_images_body.py +90 -0
- mapleflow/models/post_ai_images_body_model.py +9 -0
- mapleflow/models/post_ai_images_response_200.py +72 -0
- mapleflow/models/post_ai_images_response_400.py +69 -0
- mapleflow/models/post_ai_speech_body.py +80 -0
- mapleflow/models/post_ai_speech_body_model.py +8 -0
- mapleflow/models/post_ai_speech_response_200.py +72 -0
- mapleflow/models/post_ai_speech_response_400.py +69 -0
- mapleflow/models/post_ai_transcribe_body.py +81 -0
- mapleflow/models/post_ai_transcribe_response_200.py +72 -0
- mapleflow/models/post_ai_transcribe_response_400.py +69 -0
- mapleflow/models/post_images_bg_remove_files_body.py +93 -0
- mapleflow/models/post_images_bg_remove_json_body.py +70 -0
- mapleflow/models/post_images_bg_remove_response_200.py +72 -0
- mapleflow/models/post_images_bg_remove_response_400.py +69 -0
- mapleflow/models/post_images_bg_remove_response_502.py +69 -0
- mapleflow/models/post_images_bg_remove_response_504.py +69 -0
- mapleflow/models/post_translate_body.py +89 -0
- mapleflow/models/post_translate_response_200.py +81 -0
- mapleflow/models/post_translate_response_400.py +81 -0
- mapleflow/models/post_translate_response_402.py +81 -0
- mapleflow/models/post_verify_face_files_body.py +100 -0
- mapleflow/models/post_verify_face_json_body.py +69 -0
- mapleflow/models/post_verify_face_response_200.py +72 -0
- mapleflow/models/post_verify_face_response_400.py +69 -0
- mapleflow/models/post_verify_labels_files_body.py +81 -0
- mapleflow/models/post_verify_labels_json_body.py +61 -0
- mapleflow/models/post_verify_labels_response_200.py +72 -0
- mapleflow/models/post_verify_labels_response_400.py +69 -0
- mapleflow/types.py +54 -0
- mapleflow-0.8.1.dist-info/METADATA +54 -0
- mapleflow-0.8.1.dist-info/RECORD +71 -0
- mapleflow-0.8.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="GetCurrencyResponse502")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class GetCurrencyResponse502:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
success (bool):
|
|
19
|
+
data (Any | Unset):
|
|
20
|
+
error (str | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
success: bool
|
|
24
|
+
data: Any | Unset = UNSET
|
|
25
|
+
error: str | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
success = self.success
|
|
30
|
+
|
|
31
|
+
data = self.data
|
|
32
|
+
|
|
33
|
+
error = self.error
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"success": success,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if data is not UNSET:
|
|
43
|
+
field_dict["data"] = data
|
|
44
|
+
if error is not UNSET:
|
|
45
|
+
field_dict["error"] = error
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
success = d.pop("success")
|
|
53
|
+
|
|
54
|
+
data = d.pop("data", UNSET)
|
|
55
|
+
|
|
56
|
+
error = d.pop("error", UNSET)
|
|
57
|
+
|
|
58
|
+
get_currency_response_502 = cls(
|
|
59
|
+
success=success,
|
|
60
|
+
data=data,
|
|
61
|
+
error=error,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
get_currency_response_502.additional_properties = d
|
|
65
|
+
return get_currency_response_502
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def additional_keys(self) -> list[str]:
|
|
69
|
+
return list(self.additional_properties.keys())
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, key: str) -> Any:
|
|
72
|
+
return self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
75
|
+
self.additional_properties[key] = value
|
|
76
|
+
|
|
77
|
+
def __delitem__(self, key: str) -> None:
|
|
78
|
+
del self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __contains__(self, key: str) -> bool:
|
|
81
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="GetWeatherResponse200")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class GetWeatherResponse200:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
success (bool):
|
|
19
|
+
data (Any | Unset):
|
|
20
|
+
error (str | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
success: bool
|
|
24
|
+
data: Any | Unset = UNSET
|
|
25
|
+
error: str | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
success = self.success
|
|
30
|
+
|
|
31
|
+
data = self.data
|
|
32
|
+
|
|
33
|
+
error = self.error
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"success": success,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if data is not UNSET:
|
|
43
|
+
field_dict["data"] = data
|
|
44
|
+
if error is not UNSET:
|
|
45
|
+
field_dict["error"] = error
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
success = d.pop("success")
|
|
53
|
+
|
|
54
|
+
data = d.pop("data", UNSET)
|
|
55
|
+
|
|
56
|
+
error = d.pop("error", UNSET)
|
|
57
|
+
|
|
58
|
+
get_weather_response_200 = cls(
|
|
59
|
+
success=success,
|
|
60
|
+
data=data,
|
|
61
|
+
error=error,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
get_weather_response_200.additional_properties = d
|
|
65
|
+
return get_weather_response_200
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def additional_keys(self) -> list[str]:
|
|
69
|
+
return list(self.additional_properties.keys())
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, key: str) -> Any:
|
|
72
|
+
return self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
75
|
+
self.additional_properties[key] = value
|
|
76
|
+
|
|
77
|
+
def __delitem__(self, key: str) -> None:
|
|
78
|
+
del self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __contains__(self, key: str) -> bool:
|
|
81
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="GetWeatherResponse400")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class GetWeatherResponse400:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
success (bool):
|
|
19
|
+
data (Any | Unset):
|
|
20
|
+
error (str | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
success: bool
|
|
24
|
+
data: Any | Unset = UNSET
|
|
25
|
+
error: str | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
success = self.success
|
|
30
|
+
|
|
31
|
+
data = self.data
|
|
32
|
+
|
|
33
|
+
error = self.error
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"success": success,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if data is not UNSET:
|
|
43
|
+
field_dict["data"] = data
|
|
44
|
+
if error is not UNSET:
|
|
45
|
+
field_dict["error"] = error
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
success = d.pop("success")
|
|
53
|
+
|
|
54
|
+
data = d.pop("data", UNSET)
|
|
55
|
+
|
|
56
|
+
error = d.pop("error", UNSET)
|
|
57
|
+
|
|
58
|
+
get_weather_response_400 = cls(
|
|
59
|
+
success=success,
|
|
60
|
+
data=data,
|
|
61
|
+
error=error,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
get_weather_response_400.additional_properties = d
|
|
65
|
+
return get_weather_response_400
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def additional_keys(self) -> list[str]:
|
|
69
|
+
return list(self.additional_properties.keys())
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, key: str) -> Any:
|
|
72
|
+
return self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
75
|
+
self.additional_properties[key] = value
|
|
76
|
+
|
|
77
|
+
def __delitem__(self, key: str) -> None:
|
|
78
|
+
del self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __contains__(self, key: str) -> bool:
|
|
81
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="GetWeatherResponse404")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class GetWeatherResponse404:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
success (bool):
|
|
19
|
+
data (Any | Unset):
|
|
20
|
+
error (str | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
success: bool
|
|
24
|
+
data: Any | Unset = UNSET
|
|
25
|
+
error: str | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
success = self.success
|
|
30
|
+
|
|
31
|
+
data = self.data
|
|
32
|
+
|
|
33
|
+
error = self.error
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"success": success,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if data is not UNSET:
|
|
43
|
+
field_dict["data"] = data
|
|
44
|
+
if error is not UNSET:
|
|
45
|
+
field_dict["error"] = error
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
success = d.pop("success")
|
|
53
|
+
|
|
54
|
+
data = d.pop("data", UNSET)
|
|
55
|
+
|
|
56
|
+
error = d.pop("error", UNSET)
|
|
57
|
+
|
|
58
|
+
get_weather_response_404 = cls(
|
|
59
|
+
success=success,
|
|
60
|
+
data=data,
|
|
61
|
+
error=error,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
get_weather_response_404.additional_properties = d
|
|
65
|
+
return get_weather_response_404
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def additional_keys(self) -> list[str]:
|
|
69
|
+
return list(self.additional_properties.keys())
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, key: str) -> Any:
|
|
72
|
+
return self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
75
|
+
self.additional_properties[key] = value
|
|
76
|
+
|
|
77
|
+
def __delitem__(self, key: str) -> None:
|
|
78
|
+
del self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __contains__(self, key: str) -> bool:
|
|
81
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="GetWeatherResponse502")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class GetWeatherResponse502:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
success (bool):
|
|
19
|
+
data (Any | Unset):
|
|
20
|
+
error (str | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
success: bool
|
|
24
|
+
data: Any | Unset = UNSET
|
|
25
|
+
error: str | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
success = self.success
|
|
30
|
+
|
|
31
|
+
data = self.data
|
|
32
|
+
|
|
33
|
+
error = self.error
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"success": success,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if data is not UNSET:
|
|
43
|
+
field_dict["data"] = data
|
|
44
|
+
if error is not UNSET:
|
|
45
|
+
field_dict["error"] = error
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
success = d.pop("success")
|
|
53
|
+
|
|
54
|
+
data = d.pop("data", UNSET)
|
|
55
|
+
|
|
56
|
+
error = d.pop("error", UNSET)
|
|
57
|
+
|
|
58
|
+
get_weather_response_502 = cls(
|
|
59
|
+
success=success,
|
|
60
|
+
data=data,
|
|
61
|
+
error=error,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
get_weather_response_502.additional_properties = d
|
|
65
|
+
return get_weather_response_502
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def additional_keys(self) -> list[str]:
|
|
69
|
+
return list(self.additional_properties.keys())
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, key: str) -> Any:
|
|
72
|
+
return self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
75
|
+
self.additional_properties[key] = value
|
|
76
|
+
|
|
77
|
+
def __delitem__(self, key: str) -> None:
|
|
78
|
+
del self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __contains__(self, key: str) -> bool:
|
|
81
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.post_ai_chat_body_model import PostAiChatBodyModel
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ..models.post_ai_chat_body_messages_item import PostAiChatBodyMessagesItem
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="PostAiChatBody")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class PostAiChatBody:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
messages (list[PostAiChatBodyMessagesItem]): Array of chat messages
|
|
24
|
+
model (PostAiChatBodyModel | Unset): Model name Default: PostAiChatBodyModel.LLAMA_3_1_8B. Example:
|
|
25
|
+
llama-3.1-8b.
|
|
26
|
+
max_tokens (float | Unset): Maximum tokens to generate Default: 1024.0.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
messages: list[PostAiChatBodyMessagesItem]
|
|
30
|
+
model: PostAiChatBodyModel | Unset = PostAiChatBodyModel.LLAMA_3_1_8B
|
|
31
|
+
max_tokens: float | Unset = 1024.0
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
messages = []
|
|
36
|
+
for messages_item_data in self.messages:
|
|
37
|
+
messages_item = messages_item_data.to_dict()
|
|
38
|
+
messages.append(messages_item)
|
|
39
|
+
|
|
40
|
+
model: str | Unset = UNSET
|
|
41
|
+
if not isinstance(self.model, Unset):
|
|
42
|
+
model = self.model.value
|
|
43
|
+
|
|
44
|
+
max_tokens = self.max_tokens
|
|
45
|
+
|
|
46
|
+
field_dict: dict[str, Any] = {}
|
|
47
|
+
field_dict.update(self.additional_properties)
|
|
48
|
+
field_dict.update(
|
|
49
|
+
{
|
|
50
|
+
"messages": messages,
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
if model is not UNSET:
|
|
54
|
+
field_dict["model"] = model
|
|
55
|
+
if max_tokens is not UNSET:
|
|
56
|
+
field_dict["max_tokens"] = max_tokens
|
|
57
|
+
|
|
58
|
+
return field_dict
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
62
|
+
from ..models.post_ai_chat_body_messages_item import PostAiChatBodyMessagesItem
|
|
63
|
+
|
|
64
|
+
d = dict(src_dict)
|
|
65
|
+
messages = []
|
|
66
|
+
_messages = d.pop("messages")
|
|
67
|
+
for messages_item_data in _messages:
|
|
68
|
+
messages_item = PostAiChatBodyMessagesItem.from_dict(messages_item_data)
|
|
69
|
+
|
|
70
|
+
messages.append(messages_item)
|
|
71
|
+
|
|
72
|
+
_model = d.pop("model", UNSET)
|
|
73
|
+
model: PostAiChatBodyModel | Unset
|
|
74
|
+
if isinstance(_model, Unset):
|
|
75
|
+
model = UNSET
|
|
76
|
+
else:
|
|
77
|
+
model = PostAiChatBodyModel(_model)
|
|
78
|
+
|
|
79
|
+
max_tokens = d.pop("max_tokens", UNSET)
|
|
80
|
+
|
|
81
|
+
post_ai_chat_body = cls(
|
|
82
|
+
messages=messages,
|
|
83
|
+
model=model,
|
|
84
|
+
max_tokens=max_tokens,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
post_ai_chat_body.additional_properties = d
|
|
88
|
+
return post_ai_chat_body
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def additional_keys(self) -> list[str]:
|
|
92
|
+
return list(self.additional_properties.keys())
|
|
93
|
+
|
|
94
|
+
def __getitem__(self, key: str) -> Any:
|
|
95
|
+
return self.additional_properties[key]
|
|
96
|
+
|
|
97
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
98
|
+
self.additional_properties[key] = value
|
|
99
|
+
|
|
100
|
+
def __delitem__(self, key: str) -> None:
|
|
101
|
+
del self.additional_properties[key]
|
|
102
|
+
|
|
103
|
+
def __contains__(self, key: str) -> bool:
|
|
104
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="PostAiChatBodyMessagesItem")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class PostAiChatBodyMessagesItem:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
role (str): Example: user.
|
|
17
|
+
content (str): Example: Hello!.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
role: str
|
|
21
|
+
content: str
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
role = self.role
|
|
26
|
+
|
|
27
|
+
content = self.content
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"role": role,
|
|
34
|
+
"content": content,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
role = d.pop("role")
|
|
44
|
+
|
|
45
|
+
content = d.pop("content")
|
|
46
|
+
|
|
47
|
+
post_ai_chat_body_messages_item = cls(
|
|
48
|
+
role=role,
|
|
49
|
+
content=content,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
post_ai_chat_body_messages_item.additional_properties = d
|
|
53
|
+
return post_ai_chat_body_messages_item
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="PostAiChatResponse200")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class PostAiChatResponse200:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
success (bool):
|
|
19
|
+
data (Any | Unset):
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
success: bool
|
|
23
|
+
data: Any | Unset = UNSET
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
success = self.success
|
|
28
|
+
|
|
29
|
+
data = self.data
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update(
|
|
34
|
+
{
|
|
35
|
+
"success": success,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
if data is not UNSET:
|
|
39
|
+
field_dict["data"] = data
|
|
40
|
+
|
|
41
|
+
return field_dict
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
45
|
+
d = dict(src_dict)
|
|
46
|
+
success = d.pop("success")
|
|
47
|
+
|
|
48
|
+
data = d.pop("data", UNSET)
|
|
49
|
+
|
|
50
|
+
post_ai_chat_response_200 = cls(
|
|
51
|
+
success=success,
|
|
52
|
+
data=data,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
post_ai_chat_response_200.additional_properties = d
|
|
56
|
+
return post_ai_chat_response_200
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def additional_keys(self) -> list[str]:
|
|
60
|
+
return list(self.additional_properties.keys())
|
|
61
|
+
|
|
62
|
+
def __getitem__(self, key: str) -> Any:
|
|
63
|
+
return self.additional_properties[key]
|
|
64
|
+
|
|
65
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
66
|
+
self.additional_properties[key] = value
|
|
67
|
+
|
|
68
|
+
def __delitem__(self, key: str) -> None:
|
|
69
|
+
del self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __contains__(self, key: str) -> bool:
|
|
72
|
+
return key in self.additional_properties
|