stackit-modelserving 0.2.3__py3-none-any.whl → 0.4.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.
Files changed (31) hide show
  1. stackit/modelserving/__init__.py +6 -7
  2. stackit/modelserving/api/default_api.py +6 -6
  3. stackit/modelserving/api_client.py +21 -24
  4. stackit/modelserving/api_response.py +0 -1
  5. stackit/modelserving/configuration.py +6 -7
  6. stackit/modelserving/exceptions.py +6 -6
  7. stackit/modelserving/models/__init__.py +6 -6
  8. stackit/modelserving/models/chat_model_details.py +22 -9
  9. stackit/modelserving/models/create_token_payload.py +16 -9
  10. stackit/modelserving/models/create_token_response.py +10 -9
  11. stackit/modelserving/models/embedding_model_details.py +22 -9
  12. stackit/modelserving/models/error_message_response.py +10 -9
  13. stackit/modelserving/models/get_chat_model_response.py +10 -9
  14. stackit/modelserving/models/get_embeddings_model_resp.py +10 -9
  15. stackit/modelserving/models/get_token_response.py +10 -9
  16. stackit/modelserving/models/list_models_response.py +10 -9
  17. stackit/modelserving/models/list_token_resp.py +10 -9
  18. stackit/modelserving/models/message_response.py +10 -9
  19. stackit/modelserving/models/model.py +16 -9
  20. stackit/modelserving/models/partial_update_token_payload.py +16 -9
  21. stackit/modelserving/models/sku.py +10 -9
  22. stackit/modelserving/models/token.py +16 -9
  23. stackit/modelserving/models/token_created.py +19 -9
  24. stackit/modelserving/models/update_token_response.py +10 -9
  25. stackit/modelserving/rest.py +6 -7
  26. {stackit_modelserving-0.2.3.dist-info → stackit_modelserving-0.4.0.dist-info}/METADATA +3 -4
  27. stackit_modelserving-0.4.0.dist-info/RECORD +32 -0
  28. {stackit_modelserving-0.2.3.dist-info → stackit_modelserving-0.4.0.dist-info}/WHEEL +1 -1
  29. stackit_modelserving-0.2.3.dist-info/RECORD +0 -32
  30. {stackit_modelserving-0.2.3.dist-info → stackit_modelserving-0.4.0.dist-info}/licenses/LICENSE.md +0 -0
  31. {stackit_modelserving-0.2.3.dist-info → stackit_modelserving-0.4.0.dist-info}/licenses/NOTICE.txt +0 -0
@@ -3,18 +3,17 @@
3
3
  # flake8: noqa
4
4
 
5
5
  """
6
- STACKIT Model Serving API
6
+ STACKIT Model Serving API
7
7
 
8
- This API provides endpoints for the model serving api
8
+ This API provides endpoints for the model serving api
9
9
 
10
- The version of the OpenAPI document: 1.0.0
11
- Contact: model-serving@mail.schwarz
12
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+ The version of the OpenAPI document: 1.0.0
11
+ Contact: stackit-model-serving@digits.schwarz
12
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
13
13
 
14
- Do not edit the class manually.
14
+ Do not edit the class manually.
15
15
  """ # noqa: E501
16
16
 
17
-
18
17
  __version__ = "1.0.0"
19
18
 
20
19
  # Define package exports
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from typing import Any, Dict, List, Optional, Tuple, Union
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  import datetime
@@ -37,7 +37,6 @@ from stackit.modelserving.exceptions import (
37
37
  ApiException,
38
38
  )
39
39
 
40
-
41
40
  RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
42
41
 
43
42
 
@@ -67,6 +66,7 @@ class ApiClient:
67
66
  "date": datetime.date,
68
67
  "datetime": datetime.datetime,
69
68
  "decimal": decimal.Decimal,
69
+ "UUID": uuid.UUID,
70
70
  "object": object,
71
71
  }
72
72
  _pool = None
@@ -266,7 +266,7 @@ class ApiClient:
266
266
  response_text = None
267
267
  return_data = None
268
268
  try:
269
- if response_type == "bytearray":
269
+ if response_type in ("bytearray", "bytes"):
270
270
  return_data = response_data.data
271
271
  elif response_type == "file":
272
272
  return_data = self.__deserialize_file(response_data)
@@ -327,25 +327,20 @@ class ApiClient:
327
327
  return obj.isoformat()
328
328
  elif isinstance(obj, decimal.Decimal):
329
329
  return str(obj)
330
-
331
330
  elif isinstance(obj, dict):
332
- obj_dict = obj
331
+ return {key: self.sanitize_for_serialization(val) for key, val in obj.items()}
332
+
333
+ # Convert model obj to dict except
334
+ # attributes `openapi_types`, `attribute_map`
335
+ # and attributes which value is not None.
336
+ # Convert attribute name to json key in
337
+ # model definition for request.
338
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
339
+ obj_dict = obj.to_dict()
333
340
  else:
334
- # Convert model obj to dict except
335
- # attributes `openapi_types`, `attribute_map`
336
- # and attributes which value is not None.
337
- # Convert attribute name to json key in
338
- # model definition for request.
339
- if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
340
- obj_dict = obj.to_dict()
341
- else:
342
- obj_dict = obj.__dict__
343
-
344
- if isinstance(obj_dict, list):
345
- # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501
346
- return self.sanitize_for_serialization(obj_dict)
341
+ obj_dict = obj.__dict__
347
342
 
348
- return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
343
+ return self.sanitize_for_serialization(obj_dict)
349
344
 
350
345
  def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
351
346
  """Deserializes response into an object.
@@ -418,6 +413,8 @@ class ApiClient:
418
413
  return self.__deserialize_datetime(data)
419
414
  elif klass is decimal.Decimal:
420
415
  return decimal.Decimal(data)
416
+ elif klass is uuid.UUID:
417
+ return uuid.UUID(data)
421
418
  elif issubclass(klass, Enum):
422
419
  return self.__deserialize_enum(data, klass)
423
420
  else:
@@ -6,7 +6,6 @@ from typing import Generic, Mapping, Optional, TypeVar
6
6
 
7
7
  from pydantic import BaseModel, Field, StrictBytes, StrictInt
8
8
 
9
-
10
9
  T = TypeVar("T")
11
10
 
12
11
 
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  import sys
@@ -19,7 +19,6 @@ from typing_extensions import NotRequired
19
19
 
20
20
  import os
21
21
 
22
-
23
22
  ServerVariablesT = Dict[str, str]
24
23
 
25
24
 
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from typing import Any, Optional
@@ -2,15 +2,15 @@
2
2
 
3
3
  # flake8: noqa
4
4
  """
5
- STACKIT Model Serving API
5
+ STACKIT Model Serving API
6
6
 
7
- This API provides endpoints for the model serving api
7
+ This API provides endpoints for the model serving api
8
8
 
9
- The version of the OpenAPI document: 1.0.0
10
- Contact: model-serving@mail.schwarz
11
- Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+ The version of the OpenAPI document: 1.0.0
10
+ Contact: stackit-model-serving@digits.schwarz
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
12
 
13
- Do not edit the class manually.
13
+ Do not edit the class manually.
14
14
  """ # noqa: E501
15
15
 
16
16
  # import models into model package
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
  from uuid import UUID
22
22
 
23
23
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
24
+ from pydantic_core import to_jsonable_python
24
25
  from typing_extensions import Annotated, Self
25
26
 
26
27
  from stackit.modelserving.models.sku import SKU
@@ -80,6 +81,9 @@ class ChatModelDetails(BaseModel):
80
81
  @field_validator("description")
81
82
  def description_validate_regular_expression(cls, value):
82
83
  """Validates the regular expression"""
84
+ if not isinstance(value, str):
85
+ value = str(value)
86
+
83
87
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
84
88
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
85
89
  return value
@@ -87,6 +91,9 @@ class ChatModelDetails(BaseModel):
87
91
  @field_validator("displayed_name")
88
92
  def displayed_name_validate_regular_expression(cls, value):
89
93
  """Validates the regular expression"""
94
+ if not isinstance(value, str):
95
+ value = str(value)
96
+
90
97
  if not re.match(r"^[0-9a-zA-Z\s_-]+$", value):
91
98
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s_-]+$/")
92
99
  return value
@@ -94,6 +101,9 @@ class ChatModelDetails(BaseModel):
94
101
  @field_validator("name")
95
102
  def name_validate_regular_expression(cls, value):
96
103
  """Validates the regular expression"""
104
+ if not isinstance(value, str):
105
+ value = str(value)
106
+
97
107
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
98
108
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
99
109
  return value
@@ -111,12 +121,16 @@ class ChatModelDetails(BaseModel):
111
121
  @field_validator("url")
112
122
  def url_validate_regular_expression(cls, value):
113
123
  """Validates the regular expression"""
124
+ if not isinstance(value, str):
125
+ value = str(value)
126
+
114
127
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
115
128
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
116
129
  return value
117
130
 
118
131
  model_config = ConfigDict(
119
- populate_by_name=True,
132
+ validate_by_name=True,
133
+ validate_by_alias=True,
120
134
  validate_assignment=True,
121
135
  protected_namespaces=(),
122
136
  )
@@ -127,8 +141,7 @@ class ChatModelDetails(BaseModel):
127
141
 
128
142
  def to_json(self) -> str:
129
143
  """Returns the JSON representation of the model using alias"""
130
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
131
- return json.dumps(self.to_dict())
144
+ return json.dumps(to_jsonable_python(self.to_dict()))
132
145
 
133
146
  @classmethod
134
147
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -20,6 +20,7 @@ import re # noqa: F401
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
 
22
22
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from pydantic_core import to_jsonable_python
23
24
  from typing_extensions import Annotated, Self
24
25
 
25
26
 
@@ -43,6 +44,9 @@ class CreateTokenPayload(BaseModel):
43
44
  if value is None:
44
45
  return value
45
46
 
47
+ if not isinstance(value, str):
48
+ value = str(value)
49
+
46
50
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
47
51
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
48
52
  return value
@@ -50,12 +54,16 @@ class CreateTokenPayload(BaseModel):
50
54
  @field_validator("name")
51
55
  def name_validate_regular_expression(cls, value):
52
56
  """Validates the regular expression"""
57
+ if not isinstance(value, str):
58
+ value = str(value)
59
+
53
60
  if not re.match(r"^[0-9a-zA-Z\s_-]+$", value):
54
61
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s_-]+$/")
55
62
  return value
56
63
 
57
64
  model_config = ConfigDict(
58
- populate_by_name=True,
65
+ validate_by_name=True,
66
+ validate_by_alias=True,
59
67
  validate_assignment=True,
60
68
  protected_namespaces=(),
61
69
  )
@@ -66,8 +74,7 @@ class CreateTokenPayload(BaseModel):
66
74
 
67
75
  def to_json(self) -> str:
68
76
  """Returns the JSON representation of the model using alias"""
69
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
70
- return json.dumps(self.to_dict())
77
+ return json.dumps(to_jsonable_python(self.to_dict()))
71
78
 
72
79
  @classmethod
73
80
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.modelserving.models.token_created import TokenCreated
@@ -34,7 +35,8 @@ class CreateTokenResponse(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["message", "token"]
35
36
 
36
37
  model_config = ConfigDict(
37
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
38
40
  validate_assignment=True,
39
41
  protected_namespaces=(),
40
42
  )
@@ -45,8 +47,7 @@ class CreateTokenResponse(BaseModel):
45
47
 
46
48
  def to_json(self) -> str:
47
49
  """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
51
 
51
52
  @classmethod
52
53
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
  from uuid import UUID
22
22
 
23
23
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
24
+ from pydantic_core import to_jsonable_python
24
25
  from typing_extensions import Annotated, Self
25
26
 
26
27
  from stackit.modelserving.models.sku import SKU
@@ -64,6 +65,9 @@ class EmbeddingModelDetails(BaseModel):
64
65
  @field_validator("description")
65
66
  def description_validate_regular_expression(cls, value):
66
67
  """Validates the regular expression"""
68
+ if not isinstance(value, str):
69
+ value = str(value)
70
+
67
71
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
68
72
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
69
73
  return value
@@ -71,6 +75,9 @@ class EmbeddingModelDetails(BaseModel):
71
75
  @field_validator("displayed_name")
72
76
  def displayed_name_validate_regular_expression(cls, value):
73
77
  """Validates the regular expression"""
78
+ if not isinstance(value, str):
79
+ value = str(value)
80
+
74
81
  if not re.match(r"^[0-9a-zA-Z\s_-]+$", value):
75
82
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s_-]+$/")
76
83
  return value
@@ -78,6 +85,9 @@ class EmbeddingModelDetails(BaseModel):
78
85
  @field_validator("name")
79
86
  def name_validate_regular_expression(cls, value):
80
87
  """Validates the regular expression"""
88
+ if not isinstance(value, str):
89
+ value = str(value)
90
+
81
91
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
82
92
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
83
93
  return value
@@ -85,12 +95,16 @@ class EmbeddingModelDetails(BaseModel):
85
95
  @field_validator("url")
86
96
  def url_validate_regular_expression(cls, value):
87
97
  """Validates the regular expression"""
98
+ if not isinstance(value, str):
99
+ value = str(value)
100
+
88
101
  if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
89
102
  raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
90
103
  return value
91
104
 
92
105
  model_config = ConfigDict(
93
- populate_by_name=True,
106
+ validate_by_name=True,
107
+ validate_by_alias=True,
94
108
  validate_assignment=True,
95
109
  protected_namespaces=(),
96
110
  )
@@ -101,8 +115,7 @@ class EmbeddingModelDetails(BaseModel):
101
115
 
102
116
  def to_json(self) -> str:
103
117
  """Returns the JSON representation of the model using alias"""
104
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
105
- return json.dumps(self.to_dict())
118
+ return json.dumps(to_jsonable_python(self.to_dict()))
106
119
 
107
120
  @classmethod
108
121
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -32,7 +33,8 @@ class ErrorMessageResponse(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["error", "message"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -43,8 +45,7 @@ class ErrorMessageResponse(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.modelserving.models.chat_model_details import ChatModelDetails
@@ -34,7 +35,8 @@ class GetChatModelResponse(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["message", "model"]
35
36
 
36
37
  model_config = ConfigDict(
37
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
38
40
  validate_assignment=True,
39
41
  protected_namespaces=(),
40
42
  )
@@ -45,8 +47,7 @@ class GetChatModelResponse(BaseModel):
45
47
 
46
48
  def to_json(self) -> str:
47
49
  """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
51
 
51
52
  @classmethod
52
53
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- STACKIT Model Serving API
4
+ STACKIT Model Serving API
5
5
 
6
- This API provides endpoints for the model serving api
6
+ This API provides endpoints for the model serving api
7
7
 
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: model-serving@mail.schwarz
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-serving@digits.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
- Do not edit the class manually.
12
+ Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.modelserving.models.embedding_model_details import EmbeddingModelDetails
@@ -34,7 +35,8 @@ class GetEmbeddingsModelResp(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["message", "model"]
35
36
 
36
37
  model_config = ConfigDict(
37
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
38
40
  validate_assignment=True,
39
41
  protected_namespaces=(),
40
42
  )
@@ -45,8 +47,7 @@ class GetEmbeddingsModelResp(BaseModel):
45
47
 
46
48
  def to_json(self) -> str:
47
49
  """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
51
 
51
52
  @classmethod
52
53
  def from_json(cls, json_str: str) -> Optional[Self]: