Skip to content

[Client] Automatic update from platform release (4.0.12) #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.1.0
- Package version: 4.0.11
- Package version: 4.0.12
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

Expand Down Expand Up @@ -163,6 +163,7 @@ Class | Method | HTTP request | Description
- [DeploymentStatusRequest](docs/DeploymentStatusRequest.md)
- [DeploymentStatusResponse](docs/DeploymentStatusResponse.md)
- [DeploymentType](docs/DeploymentType.md)
- [DeploymentUsage](docs/DeploymentUsage.md)
- [DeploymentUsageValue](docs/DeploymentUsageValue.md)
- [GetAutochargePreferencesResponse](docs/GetAutochargePreferencesResponse.md)
- [GetCServeV2DeploymentResponse](docs/GetCServeV2DeploymentResponse.md)
Expand Down
1 change: 1 addition & 0 deletions docs/CreateCServeV2DeploymentRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**cluster_id** | **int** | |
**hardware_instance_id** | **int** | |
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
**cserve_version** | **str** | | [optional]
**hf_token** | **str** | | [optional]
**endpoint_bearer_token** | **str** | | [optional]
**endpoint_certificate_authority** | **str** | | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/CreateRagDeploymentRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**cluster_id** | **int** | |
**hardware_instance_id** | **int** | |
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
**cserve_version** | **str** | | [optional]
**hf_token** | **str** | | [optional]
**llm_model** | **str** | |
**centml_api_key** | **str** | |
Expand Down
30 changes: 30 additions & 0 deletions docs/DeploymentUsage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# DeploymentUsage


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**metric** | **Dict[str, str]** | |
**values** | [**List[DeploymentUsageValue]**](DeploymentUsageValue.md) | |

## Example

```python
from platform_api_python_client.models.deployment_usage import DeploymentUsage

# TODO update the JSON string below
json = "{}"
# create an instance of DeploymentUsage from a JSON string
deployment_usage_instance = DeploymentUsage.from_json(json)
# print the JSON string representation of the object
print(DeploymentUsage.to_json())

# convert the object into a dict
deployment_usage_dict = deployment_usage_instance.to_dict()
# create an instance of DeploymentUsage from a dict
deployment_usage_from_dict = DeploymentUsage.from_dict(deployment_usage_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/GetCServeV2DeploymentResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**created_at** | **datetime** | |
**hardware_instance_id** | **int** | |
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
**cserve_version** | **str** | | [optional]
**min_scale** | **int** | |
**max_scale** | **int** | |
**initial_scale** | **int** | | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/GetDeploymentUsageResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**values** | [**List[DeploymentUsageValue]**](DeploymentUsageValue.md) | |
**values** | [**List[DeploymentUsage]**](DeploymentUsage.md) | |

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/GetRagDeploymentResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**created_at** | **datetime** | |
**hardware_instance_id** | **int** | |
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
**cserve_version** | **str** | | [optional]
**llm_model** | **str** | |
**centml_api_key** | **str** | |
**min_scale** | **int** | | [optional] [default to 1]
Expand Down
8 changes: 8 additions & 0 deletions docs/Metric.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@

* `HTTP_REQUESTS` (value: `'http_requests'`)

* `HTTP_REQUESTS_BY_STATUS` (value: `'http_requests_by_status'`)

* `ERROR_CODE` (value: `'error_code'`)

* `REQUEST_LATENCY_50_PERCENTILE` (value: `'request_latency_50_percentile'`)

* `REQUEST_LATENCY_90_PERCENTILE` (value: `'request_latency_90_percentile'`)

* `REQUEST_LATENCY_99_PERCENTILE` (value: `'request_latency_99_percentile'`)

* `TOKENS_PER_SECOND` (value: `'tokens_per_second'`)

* `TIME_TO_FIRST_TOKEN` (value: `'time_to_first_token'`)

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


3 changes: 2 additions & 1 deletion platform_api_python_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
""" # noqa: E501


__version__ = "4.0.11"
__version__ = "4.0.12"

# import apis into sdk package
from platform_api_python_client.api.external_api import EXTERNALApi
Expand Down Expand Up @@ -55,6 +55,7 @@
from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest
from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse
from platform_api_python_client.models.deployment_type import DeploymentType
from platform_api_python_client.models.deployment_usage import DeploymentUsage
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
from platform_api_python_client.models.get_autocharge_preferences_response import GetAutochargePreferencesResponse
from platform_api_python_client.models.get_c_serve_v2_deployment_response import GetCServeV2DeploymentResponse
Expand Down
2 changes: 1 addition & 1 deletion platform_api_python_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/4.0.11/python'
self.user_agent = 'OpenAPI-Generator/4.0.12/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion platform_api_python_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 0.1.0\n"\
"SDK Package Version: 4.0.11".\
"SDK Package Version: 4.0.12".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
1 change: 1 addition & 0 deletions platform_api_python_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest
from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse
from platform_api_python_client.models.deployment_type import DeploymentType
from platform_api_python_client.models.deployment_usage import DeploymentUsage
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
from platform_api_python_client.models.get_autocharge_preferences_response import GetAutochargePreferencesResponse
from platform_api_python_client.models.get_c_serve_v2_deployment_response import GetCServeV2DeploymentResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CreateCServeV2DeploymentRequest(BaseModel):
cluster_id: StrictInt
hardware_instance_id: StrictInt
recipe: CServeV2Recipe
cserve_version: Optional[StrictStr] = None
hf_token: Optional[StrictStr] = None
endpoint_bearer_token: Optional[StrictStr] = None
endpoint_certificate_authority: Optional[StrictStr] = None
Expand All @@ -40,7 +41,7 @@ class CreateCServeV2DeploymentRequest(BaseModel):
initial_scale: Optional[StrictInt] = None
concurrency: Optional[StrictInt] = None
env_vars: Optional[Dict[str, StrictStr]] = None
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_scale", "max_scale", "initial_scale", "concurrency", "env_vars"]
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_scale", "max_scale", "initial_scale", "concurrency", "env_vars"]

@field_validator('name')
def name_validate_regular_expression(cls, value):
Expand Down Expand Up @@ -91,6 +92,11 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of recipe
if self.recipe:
_dict['recipe'] = self.recipe.to_dict()
# set to None if cserve_version (nullable) is None
# and model_fields_set contains the field
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
_dict['cserve_version'] = None

# set to None if hf_token (nullable) is None
# and model_fields_set contains the field
if self.hf_token is None and "hf_token" in self.model_fields_set:
Expand Down Expand Up @@ -132,6 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"cluster_id": obj.get("cluster_id"),
"hardware_instance_id": obj.get("hardware_instance_id"),
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
"cserve_version": obj.get("cserve_version"),
"hf_token": obj.get("hf_token"),
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CreateRagDeploymentRequest(BaseModel):
cluster_id: StrictInt
hardware_instance_id: StrictInt
recipe: CServeV2Recipe
cserve_version: Optional[StrictStr] = None
hf_token: Optional[StrictStr] = None
llm_model: StrictStr
centml_api_key: StrictStr
Expand All @@ -42,7 +43,7 @@ class CreateRagDeploymentRequest(BaseModel):
endpoint_certificate_authority: Optional[StrictStr] = None
concurrency: Optional[StrictInt] = None
env_vars: Optional[Dict[str, StrictStr]] = None
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "hf_token", "llm_model", "centml_api_key", "min_scale", "max_scale", "initial_scale", "endpoint_bearer_token", "endpoint_certificate_authority", "concurrency", "env_vars"]
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "cserve_version", "hf_token", "llm_model", "centml_api_key", "min_scale", "max_scale", "initial_scale", "endpoint_bearer_token", "endpoint_certificate_authority", "concurrency", "env_vars"]

@field_validator('name')
def name_validate_regular_expression(cls, value):
Expand Down Expand Up @@ -93,6 +94,11 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of recipe
if self.recipe:
_dict['recipe'] = self.recipe.to_dict()
# set to None if cserve_version (nullable) is None
# and model_fields_set contains the field
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
_dict['cserve_version'] = None

# set to None if hf_token (nullable) is None
# and model_fields_set contains the field
if self.hf_token is None and "hf_token" in self.model_fields_set:
Expand Down Expand Up @@ -134,6 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"cluster_id": obj.get("cluster_id"),
"hardware_instance_id": obj.get("hardware_instance_id"),
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
"cserve_version": obj.get("cserve_version"),
"hf_token": obj.get("hf_token"),
"llm_model": obj.get("llm_model"),
"centml_api_key": obj.get("centml_api_key"),
Expand Down
97 changes: 97 additions & 0 deletions platform_api_python_client/models/deployment_usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# coding: utf-8

"""
Platform External API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 0.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, StrictStr
from typing import Any, ClassVar, Dict, List
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
from typing import Optional, Set
from typing_extensions import Self

class DeploymentUsage(BaseModel):
"""
DeploymentUsage
""" # noqa: E501
metric: Dict[str, StrictStr]
values: List[DeploymentUsageValue]
__properties: ClassVar[List[str]] = ["metric", "values"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DeploymentUsage from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in values (list)
_items = []
if self.values:
for _item_values in self.values:
if _item_values:
_items.append(_item_values.to_dict())
_dict['values'] = _items
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DeploymentUsage from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"metric": obj.get("metric"),
"values": [DeploymentUsageValue.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
})
return _obj


Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ class GetCServeV2DeploymentResponse(BaseModel):
created_at: datetime
hardware_instance_id: StrictInt
recipe: CServeV2Recipe
cserve_version: Optional[StrictStr] = None
min_scale: StrictInt
max_scale: StrictInt
initial_scale: Optional[StrictInt] = None
endpoint_certificate_authority: Optional[StrictStr] = None
endpoint_bearer_token: Optional[StrictStr] = None
concurrency: Optional[StrictInt] = None
env_vars: Optional[Dict[str, StrictStr]] = None
__properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "recipe", "min_scale", "max_scale", "initial_scale", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "env_vars"]
__properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "recipe", "cserve_version", "min_scale", "max_scale", "initial_scale", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "env_vars"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -96,6 +97,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.image_url is None and "image_url" in self.model_fields_set:
_dict['image_url'] = None

# set to None if cserve_version (nullable) is None
# and model_fields_set contains the field
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
_dict['cserve_version'] = None

# set to None if initial_scale (nullable) is None
# and model_fields_set contains the field
if self.initial_scale is None and "initial_scale" in self.model_fields_set:
Expand Down Expand Up @@ -138,6 +144,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"created_at": obj.get("created_at"),
"hardware_instance_id": obj.get("hardware_instance_id"),
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
"cserve_version": obj.get("cserve_version"),
"min_scale": obj.get("min_scale"),
"max_scale": obj.get("max_scale"),
"initial_scale": obj.get("initial_scale"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
from platform_api_python_client.models.deployment_usage import DeploymentUsage
from typing import Optional, Set
from typing_extensions import Self

class GetDeploymentUsageResponse(BaseModel):
"""
GetDeploymentUsageResponse
""" # noqa: E501
values: List[DeploymentUsageValue]
values: List[DeploymentUsage]
__properties: ClassVar[List[str]] = ["values"]

model_config = ConfigDict(
Expand Down Expand Up @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"values": [DeploymentUsageValue.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
"values": [DeploymentUsage.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
})
return _obj

Expand Down
Loading