platform-api-python-client 0.1.0__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.
- platform_api_python_client/__init__.py +78 -0
- platform_api_python_client/api/__init__.py +5 -0
- platform_api_python_client/api/external_api.py +7341 -0
- platform_api_python_client/api_client.py +797 -0
- platform_api_python_client/api_response.py +21 -0
- platform_api_python_client/configuration.py +458 -0
- platform_api_python_client/exceptions.py +199 -0
- platform_api_python_client/models/__init__.py +61 -0
- platform_api_python_client/models/add_hardware_request.py +87 -0
- platform_api_python_client/models/api_key_request.py +87 -0
- platform_api_python_client/models/api_key_response.py +92 -0
- platform_api_python_client/models/c_serve_recipe_input.py +166 -0
- platform_api_python_client/models/c_serve_recipe_output.py +166 -0
- platform_api_python_client/models/c_serve_recipe_perf.py +98 -0
- platform_api_python_client/models/c_serve_recipe_response.py +105 -0
- platform_api_python_client/models/client_secret_response.py +87 -0
- platform_api_python_client/models/create_c_serve_deployment_request.py +117 -0
- platform_api_python_client/models/create_c_serve_deployment_response.py +92 -0
- platform_api_python_client/models/create_compute_deployment_response.py +94 -0
- platform_api_python_client/models/create_compute_deployment_v2_request.py +107 -0
- platform_api_python_client/models/create_inference_deployment_response.py +92 -0
- platform_api_python_client/models/create_inference_deployment_v2_request.py +141 -0
- platform_api_python_client/models/create_payment_request.py +89 -0
- platform_api_python_client/models/credits_response.py +87 -0
- platform_api_python_client/models/daily_bill_response.py +90 -0
- platform_api_python_client/models/deployment_status.py +38 -0
- platform_api_python_client/models/deployment_status_request.py +88 -0
- platform_api_python_client/models/deployment_status_response_v2.py +115 -0
- platform_api_python_client/models/deployment_type.py +43 -0
- platform_api_python_client/models/deployment_usage_value.py +89 -0
- platform_api_python_client/models/feedback_request.py +91 -0
- platform_api_python_client/models/get_c_serve_deployment_response.py +210 -0
- platform_api_python_client/models/get_cluster_response.py +89 -0
- platform_api_python_client/models/get_compute_v2_deployment_response.py +134 -0
- platform_api_python_client/models/get_deployment_log_response.py +94 -0
- platform_api_python_client/models/get_deployment_usage_response.py +95 -0
- platform_api_python_client/models/get_deployment_v2_response.py +111 -0
- platform_api_python_client/models/get_inference_v2_deployment_response.py +145 -0
- platform_api_python_client/models/hardware_instance_response.py +99 -0
- platform_api_python_client/models/health_status.py +40 -0
- platform_api_python_client/models/http_validation_error.py +95 -0
- platform_api_python_client/models/list_api_key_response.py +95 -0
- platform_api_python_client/models/list_c_serve_recipe_response.py +95 -0
- platform_api_python_client/models/list_daily_bill_response.py +95 -0
- platform_api_python_client/models/list_get_cluster_response.py +95 -0
- platform_api_python_client/models/list_get_deployment_v2_response.py +95 -0
- platform_api_python_client/models/list_hardware_instance_response.py +95 -0
- platform_api_python_client/models/list_payment_method_response.py +87 -0
- platform_api_python_client/models/list_prebuilt_image_response.py +95 -0
- platform_api_python_client/models/metric.py +38 -0
- platform_api_python_client/models/prebuilt_image_response.py +94 -0
- platform_api_python_client/models/validation_error.py +99 -0
- platform_api_python_client/models/validation_error_loc_inner.py +138 -0
- platform_api_python_client/py.typed +0 -0
- platform_api_python_client/rest.py +257 -0
- platform_api_python_client-0.1.0.dist-info/METADATA +16 -0
- platform_api_python_client-0.1.0.dist-info/RECORD +59 -0
- platform_api_python_client-0.1.0.dist-info/WHEEL +5 -0
- platform_api_python_client-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class DeploymentStatusRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
DeploymentStatusRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
status: DeploymentStatus
|
|
31
|
+
__properties: ClassVar[List[str]] = ["status"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of DeploymentStatusRequest from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of DeploymentStatusRequest from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"status": obj.get("status")
|
|
85
|
+
})
|
|
86
|
+
return _obj
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
23
|
+
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
24
|
+
from platform_api_python_client.models.health_status import HealthStatus
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class DeploymentStatusResponseV2(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DeploymentStatusResponseV2
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictInt
|
|
33
|
+
type: DeploymentType
|
|
34
|
+
status: DeploymentStatus
|
|
35
|
+
service_status: Optional[HealthStatus]
|
|
36
|
+
error_message: Optional[StrictStr]
|
|
37
|
+
endpoint_url: Optional[StrictStr]
|
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "type", "status", "service_status", "error_message", "endpoint_url"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of DeploymentStatusResponseV2 from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
# set to None if service_status (nullable) is None
|
|
80
|
+
# and model_fields_set contains the field
|
|
81
|
+
if self.service_status is None and "service_status" in self.model_fields_set:
|
|
82
|
+
_dict['service_status'] = None
|
|
83
|
+
|
|
84
|
+
# set to None if error_message (nullable) is None
|
|
85
|
+
# and model_fields_set contains the field
|
|
86
|
+
if self.error_message is None and "error_message" in self.model_fields_set:
|
|
87
|
+
_dict['error_message'] = None
|
|
88
|
+
|
|
89
|
+
# set to None if endpoint_url (nullable) is None
|
|
90
|
+
# and model_fields_set contains the field
|
|
91
|
+
if self.endpoint_url is None and "endpoint_url" in self.model_fields_set:
|
|
92
|
+
_dict['endpoint_url'] = None
|
|
93
|
+
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of DeploymentStatusResponseV2 from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate({
|
|
106
|
+
"id": obj.get("id"),
|
|
107
|
+
"type": obj.get("type"),
|
|
108
|
+
"status": obj.get("status"),
|
|
109
|
+
"service_status": obj.get("service_status"),
|
|
110
|
+
"error_message": obj.get("error_message"),
|
|
111
|
+
"endpoint_url": obj.get("endpoint_url")
|
|
112
|
+
})
|
|
113
|
+
return _obj
|
|
114
|
+
|
|
115
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DeploymentType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
DeploymentType
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
INFERENCE = 'inference'
|
|
30
|
+
TRAINING = 'training'
|
|
31
|
+
COMPUTE = 'compute'
|
|
32
|
+
COMPILATION = 'compilation'
|
|
33
|
+
INFERENCE_V2 = 'inference_v2'
|
|
34
|
+
COMPUTE_V2 = 'compute_v2'
|
|
35
|
+
CSERVE = 'cserve'
|
|
36
|
+
DEPLOYMENT = 'deployment'
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_json(cls, json_str: str) -> Self:
|
|
40
|
+
"""Create an instance of DeploymentType from a JSON string"""
|
|
41
|
+
return cls(json.loads(json_str))
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Union
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class DeploymentUsageValue(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DeploymentUsageValue
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
timestamp: StrictInt
|
|
30
|
+
value: Union[StrictFloat, StrictInt]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["timestamp", "value"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of DeploymentUsageValue from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of DeploymentUsageValue from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"timestamp": obj.get("timestamp"),
|
|
85
|
+
"value": obj.get("value")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class FeedbackRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
FeedbackRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
message: StrictStr
|
|
30
|
+
rating: StrictInt
|
|
31
|
+
follow_up: StrictBool
|
|
32
|
+
__properties: ClassVar[List[str]] = ["message", "rating", "follow_up"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of FeedbackRequest from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of FeedbackRequest from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"message": obj.get("message"),
|
|
86
|
+
"rating": obj.get("rating"),
|
|
87
|
+
"follow_up": obj.get("follow_up")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Platform External API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from platform_api_python_client.models.deployment_status import DeploymentStatus
|
|
25
|
+
from platform_api_python_client.models.deployment_type import DeploymentType
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class GetCServeDeploymentResponse(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
GetCServeDeploymentResponse
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
model: StrictStr
|
|
34
|
+
is_embedding_model: StrictBool
|
|
35
|
+
tensor_parallel_size: StrictInt
|
|
36
|
+
pipeline_parallel_size: StrictInt
|
|
37
|
+
block_size: StrictInt
|
|
38
|
+
swap_space: Annotated[int, Field(strict=True, ge=0)]
|
|
39
|
+
gpu_mem_util: Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]
|
|
40
|
+
max_num_seqs: StrictInt
|
|
41
|
+
use_prefix_caching: Optional[StrictBool]
|
|
42
|
+
offloading_num: StrictInt
|
|
43
|
+
use_flashinfer: StrictBool
|
|
44
|
+
max_model_len: Optional[Annotated[int, Field(strict=True, ge=128)]]
|
|
45
|
+
dtype: StrictStr
|
|
46
|
+
tokenizer: Optional[StrictStr]
|
|
47
|
+
spec_proposer: Optional[StrictStr]
|
|
48
|
+
spec_draft_model: Optional[StrictStr]
|
|
49
|
+
spec_tokens: Optional[StrictInt]
|
|
50
|
+
spec_prompt_lookup_min: Optional[Annotated[int, Field(strict=True, ge=1)]]
|
|
51
|
+
spec_prompt_lookup_max: Optional[Annotated[int, Field(strict=True, ge=1)]]
|
|
52
|
+
seed: StrictInt
|
|
53
|
+
cluster_id: StrictInt
|
|
54
|
+
id: StrictInt
|
|
55
|
+
name: StrictStr
|
|
56
|
+
endpoint_url: StrictStr
|
|
57
|
+
image_url: Optional[StrictStr]
|
|
58
|
+
type: DeploymentType
|
|
59
|
+
status: DeploymentStatus
|
|
60
|
+
created_at: datetime
|
|
61
|
+
hardware_instance_id: StrictInt
|
|
62
|
+
min_scale: StrictInt
|
|
63
|
+
max_scale: StrictInt
|
|
64
|
+
endpoint_certificate_authority: Optional[StrictStr]
|
|
65
|
+
concurrency: Optional[StrictInt]
|
|
66
|
+
__properties: ClassVar[List[str]] = ["model", "is_embedding_model", "tensor_parallel_size", "pipeline_parallel_size", "block_size", "swap_space", "gpu_mem_util", "max_num_seqs", "use_prefix_caching", "offloading_num", "use_flashinfer", "max_model_len", "dtype", "tokenizer", "spec_proposer", "spec_draft_model", "spec_tokens", "spec_prompt_lookup_min", "spec_prompt_lookup_max", "seed", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "min_scale", "max_scale", "endpoint_certificate_authority", "concurrency"]
|
|
67
|
+
|
|
68
|
+
model_config = ConfigDict(
|
|
69
|
+
populate_by_name=True,
|
|
70
|
+
validate_assignment=True,
|
|
71
|
+
protected_namespaces=(),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def to_str(self) -> str:
|
|
76
|
+
"""Returns the string representation of the model using alias"""
|
|
77
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
78
|
+
|
|
79
|
+
def to_json(self) -> str:
|
|
80
|
+
"""Returns the JSON representation of the model using alias"""
|
|
81
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
82
|
+
return json.dumps(self.to_dict())
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of GetCServeDeploymentResponse from a JSON string"""
|
|
87
|
+
return cls.from_dict(json.loads(json_str))
|
|
88
|
+
|
|
89
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
90
|
+
"""Return the dictionary representation of the model using alias.
|
|
91
|
+
|
|
92
|
+
This has the following differences from calling pydantic's
|
|
93
|
+
`self.model_dump(by_alias=True)`:
|
|
94
|
+
|
|
95
|
+
* `None` is only added to the output dict for nullable fields that
|
|
96
|
+
were set at model initialization. Other fields with value `None`
|
|
97
|
+
are ignored.
|
|
98
|
+
"""
|
|
99
|
+
excluded_fields: Set[str] = set([
|
|
100
|
+
])
|
|
101
|
+
|
|
102
|
+
_dict = self.model_dump(
|
|
103
|
+
by_alias=True,
|
|
104
|
+
exclude=excluded_fields,
|
|
105
|
+
exclude_none=True,
|
|
106
|
+
)
|
|
107
|
+
# set to None if use_prefix_caching (nullable) is None
|
|
108
|
+
# and model_fields_set contains the field
|
|
109
|
+
if self.use_prefix_caching is None and "use_prefix_caching" in self.model_fields_set:
|
|
110
|
+
_dict['use_prefix_caching'] = None
|
|
111
|
+
|
|
112
|
+
# set to None if max_model_len (nullable) is None
|
|
113
|
+
# and model_fields_set contains the field
|
|
114
|
+
if self.max_model_len is None and "max_model_len" in self.model_fields_set:
|
|
115
|
+
_dict['max_model_len'] = None
|
|
116
|
+
|
|
117
|
+
# set to None if tokenizer (nullable) is None
|
|
118
|
+
# and model_fields_set contains the field
|
|
119
|
+
if self.tokenizer is None and "tokenizer" in self.model_fields_set:
|
|
120
|
+
_dict['tokenizer'] = None
|
|
121
|
+
|
|
122
|
+
# set to None if spec_proposer (nullable) is None
|
|
123
|
+
# and model_fields_set contains the field
|
|
124
|
+
if self.spec_proposer is None and "spec_proposer" in self.model_fields_set:
|
|
125
|
+
_dict['spec_proposer'] = None
|
|
126
|
+
|
|
127
|
+
# set to None if spec_draft_model (nullable) is None
|
|
128
|
+
# and model_fields_set contains the field
|
|
129
|
+
if self.spec_draft_model is None and "spec_draft_model" in self.model_fields_set:
|
|
130
|
+
_dict['spec_draft_model'] = None
|
|
131
|
+
|
|
132
|
+
# set to None if spec_tokens (nullable) is None
|
|
133
|
+
# and model_fields_set contains the field
|
|
134
|
+
if self.spec_tokens is None and "spec_tokens" in self.model_fields_set:
|
|
135
|
+
_dict['spec_tokens'] = None
|
|
136
|
+
|
|
137
|
+
# set to None if spec_prompt_lookup_min (nullable) is None
|
|
138
|
+
# and model_fields_set contains the field
|
|
139
|
+
if self.spec_prompt_lookup_min is None and "spec_prompt_lookup_min" in self.model_fields_set:
|
|
140
|
+
_dict['spec_prompt_lookup_min'] = None
|
|
141
|
+
|
|
142
|
+
# set to None if spec_prompt_lookup_max (nullable) is None
|
|
143
|
+
# and model_fields_set contains the field
|
|
144
|
+
if self.spec_prompt_lookup_max is None and "spec_prompt_lookup_max" in self.model_fields_set:
|
|
145
|
+
_dict['spec_prompt_lookup_max'] = None
|
|
146
|
+
|
|
147
|
+
# set to None if image_url (nullable) is None
|
|
148
|
+
# and model_fields_set contains the field
|
|
149
|
+
if self.image_url is None and "image_url" in self.model_fields_set:
|
|
150
|
+
_dict['image_url'] = None
|
|
151
|
+
|
|
152
|
+
# set to None if endpoint_certificate_authority (nullable) is None
|
|
153
|
+
# and model_fields_set contains the field
|
|
154
|
+
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
155
|
+
_dict['endpoint_certificate_authority'] = None
|
|
156
|
+
|
|
157
|
+
# set to None if concurrency (nullable) is None
|
|
158
|
+
# and model_fields_set contains the field
|
|
159
|
+
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
160
|
+
_dict['concurrency'] = None
|
|
161
|
+
|
|
162
|
+
return _dict
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
166
|
+
"""Create an instance of GetCServeDeploymentResponse from a dict"""
|
|
167
|
+
if obj is None:
|
|
168
|
+
return None
|
|
169
|
+
|
|
170
|
+
if not isinstance(obj, dict):
|
|
171
|
+
return cls.model_validate(obj)
|
|
172
|
+
|
|
173
|
+
_obj = cls.model_validate({
|
|
174
|
+
"model": obj.get("model"),
|
|
175
|
+
"is_embedding_model": obj.get("is_embedding_model") if obj.get("is_embedding_model") is not None else False,
|
|
176
|
+
"tensor_parallel_size": obj.get("tensor_parallel_size"),
|
|
177
|
+
"pipeline_parallel_size": obj.get("pipeline_parallel_size"),
|
|
178
|
+
"block_size": obj.get("block_size") if obj.get("block_size") is not None else 32,
|
|
179
|
+
"swap_space": obj.get("swap_space") if obj.get("swap_space") is not None else 0,
|
|
180
|
+
"gpu_mem_util": obj.get("gpu_mem_util") if obj.get("gpu_mem_util") is not None else 0.95,
|
|
181
|
+
"max_num_seqs": obj.get("max_num_seqs") if obj.get("max_num_seqs") is not None else 256,
|
|
182
|
+
"use_prefix_caching": obj.get("use_prefix_caching"),
|
|
183
|
+
"offloading_num": obj.get("offloading_num") if obj.get("offloading_num") is not None else 0,
|
|
184
|
+
"use_flashinfer": obj.get("use_flashinfer") if obj.get("use_flashinfer") is not None else False,
|
|
185
|
+
"max_model_len": obj.get("max_model_len"),
|
|
186
|
+
"dtype": obj.get("dtype") if obj.get("dtype") is not None else 'auto',
|
|
187
|
+
"tokenizer": obj.get("tokenizer"),
|
|
188
|
+
"spec_proposer": obj.get("spec_proposer"),
|
|
189
|
+
"spec_draft_model": obj.get("spec_draft_model"),
|
|
190
|
+
"spec_tokens": obj.get("spec_tokens"),
|
|
191
|
+
"spec_prompt_lookup_min": obj.get("spec_prompt_lookup_min"),
|
|
192
|
+
"spec_prompt_lookup_max": obj.get("spec_prompt_lookup_max"),
|
|
193
|
+
"seed": obj.get("seed") if obj.get("seed") is not None else 0,
|
|
194
|
+
"cluster_id": obj.get("cluster_id"),
|
|
195
|
+
"id": obj.get("id"),
|
|
196
|
+
"name": obj.get("name"),
|
|
197
|
+
"endpoint_url": obj.get("endpoint_url"),
|
|
198
|
+
"image_url": obj.get("image_url"),
|
|
199
|
+
"type": obj.get("type"),
|
|
200
|
+
"status": obj.get("status"),
|
|
201
|
+
"created_at": obj.get("created_at"),
|
|
202
|
+
"hardware_instance_id": obj.get("hardware_instance_id"),
|
|
203
|
+
"min_scale": obj.get("min_scale"),
|
|
204
|
+
"max_scale": obj.get("max_scale"),
|
|
205
|
+
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
206
|
+
"concurrency": obj.get("concurrency")
|
|
207
|
+
})
|
|
208
|
+
return _obj
|
|
209
|
+
|
|
210
|
+
|