stackit-modelserving 0.2.2__tar.gz → 0.2.3__tar.gz

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 (33) hide show
  1. stackit_modelserving-0.2.3/.gitignore +267 -0
  2. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/PKG-INFO +10 -11
  3. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/pyproject.toml +49 -37
  4. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/api/default_api.py +61 -60
  5. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/api_client.py +22 -9
  6. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/exceptions.py +1 -1
  7. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/__init__.py +0 -1
  8. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/chat_model_details.py +5 -4
  9. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/embedding_model_details.py +5 -4
  10. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/list_models_response.py +3 -3
  11. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/list_token_resp.py +3 -3
  12. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/model.py +5 -4
  13. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/token.py +2 -1
  14. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/token_created.py +2 -1
  15. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/rest.py +19 -3
  16. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/LICENSE.md +0 -0
  17. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/NOTICE.txt +0 -0
  18. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/README.md +0 -0
  19. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/__init__.py +0 -0
  20. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/api/__init__.py +0 -0
  21. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/api_response.py +0 -0
  22. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/configuration.py +0 -0
  23. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/create_token_payload.py +0 -0
  24. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/create_token_response.py +0 -0
  25. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/error_message_response.py +0 -0
  26. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/get_chat_model_response.py +0 -0
  27. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/get_embeddings_model_resp.py +0 -0
  28. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/get_token_response.py +0 -0
  29. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/message_response.py +0 -0
  30. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/partial_update_token_payload.py +0 -0
  31. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/sku.py +0 -0
  32. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/models/update_token_response.py +0 -0
  33. {stackit_modelserving-0.2.2 → stackit_modelserving-0.2.3}/src/stackit/modelserving/py.typed +0 -0
@@ -0,0 +1,267 @@
1
+ ### VisualStudioCode template
2
+ .vscode/*
3
+ !.vscode/settings.json
4
+ !.vscode/tasks.json
5
+ !.vscode/launch.json
6
+ !.vscode/extensions.json
7
+ !.vscode/*.code-snippets
8
+
9
+ # Local History for Visual Studio Code
10
+ .history/
11
+
12
+ # Built Visual Studio Code Extensions
13
+ *.vsix
14
+
15
+ ### JetBrains template
16
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
17
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
18
+
19
+ # User-specific stuff
20
+ .idea/**/workspace.xml
21
+ .idea/**/tasks.xml
22
+ .idea/**/usage.statistics.xml
23
+ .idea/**/dictionaries
24
+ .idea/**/shelf
25
+
26
+ # AWS User-specific
27
+ .idea/**/aws.xml
28
+
29
+ # Generated files
30
+ .idea/**/contentModel.xml
31
+
32
+ # Sensitive or high-churn files
33
+ .idea/**/dataSources/
34
+ .idea/**/dataSources.ids
35
+ .idea/**/dataSources.local.xml
36
+ .idea/**/sqlDataSources.xml
37
+ .idea/**/dynamic.xml
38
+ .idea/**/uiDesigner.xml
39
+ .idea/**/dbnavigator.xml
40
+
41
+ # Gradle
42
+ .idea/**/gradle.xml
43
+ .idea/**/libraries
44
+
45
+ # Gradle and Maven with auto-import
46
+ # When using Gradle or Maven with auto-import, you should exclude module files,
47
+ # since they will be recreated, and may cause churn. Uncomment if using
48
+ # auto-import.
49
+ # .idea/artifacts
50
+ # .idea/compiler.xml
51
+ # .idea/jarRepositories.xml
52
+ # .idea/modules.xml
53
+ # .idea/*.iml
54
+ # .idea/modules
55
+ # *.iml
56
+ # *.ipr
57
+
58
+ # CMake
59
+ cmake-build-*/
60
+
61
+ # Mongo Explorer plugin
62
+ .idea/**/mongoSettings.xml
63
+
64
+ # File-based project format
65
+ *.iws
66
+
67
+ # IntelliJ
68
+ out/
69
+
70
+ # mpeltonen/sbt-idea plugin
71
+ .idea_modules/
72
+
73
+ # JIRA plugin
74
+ atlassian-ide-plugin.xml
75
+
76
+ # Cursive Clojure plugin
77
+ .idea/replstate.xml
78
+
79
+ # SonarLint plugin
80
+ .idea/sonarlint/
81
+
82
+ # Crashlytics plugin (for Android Studio and IntelliJ)
83
+ com_crashlytics_export_strings.xml
84
+ crashlytics.properties
85
+ crashlytics-build.properties
86
+ fabric.properties
87
+
88
+ # Editor-based Rest Client
89
+ .idea/httpRequests
90
+
91
+ # Android studio 3.1+ serialized cache file
92
+ .idea/caches/build_file_checksums.ser
93
+
94
+ ### VirtualEnv template
95
+ # Virtualenv
96
+ # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
97
+ .Python
98
+ [Bb]in
99
+ [Ii]nclude
100
+ [Ll]ib
101
+ [Ll]ib64
102
+ [Ll]ocal
103
+ [Ss]cripts
104
+ pyvenv.cfg
105
+ .venv
106
+ pip-selfcheck.json
107
+
108
+ ### Python template
109
+ # Byte-compiled / optimized / DLL files
110
+ __pycache__/
111
+ *.py[cod]
112
+ *$py.class
113
+
114
+ # C extensions
115
+ *.so
116
+
117
+ # Distribution / packaging
118
+ build/
119
+ develop-eggs/
120
+ dist/
121
+ downloads/
122
+ eggs/
123
+ .eggs/
124
+ lib/
125
+ lib64/
126
+ parts/
127
+ sdist/
128
+ var/
129
+ wheels/
130
+ share/python-wheels/
131
+ *.egg-info/
132
+ .installed.cfg
133
+ *.egg
134
+ MANIFEST
135
+
136
+ # PyInstaller
137
+ # Usually these files are written by a python script from a template
138
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
139
+ *.manifest
140
+ *.spec
141
+
142
+ # Installer logs
143
+ pip-log.txt
144
+ pip-delete-this-directory.txt
145
+
146
+ # Unit test / coverage reports
147
+ htmlcov/
148
+ .tox/
149
+ .nox/
150
+ .coverage
151
+ .coverage.*
152
+ .cache
153
+ nosetests.xml
154
+ coverage.xml
155
+ *.cover
156
+ *.py,cover
157
+ .hypothesis/
158
+ .pytest_cache/
159
+ cover/
160
+
161
+ # Translations
162
+ *.mo
163
+ *.pot
164
+
165
+ # Django stuff:
166
+ *.log
167
+ local_settings.py
168
+ db.sqlite3
169
+ db.sqlite3-journal
170
+
171
+ # Flask stuff:
172
+ instance/
173
+ .webassets-cache
174
+
175
+ # Scrapy stuff:
176
+ .scrapy
177
+
178
+ # Sphinx documentation
179
+ docs/_build/
180
+
181
+ # PyBuilder
182
+ .pybuilder/
183
+ target/
184
+
185
+ # Jupyter Notebook
186
+ .ipynb_checkpoints
187
+
188
+ # IPython
189
+ profile_default/
190
+ ipython_config.py
191
+
192
+ # pyenv
193
+ # For a library or package, you might want to ignore these files since the code is
194
+ # intended to run in multiple environments; otherwise, check them in:
195
+ # .python-version
196
+
197
+ # pipenv
198
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
199
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
200
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
201
+ # install all needed dependencies.
202
+ #Pipfile.lock
203
+
204
+ # poetry
205
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
206
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
207
+ # commonly ignored for libraries.
208
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
209
+ #poetry.lock
210
+
211
+ # pdm
212
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
213
+ #pdm.lock
214
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
215
+ # in version control.
216
+ # https://pdm.fming.dev/#use-with-ide
217
+ .pdm.toml
218
+
219
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
220
+ __pypackages__/
221
+
222
+ # Celery stuff
223
+ celerybeat-schedule
224
+ celerybeat.pid
225
+
226
+ # SageMath parsed files
227
+ *.sage.py
228
+
229
+ # Environments
230
+ .env
231
+ env/
232
+ venv/
233
+ ENV/
234
+ env.bak/
235
+ venv.bak/
236
+
237
+ # Spyder project settings
238
+ .spyderproject
239
+ .spyproject
240
+
241
+ # Rope project settings
242
+ .ropeproject
243
+
244
+ # mkdocs documentation
245
+ /site
246
+
247
+ # mypy
248
+ .mypy_cache/
249
+ .dmypy.json
250
+ dmypy.json
251
+
252
+ # Pyre type checker
253
+ .pyre/
254
+
255
+ # pytype static type analyzer
256
+ .pytype/
257
+
258
+ # Cython debug symbols
259
+ cython_debug/
260
+
261
+ # PyCharm
262
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
263
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
264
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
265
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
266
+ .idea/
267
+
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-modelserving
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: STACKIT Model Serving API
5
+ Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
6
+ Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
7
+ Author-email: STACKIT Developer Tools <developer-tools@stackit.cloud>
5
8
  License-File: LICENSE.md
6
9
  License-File: NOTICE.txt
7
- Author: STACKIT Developer Tools
8
- Author-email: developer-tools@stackit.cloud
9
- Requires-Python: >=3.9,<4.0
10
10
  Classifier: License :: OSI Approved :: Apache Software License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
@@ -16,12 +16,11 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: 3.14
19
- Requires-Dist: pydantic (>=2.9.2)
20
- Requires-Dist: python-dateutil (>=2.9.0.post0)
21
- Requires-Dist: requests (>=2.32.3)
22
- Requires-Dist: stackit-core (>=0.0.1a)
23
- Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
24
- Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
19
+ Requires-Python: <4.0,>=3.9
20
+ Requires-Dist: pydantic>=2.9.2
21
+ Requires-Dist: python-dateutil>=2.9.0.post0
22
+ Requires-Dist: requests>=2.32.3
23
+ Requires-Dist: stackit-core>=0.0.1a
25
24
  Description-Content-Type: text/markdown
26
25
 
27
26
  # stackit.modelserving
@@ -46,4 +45,4 @@ import stackit.modelserving
46
45
 
47
46
  ## Getting Started
48
47
 
49
- [Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
48
+ [Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
@@ -1,55 +1,67 @@
1
1
  [project]
2
2
  name = "stackit-modelserving"
3
-
4
- [tool.poetry]
5
- name = "stackit-modelserving"
6
- version = "v0.2.2"
7
- authors = [
8
- "STACKIT Developer Tools <developer-tools@stackit.cloud>",
9
- ]
3
+ version = "v0.2.3"
10
4
  description = "STACKIT Model Serving API"
5
+ authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
6
+ requires-python = ">=3.9,<4.0"
11
7
  readme = "README.md"
12
- #license = "NoLicense"
13
8
  classifiers = [
14
9
  "Programming Language :: Python :: 3",
15
10
  "License :: OSI Approved :: Apache Software License",
16
11
  "Operating System :: OS Independent",
12
+ "Programming Language :: Python :: 3.9",
13
+ "Programming Language :: Python :: 3.10",
14
+ "Programming Language :: Python :: 3.11",
15
+ "Programming Language :: Python :: 3.12",
16
+ "Programming Language :: Python :: 3.13",
17
+ "Programming Language :: Python :: 3.14",
17
18
  ]
18
- packages = [
19
- { include = "stackit", from="src" }
19
+ dependencies = [
20
+ "stackit-core>=0.0.1a",
21
+ "requests>=2.32.3",
22
+ "pydantic>=2.9.2",
23
+ "python-dateutil>=2.9.0.post0",
20
24
  ]
21
25
 
22
- [tool.poetry.dependencies]
23
- python = ">=3.9,<4.0"
24
- stackit-core = ">=0.0.1a"
25
- requests = ">=2.32.3"
26
- pydantic = ">=2.9.2"
27
- python-dateutil = ">=2.9.0.post0"
28
-
29
- [tool.poetry.group.dev.dependencies]
30
- black = ">=24.8.0"
31
- pytest = ">=8.3.3"
32
- flake8 = [
33
- { version= ">=5.0.3", python="<3.12"},
34
- { version= ">=6.0.1", python=">=3.12"}
35
- ]
36
- flake8-black = ">=0.3.6"
37
- flake8-pyproject = ">=1.2.3"
38
- autoimport = ">=1.6.1"
39
- flake8-eol = ">=0.0.8"
40
- flake8-eradicate = ">=1.5.0"
41
- flake8-bandit = ">=4.1.1"
42
- flake8-bugbear = ">=23.1.14"
43
- flake8-quotes = ">=3.4.0"
44
- isort = ">=5.13.2"
45
-
46
26
  [project.urls]
47
27
  Homepage = "https://github.com/stackitcloud/stackit-sdk-python"
48
28
  Issues = "https://github.com/stackitcloud/stackit-sdk-python/issues"
49
29
 
30
+ [dependency-groups]
31
+ dev = [
32
+ "black>=24.8.0",
33
+ "pytest>=8.3.3",
34
+ "flake8>=5.0.3 ; python_full_version < '3.12'",
35
+ "flake8>=6.0.1 ; python_full_version >= '3.12'",
36
+ "flake8-black>=0.3.6",
37
+ "flake8-pyproject>=1.2.3",
38
+ "autoimport>=1.6.1",
39
+ "flake8-eol>=0.0.8",
40
+ "flake8-eradicate>=1.5.0",
41
+ "flake8-bandit>=4.1.1",
42
+ "flake8-bugbear>=23.1.14",
43
+ "flake8-quotes>=3.4.0",
44
+ "isort>=5.13.2",
45
+ ]
46
+
47
+ [tool.uv]
48
+ default-groups = "all"
49
+
50
+ [tool.uv.sources]
51
+ stackit-core = { path = "../../core" }
52
+
53
+ [tool.hatch.build.targets.sdist]
54
+ include = ["src/stackit"]
55
+
56
+ [tool.hatch.build.targets.wheel]
57
+ include = ["src/stackit"]
58
+
59
+ [tool.hatch.build.targets.wheel.sources]
60
+ "src/stackit" = "stackit"
61
+
50
62
  [build-system]
51
- requires = ["setuptools", "poetry-core"]
52
- build-backend = "poetry.core.masonry.api"
63
+ requires = ["hatchling"]
64
+ build-backend = "hatchling.build"
53
65
 
54
66
  [tool.pytest.ini_options]
55
67
  pythonpath = [
@@ -105,4 +117,4 @@ per-file-ignores = """
105
117
  # E501: long descriptions/string values might lead to lines that are too long
106
118
  # B028: stacklevel for deprecation warning is irrelevant
107
119
  ./src/stackit/*/api/default_api.py: F841,B028,E501
108
- """
120
+ """
@@ -13,6 +13,7 @@
13
13
  """ # noqa: E501
14
14
 
15
15
  from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from uuid import UUID
16
17
 
17
18
  from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
19
  from stackit.core.configuration import Configuration
@@ -52,7 +53,7 @@ class DefaultApi:
52
53
  def create_token(
53
54
  self,
54
55
  region_id: Annotated[StrictStr, Field(description="region name")],
55
- project_id: Annotated[StrictStr, Field(description="portal project id")],
56
+ project_id: Annotated[UUID, Field(description="portal project id")],
56
57
  create_token_payload: Optional[CreateTokenPayload] = None,
57
58
  _request_timeout: Union[
58
59
  None,
@@ -71,7 +72,7 @@ class DefaultApi:
71
72
  :param region_id: region name (required)
72
73
  :type region_id: str
73
74
  :param project_id: portal project id (required)
74
- :type project_id: str
75
+ :type project_id: UUID
75
76
  :param create_token_payload:
76
77
  :type create_token_payload: CreateTokenPayload
77
78
  :param _request_timeout: timeout setting for this request. If one
@@ -124,7 +125,7 @@ class DefaultApi:
124
125
  def create_token_with_http_info(
125
126
  self,
126
127
  region_id: Annotated[StrictStr, Field(description="region name")],
127
- project_id: Annotated[StrictStr, Field(description="portal project id")],
128
+ project_id: Annotated[UUID, Field(description="portal project id")],
128
129
  create_token_payload: Optional[CreateTokenPayload] = None,
129
130
  _request_timeout: Union[
130
131
  None,
@@ -143,7 +144,7 @@ class DefaultApi:
143
144
  :param region_id: region name (required)
144
145
  :type region_id: str
145
146
  :param project_id: portal project id (required)
146
- :type project_id: str
147
+ :type project_id: UUID
147
148
  :param create_token_payload:
148
149
  :type create_token_payload: CreateTokenPayload
149
150
  :param _request_timeout: timeout setting for this request. If one
@@ -196,7 +197,7 @@ class DefaultApi:
196
197
  def create_token_without_preload_content(
197
198
  self,
198
199
  region_id: Annotated[StrictStr, Field(description="region name")],
199
- project_id: Annotated[StrictStr, Field(description="portal project id")],
200
+ project_id: Annotated[UUID, Field(description="portal project id")],
200
201
  create_token_payload: Optional[CreateTokenPayload] = None,
201
202
  _request_timeout: Union[
202
203
  None,
@@ -215,7 +216,7 @@ class DefaultApi:
215
216
  :param region_id: region name (required)
216
217
  :type region_id: str
217
218
  :param project_id: portal project id (required)
218
- :type project_id: str
219
+ :type project_id: UUID
219
220
  :param create_token_payload:
220
221
  :type create_token_payload: CreateTokenPayload
221
222
  :param _request_timeout: timeout setting for this request. If one
@@ -328,8 +329,8 @@ class DefaultApi:
328
329
  def delete_token(
329
330
  self,
330
331
  region_id: Annotated[StrictStr, Field(description="region name")],
331
- project_id: Annotated[StrictStr, Field(description="portal project id")],
332
- t_id: Annotated[StrictStr, Field(description="token id")],
332
+ project_id: Annotated[UUID, Field(description="portal project id")],
333
+ t_id: Annotated[UUID, Field(description="token id")],
333
334
  _request_timeout: Union[
334
335
  None,
335
336
  Annotated[StrictFloat, Field(gt=0)],
@@ -347,9 +348,9 @@ class DefaultApi:
347
348
  :param region_id: region name (required)
348
349
  :type region_id: str
349
350
  :param project_id: portal project id (required)
350
- :type project_id: str
351
+ :type project_id: UUID
351
352
  :param t_id: token id (required)
352
- :type t_id: str
353
+ :type t_id: UUID
353
354
  :param _request_timeout: timeout setting for this request. If one
354
355
  number provided, it will be total request
355
356
  timeout. It can also be a pair (tuple) of
@@ -400,8 +401,8 @@ class DefaultApi:
400
401
  def delete_token_with_http_info(
401
402
  self,
402
403
  region_id: Annotated[StrictStr, Field(description="region name")],
403
- project_id: Annotated[StrictStr, Field(description="portal project id")],
404
- t_id: Annotated[StrictStr, Field(description="token id")],
404
+ project_id: Annotated[UUID, Field(description="portal project id")],
405
+ t_id: Annotated[UUID, Field(description="token id")],
405
406
  _request_timeout: Union[
406
407
  None,
407
408
  Annotated[StrictFloat, Field(gt=0)],
@@ -419,9 +420,9 @@ class DefaultApi:
419
420
  :param region_id: region name (required)
420
421
  :type region_id: str
421
422
  :param project_id: portal project id (required)
422
- :type project_id: str
423
+ :type project_id: UUID
423
424
  :param t_id: token id (required)
424
- :type t_id: str
425
+ :type t_id: UUID
425
426
  :param _request_timeout: timeout setting for this request. If one
426
427
  number provided, it will be total request
427
428
  timeout. It can also be a pair (tuple) of
@@ -472,8 +473,8 @@ class DefaultApi:
472
473
  def delete_token_without_preload_content(
473
474
  self,
474
475
  region_id: Annotated[StrictStr, Field(description="region name")],
475
- project_id: Annotated[StrictStr, Field(description="portal project id")],
476
- t_id: Annotated[StrictStr, Field(description="token id")],
476
+ project_id: Annotated[UUID, Field(description="portal project id")],
477
+ t_id: Annotated[UUID, Field(description="token id")],
477
478
  _request_timeout: Union[
478
479
  None,
479
480
  Annotated[StrictFloat, Field(gt=0)],
@@ -491,9 +492,9 @@ class DefaultApi:
491
492
  :param region_id: region name (required)
492
493
  :type region_id: str
493
494
  :param project_id: portal project id (required)
494
- :type project_id: str
495
+ :type project_id: UUID
495
496
  :param t_id: token id (required)
496
- :type t_id: str
497
+ :type t_id: UUID
497
498
  :param _request_timeout: timeout setting for this request. If one
498
499
  number provided, it will be total request
499
500
  timeout. It can also be a pair (tuple) of
@@ -596,7 +597,7 @@ class DefaultApi:
596
597
  def get_chat_model(
597
598
  self,
598
599
  region_id: Annotated[StrictStr, Field(description="region name")],
599
- model_id: Annotated[StrictStr, Field(description="model id")],
600
+ model_id: Annotated[UUID, Field(description="model id")],
600
601
  _request_timeout: Union[
601
602
  None,
602
603
  Annotated[StrictFloat, Field(gt=0)],
@@ -614,7 +615,7 @@ class DefaultApi:
614
615
  :param region_id: region name (required)
615
616
  :type region_id: str
616
617
  :param model_id: model id (required)
617
- :type model_id: str
618
+ :type model_id: UUID
618
619
  :param _request_timeout: timeout setting for this request. If one
619
620
  number provided, it will be total request
620
621
  timeout. It can also be a pair (tuple) of
@@ -663,7 +664,7 @@ class DefaultApi:
663
664
  def get_chat_model_with_http_info(
664
665
  self,
665
666
  region_id: Annotated[StrictStr, Field(description="region name")],
666
- model_id: Annotated[StrictStr, Field(description="model id")],
667
+ model_id: Annotated[UUID, Field(description="model id")],
667
668
  _request_timeout: Union[
668
669
  None,
669
670
  Annotated[StrictFloat, Field(gt=0)],
@@ -681,7 +682,7 @@ class DefaultApi:
681
682
  :param region_id: region name (required)
682
683
  :type region_id: str
683
684
  :param model_id: model id (required)
684
- :type model_id: str
685
+ :type model_id: UUID
685
686
  :param _request_timeout: timeout setting for this request. If one
686
687
  number provided, it will be total request
687
688
  timeout. It can also be a pair (tuple) of
@@ -730,7 +731,7 @@ class DefaultApi:
730
731
  def get_chat_model_without_preload_content(
731
732
  self,
732
733
  region_id: Annotated[StrictStr, Field(description="region name")],
733
- model_id: Annotated[StrictStr, Field(description="model id")],
734
+ model_id: Annotated[UUID, Field(description="model id")],
734
735
  _request_timeout: Union[
735
736
  None,
736
737
  Annotated[StrictFloat, Field(gt=0)],
@@ -748,7 +749,7 @@ class DefaultApi:
748
749
  :param region_id: region name (required)
749
750
  :type region_id: str
750
751
  :param model_id: model id (required)
751
- :type model_id: str
752
+ :type model_id: UUID
752
753
  :param _request_timeout: timeout setting for this request. If one
753
754
  number provided, it will be total request
754
755
  timeout. It can also be a pair (tuple) of
@@ -846,7 +847,7 @@ class DefaultApi:
846
847
  def get_embedding_model(
847
848
  self,
848
849
  region_id: Annotated[StrictStr, Field(description="region name")],
849
- model_id: Annotated[StrictStr, Field(description="model id")],
850
+ model_id: Annotated[UUID, Field(description="model id")],
850
851
  _request_timeout: Union[
851
852
  None,
852
853
  Annotated[StrictFloat, Field(gt=0)],
@@ -864,7 +865,7 @@ class DefaultApi:
864
865
  :param region_id: region name (required)
865
866
  :type region_id: str
866
867
  :param model_id: model id (required)
867
- :type model_id: str
868
+ :type model_id: UUID
868
869
  :param _request_timeout: timeout setting for this request. If one
869
870
  number provided, it will be total request
870
871
  timeout. It can also be a pair (tuple) of
@@ -913,7 +914,7 @@ class DefaultApi:
913
914
  def get_embedding_model_with_http_info(
914
915
  self,
915
916
  region_id: Annotated[StrictStr, Field(description="region name")],
916
- model_id: Annotated[StrictStr, Field(description="model id")],
917
+ model_id: Annotated[UUID, Field(description="model id")],
917
918
  _request_timeout: Union[
918
919
  None,
919
920
  Annotated[StrictFloat, Field(gt=0)],
@@ -931,7 +932,7 @@ class DefaultApi:
931
932
  :param region_id: region name (required)
932
933
  :type region_id: str
933
934
  :param model_id: model id (required)
934
- :type model_id: str
935
+ :type model_id: UUID
935
936
  :param _request_timeout: timeout setting for this request. If one
936
937
  number provided, it will be total request
937
938
  timeout. It can also be a pair (tuple) of
@@ -980,7 +981,7 @@ class DefaultApi:
980
981
  def get_embedding_model_without_preload_content(
981
982
  self,
982
983
  region_id: Annotated[StrictStr, Field(description="region name")],
983
- model_id: Annotated[StrictStr, Field(description="model id")],
984
+ model_id: Annotated[UUID, Field(description="model id")],
984
985
  _request_timeout: Union[
985
986
  None,
986
987
  Annotated[StrictFloat, Field(gt=0)],
@@ -998,7 +999,7 @@ class DefaultApi:
998
999
  :param region_id: region name (required)
999
1000
  :type region_id: str
1000
1001
  :param model_id: model id (required)
1001
- :type model_id: str
1002
+ :type model_id: UUID
1002
1003
  :param _request_timeout: timeout setting for this request. If one
1003
1004
  number provided, it will be total request
1004
1005
  timeout. It can also be a pair (tuple) of
@@ -1096,8 +1097,8 @@ class DefaultApi:
1096
1097
  def get_token(
1097
1098
  self,
1098
1099
  region_id: Annotated[StrictStr, Field(description="region name")],
1099
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1100
- t_id: Annotated[StrictStr, Field(description="token id")],
1100
+ project_id: Annotated[UUID, Field(description="portal project id")],
1101
+ t_id: Annotated[UUID, Field(description="token id")],
1101
1102
  _request_timeout: Union[
1102
1103
  None,
1103
1104
  Annotated[StrictFloat, Field(gt=0)],
@@ -1115,9 +1116,9 @@ class DefaultApi:
1115
1116
  :param region_id: region name (required)
1116
1117
  :type region_id: str
1117
1118
  :param project_id: portal project id (required)
1118
- :type project_id: str
1119
+ :type project_id: UUID
1119
1120
  :param t_id: token id (required)
1120
- :type t_id: str
1121
+ :type t_id: UUID
1121
1122
  :param _request_timeout: timeout setting for this request. If one
1122
1123
  number provided, it will be total request
1123
1124
  timeout. It can also be a pair (tuple) of
@@ -1168,8 +1169,8 @@ class DefaultApi:
1168
1169
  def get_token_with_http_info(
1169
1170
  self,
1170
1171
  region_id: Annotated[StrictStr, Field(description="region name")],
1171
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1172
- t_id: Annotated[StrictStr, Field(description="token id")],
1172
+ project_id: Annotated[UUID, Field(description="portal project id")],
1173
+ t_id: Annotated[UUID, Field(description="token id")],
1173
1174
  _request_timeout: Union[
1174
1175
  None,
1175
1176
  Annotated[StrictFloat, Field(gt=0)],
@@ -1187,9 +1188,9 @@ class DefaultApi:
1187
1188
  :param region_id: region name (required)
1188
1189
  :type region_id: str
1189
1190
  :param project_id: portal project id (required)
1190
- :type project_id: str
1191
+ :type project_id: UUID
1191
1192
  :param t_id: token id (required)
1192
- :type t_id: str
1193
+ :type t_id: UUID
1193
1194
  :param _request_timeout: timeout setting for this request. If one
1194
1195
  number provided, it will be total request
1195
1196
  timeout. It can also be a pair (tuple) of
@@ -1240,8 +1241,8 @@ class DefaultApi:
1240
1241
  def get_token_without_preload_content(
1241
1242
  self,
1242
1243
  region_id: Annotated[StrictStr, Field(description="region name")],
1243
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1244
- t_id: Annotated[StrictStr, Field(description="token id")],
1244
+ project_id: Annotated[UUID, Field(description="portal project id")],
1245
+ t_id: Annotated[UUID, Field(description="token id")],
1245
1246
  _request_timeout: Union[
1246
1247
  None,
1247
1248
  Annotated[StrictFloat, Field(gt=0)],
@@ -1259,9 +1260,9 @@ class DefaultApi:
1259
1260
  :param region_id: region name (required)
1260
1261
  :type region_id: str
1261
1262
  :param project_id: portal project id (required)
1262
- :type project_id: str
1263
+ :type project_id: UUID
1263
1264
  :param t_id: token id (required)
1264
- :type t_id: str
1265
+ :type t_id: UUID
1265
1266
  :param _request_timeout: timeout setting for this request. If one
1266
1267
  number provided, it will be total request
1267
1268
  timeout. It can also be a pair (tuple) of
@@ -1599,7 +1600,7 @@ class DefaultApi:
1599
1600
  def list_tokens(
1600
1601
  self,
1601
1602
  region_id: Annotated[StrictStr, Field(description="region name")],
1602
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1603
+ project_id: Annotated[UUID, Field(description="portal project id")],
1603
1604
  _request_timeout: Union[
1604
1605
  None,
1605
1606
  Annotated[StrictFloat, Field(gt=0)],
@@ -1617,7 +1618,7 @@ class DefaultApi:
1617
1618
  :param region_id: region name (required)
1618
1619
  :type region_id: str
1619
1620
  :param project_id: portal project id (required)
1620
- :type project_id: str
1621
+ :type project_id: UUID
1621
1622
  :param _request_timeout: timeout setting for this request. If one
1622
1623
  number provided, it will be total request
1623
1624
  timeout. It can also be a pair (tuple) of
@@ -1666,7 +1667,7 @@ class DefaultApi:
1666
1667
  def list_tokens_with_http_info(
1667
1668
  self,
1668
1669
  region_id: Annotated[StrictStr, Field(description="region name")],
1669
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1670
+ project_id: Annotated[UUID, Field(description="portal project id")],
1670
1671
  _request_timeout: Union[
1671
1672
  None,
1672
1673
  Annotated[StrictFloat, Field(gt=0)],
@@ -1684,7 +1685,7 @@ class DefaultApi:
1684
1685
  :param region_id: region name (required)
1685
1686
  :type region_id: str
1686
1687
  :param project_id: portal project id (required)
1687
- :type project_id: str
1688
+ :type project_id: UUID
1688
1689
  :param _request_timeout: timeout setting for this request. If one
1689
1690
  number provided, it will be total request
1690
1691
  timeout. It can also be a pair (tuple) of
@@ -1733,7 +1734,7 @@ class DefaultApi:
1733
1734
  def list_tokens_without_preload_content(
1734
1735
  self,
1735
1736
  region_id: Annotated[StrictStr, Field(description="region name")],
1736
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1737
+ project_id: Annotated[UUID, Field(description="portal project id")],
1737
1738
  _request_timeout: Union[
1738
1739
  None,
1739
1740
  Annotated[StrictFloat, Field(gt=0)],
@@ -1751,7 +1752,7 @@ class DefaultApi:
1751
1752
  :param region_id: region name (required)
1752
1753
  :type region_id: str
1753
1754
  :param project_id: portal project id (required)
1754
- :type project_id: str
1755
+ :type project_id: UUID
1755
1756
  :param _request_timeout: timeout setting for this request. If one
1756
1757
  number provided, it will be total request
1757
1758
  timeout. It can also be a pair (tuple) of
@@ -1849,8 +1850,8 @@ class DefaultApi:
1849
1850
  def partial_update_token(
1850
1851
  self,
1851
1852
  region_id: Annotated[StrictStr, Field(description="region name")],
1852
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1853
- t_id: Annotated[StrictStr, Field(description="token id")],
1853
+ project_id: Annotated[UUID, Field(description="portal project id")],
1854
+ t_id: Annotated[UUID, Field(description="token id")],
1854
1855
  partial_update_token_payload: Optional[PartialUpdateTokenPayload] = None,
1855
1856
  _request_timeout: Union[
1856
1857
  None,
@@ -1869,9 +1870,9 @@ class DefaultApi:
1869
1870
  :param region_id: region name (required)
1870
1871
  :type region_id: str
1871
1872
  :param project_id: portal project id (required)
1872
- :type project_id: str
1873
+ :type project_id: UUID
1873
1874
  :param t_id: token id (required)
1874
- :type t_id: str
1875
+ :type t_id: UUID
1875
1876
  :param partial_update_token_payload:
1876
1877
  :type partial_update_token_payload: PartialUpdateTokenPayload
1877
1878
  :param _request_timeout: timeout setting for this request. If one
@@ -1925,8 +1926,8 @@ class DefaultApi:
1925
1926
  def partial_update_token_with_http_info(
1926
1927
  self,
1927
1928
  region_id: Annotated[StrictStr, Field(description="region name")],
1928
- project_id: Annotated[StrictStr, Field(description="portal project id")],
1929
- t_id: Annotated[StrictStr, Field(description="token id")],
1929
+ project_id: Annotated[UUID, Field(description="portal project id")],
1930
+ t_id: Annotated[UUID, Field(description="token id")],
1930
1931
  partial_update_token_payload: Optional[PartialUpdateTokenPayload] = None,
1931
1932
  _request_timeout: Union[
1932
1933
  None,
@@ -1945,9 +1946,9 @@ class DefaultApi:
1945
1946
  :param region_id: region name (required)
1946
1947
  :type region_id: str
1947
1948
  :param project_id: portal project id (required)
1948
- :type project_id: str
1949
+ :type project_id: UUID
1949
1950
  :param t_id: token id (required)
1950
- :type t_id: str
1951
+ :type t_id: UUID
1951
1952
  :param partial_update_token_payload:
1952
1953
  :type partial_update_token_payload: PartialUpdateTokenPayload
1953
1954
  :param _request_timeout: timeout setting for this request. If one
@@ -2001,8 +2002,8 @@ class DefaultApi:
2001
2002
  def partial_update_token_without_preload_content(
2002
2003
  self,
2003
2004
  region_id: Annotated[StrictStr, Field(description="region name")],
2004
- project_id: Annotated[StrictStr, Field(description="portal project id")],
2005
- t_id: Annotated[StrictStr, Field(description="token id")],
2005
+ project_id: Annotated[UUID, Field(description="portal project id")],
2006
+ t_id: Annotated[UUID, Field(description="token id")],
2006
2007
  partial_update_token_payload: Optional[PartialUpdateTokenPayload] = None,
2007
2008
  _request_timeout: Union[
2008
2009
  None,
@@ -2021,9 +2022,9 @@ class DefaultApi:
2021
2022
  :param region_id: region name (required)
2022
2023
  :type region_id: str
2023
2024
  :param project_id: portal project id (required)
2024
- :type project_id: str
2025
+ :type project_id: UUID
2025
2026
  :param t_id: token id (required)
2026
- :type t_id: str
2027
+ :type t_id: UUID
2027
2028
  :param partial_update_token_payload:
2028
2029
  :type partial_update_token_payload: PartialUpdateTokenPayload
2029
2030
  :param _request_timeout: timeout setting for this request. If one
@@ -13,11 +13,13 @@
13
13
  """ # noqa: E501
14
14
 
15
15
  import datetime
16
+ import decimal
16
17
  import json
17
18
  import mimetypes
18
19
  import os
19
20
  import re
20
21
  import tempfile
22
+ import uuid
21
23
  from enum import Enum
22
24
  from typing import Dict, List, Optional, Tuple, Union
23
25
  from urllib.parse import quote
@@ -64,8 +66,10 @@ class ApiClient:
64
66
  "bool": bool,
65
67
  "date": datetime.date,
66
68
  "datetime": datetime.datetime,
69
+ "decimal": decimal.Decimal,
67
70
  "object": object,
68
71
  }
72
+ _pool = None
69
73
 
70
74
  def __init__(self, configuration, header_name=None, header_value=None, cookie=None) -> None:
71
75
  self.config: Configuration = configuration
@@ -268,7 +272,7 @@ class ApiClient:
268
272
  return_data = self.__deserialize_file(response_data)
269
273
  elif response_type is not None:
270
274
  match = None
271
- content_type = response_data.getheader("content-type")
275
+ content_type = response_data.headers.get("content-type")
272
276
  if content_type is not None:
273
277
  match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
274
278
  encoding = match.group(1) if match else "utf-8"
@@ -285,7 +289,7 @@ class ApiClient:
285
289
  return ApiResponse(
286
290
  status_code=response_data.status,
287
291
  data=return_data,
288
- headers=response_data.getheaders(),
292
+ headers=response_data.headers,
289
293
  raw_data=response_data.data,
290
294
  )
291
295
 
@@ -297,6 +301,7 @@ class ApiClient:
297
301
  If obj is str, int, long, float, bool, return directly.
298
302
  If obj is datetime.datetime, datetime.date
299
303
  convert to string in iso8601 format.
304
+ If obj is decimal.Decimal return string representation.
300
305
  If obj is list, sanitize each element in the list.
301
306
  If obj is dict, return the dict.
302
307
  If obj is OpenAPI model, return the properties dict.
@@ -312,12 +317,16 @@ class ApiClient:
312
317
  return obj.get_secret_value()
313
318
  elif isinstance(obj, self.PRIMITIVE_TYPES):
314
319
  return obj
320
+ elif isinstance(obj, uuid.UUID):
321
+ return str(obj)
315
322
  elif isinstance(obj, list):
316
323
  return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
317
324
  elif isinstance(obj, tuple):
318
325
  return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
319
326
  elif isinstance(obj, (datetime.datetime, datetime.date)):
320
327
  return obj.isoformat()
328
+ elif isinstance(obj, decimal.Decimal):
329
+ return str(obj)
321
330
 
322
331
  elif isinstance(obj, dict):
323
332
  obj_dict = obj
@@ -327,7 +336,7 @@ class ApiClient:
327
336
  # and attributes which value is not None.
328
337
  # Convert attribute name to json key in
329
338
  # model definition for request.
330
- if hasattr(obj, "to_dict") and callable(obj.to_dict):
339
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
331
340
  obj_dict = obj.to_dict()
332
341
  else:
333
342
  obj_dict = obj.__dict__
@@ -355,7 +364,7 @@ class ApiClient:
355
364
  data = json.loads(response_text)
356
365
  except ValueError:
357
366
  data = response_text
358
- elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
367
+ elif re.match(r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
359
368
  if response_text == "":
360
369
  data = ""
361
370
  else:
@@ -401,12 +410,14 @@ class ApiClient:
401
410
 
402
411
  if klass in self.PRIMITIVE_TYPES:
403
412
  return self.__deserialize_primitive(data, klass)
404
- elif klass == object:
413
+ elif klass is object:
405
414
  return self.__deserialize_object(data)
406
- elif klass == datetime.date:
415
+ elif klass is datetime.date:
407
416
  return self.__deserialize_date(data)
408
- elif klass == datetime.datetime:
417
+ elif klass is datetime.datetime:
409
418
  return self.__deserialize_datetime(data)
419
+ elif klass is decimal.Decimal:
420
+ return decimal.Decimal(data)
410
421
  elif issubclass(klass, Enum):
411
422
  return self.__deserialize_enum(data, klass)
412
423
  else:
@@ -554,12 +565,14 @@ class ApiClient:
554
565
  os.close(fd)
555
566
  os.remove(path)
556
567
 
557
- content_disposition = response.getheader("Content-Disposition")
568
+ content_disposition = response.headers.get("Content-Disposition")
558
569
  if content_disposition:
559
570
  m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition)
560
571
  if m is None:
561
572
  raise ValueError("Unexpected 'content-disposition' header value")
562
- filename = m.group(1)
573
+ filename = os.path.basename(m.group(1)) # Strip any directory traversal
574
+ if filename in ("", ".", ".."): # fall back to tmp filename
575
+ filename = os.path.basename(path)
563
576
  path = os.path.join(os.path.dirname(path), filename)
564
577
 
565
578
  with open(path, "wb") as f:
@@ -130,7 +130,7 @@ class ApiException(OpenApiException):
130
130
  self.body = http_resp.data.decode("utf-8")
131
131
  except Exception: # noqa: S110
132
132
  pass
133
- self.headers = http_resp.getheaders()
133
+ self.headers = http_resp.headers
134
134
 
135
135
  @classmethod
136
136
  def from_response(
@@ -13,7 +13,6 @@
13
13
  Do not edit the class manually.
14
14
  """ # noqa: E501
15
15
 
16
-
17
16
  # import models into model package
18
17
  from stackit.modelserving.models.chat_model_details import ChatModelDetails
19
18
  from stackit.modelserving.models.create_token_payload import CreateTokenPayload
@@ -18,6 +18,7 @@ import json
18
18
  import pprint
19
19
  import re # noqa: F401
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
+ from uuid import UUID
21
22
 
22
23
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
23
24
  from typing_extensions import Annotated, Self
@@ -35,7 +36,7 @@ class ChatModelDetails(BaseModel):
35
36
  context_length: StrictInt = Field(alias="contextLength")
36
37
  description: Annotated[str, Field(strict=True, max_length=2000)]
37
38
  displayed_name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="displayedName")
38
- id: StrictStr = Field(description="generated uuid to identify a model")
39
+ id: UUID = Field(description="generated uuid to identify a model")
39
40
  name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="huggingface name")
40
41
  quantization_method: Optional[StrictStr] = Field(default=None, alias="quantizationMethod")
41
42
  region: StrictStr
@@ -154,9 +155,9 @@ class ChatModelDetails(BaseModel):
154
155
  # override the default output from pydantic by calling `to_dict()` of each item in skus (list)
155
156
  _items = []
156
157
  if self.skus:
157
- for _item in self.skus:
158
- if _item:
159
- _items.append(_item.to_dict())
158
+ for _item_skus in self.skus:
159
+ if _item_skus:
160
+ _items.append(_item_skus.to_dict())
160
161
  _dict["skus"] = _items
161
162
  return _dict
162
163
 
@@ -18,6 +18,7 @@ import json
18
18
  import pprint
19
19
  import re # noqa: F401
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
+ from uuid import UUID
21
22
 
22
23
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
23
24
  from typing_extensions import Annotated, Self
@@ -33,7 +34,7 @@ class EmbeddingModelDetails(BaseModel):
33
34
  category: StrictStr
34
35
  description: Annotated[str, Field(strict=True, max_length=2000)]
35
36
  displayed_name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="displayedName")
36
- id: StrictStr = Field(description="generated uuid to identify a model")
37
+ id: UUID = Field(description="generated uuid to identify a model")
37
38
  name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="huggingface name")
38
39
  output_dimension: StrictInt = Field(alias="outputDimension")
39
40
  region: StrictStr
@@ -128,9 +129,9 @@ class EmbeddingModelDetails(BaseModel):
128
129
  # override the default output from pydantic by calling `to_dict()` of each item in skus (list)
129
130
  _items = []
130
131
  if self.skus:
131
- for _item in self.skus:
132
- if _item:
133
- _items.append(_item.to_dict())
132
+ for _item_skus in self.skus:
133
+ if _item_skus:
134
+ _items.append(_item_skus.to_dict())
134
135
  _dict["skus"] = _items
135
136
  return _dict
136
137
 
@@ -73,9 +73,9 @@ class ListModelsResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in models (list)
74
74
  _items = []
75
75
  if self.models:
76
- for _item in self.models:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_models in self.models:
77
+ if _item_models:
78
+ _items.append(_item_models.to_dict())
79
79
  _dict["models"] = _items
80
80
  return _dict
81
81
 
@@ -73,9 +73,9 @@ class ListTokenResp(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in tokens (list)
74
74
  _items = []
75
75
  if self.tokens:
76
- for _item in self.tokens:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_tokens in self.tokens:
77
+ if _item_tokens:
78
+ _items.append(_item_tokens.to_dict())
79
79
  _dict["tokens"] = _items
80
80
  return _dict
81
81
 
@@ -18,6 +18,7 @@ import json
18
18
  import pprint
19
19
  import re # noqa: F401
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
+ from uuid import UUID
21
22
 
22
23
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
24
  from typing_extensions import Annotated, Self
@@ -33,7 +34,7 @@ class Model(BaseModel):
33
34
  category: StrictStr
34
35
  description: Annotated[str, Field(strict=True, max_length=2000)]
35
36
  displayed_name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="displayedName")
36
- id: StrictStr = Field(description="generated uuid to identify a model")
37
+ id: UUID = Field(description="generated uuid to identify a model")
37
38
  name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(description="huggingface name")
38
39
  region: StrictStr
39
40
  skus: List[SKU]
@@ -121,9 +122,9 @@ class Model(BaseModel):
121
122
  # override the default output from pydantic by calling `to_dict()` of each item in skus (list)
122
123
  _items = []
123
124
  if self.skus:
124
- for _item in self.skus:
125
- if _item:
126
- _items.append(_item.to_dict())
125
+ for _item_skus in self.skus:
126
+ if _item_skus:
127
+ _items.append(_item_skus.to_dict())
127
128
  _dict["skus"] = _items
128
129
  return _dict
129
130
 
@@ -19,6 +19,7 @@ import pprint
19
19
  import re # noqa: F401
20
20
  from datetime import datetime
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
22
+ from uuid import UUID
22
23
 
23
24
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
24
25
  from typing_extensions import Annotated, Self
@@ -30,7 +31,7 @@ class Token(BaseModel):
30
31
  """ # noqa: E501
31
32
 
32
33
  description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None
33
- id: StrictStr
34
+ id: UUID
34
35
  name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
35
36
  region: StrictStr
36
37
  state: StrictStr
@@ -19,6 +19,7 @@ import pprint
19
19
  import re # noqa: F401
20
20
  from datetime import datetime
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
22
+ from uuid import UUID
22
23
 
23
24
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
24
25
  from typing_extensions import Annotated, Self
@@ -31,7 +32,7 @@ class TokenCreated(BaseModel):
31
32
 
32
33
  content: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
33
34
  description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None
34
- id: StrictStr
35
+ id: UUID
35
36
  name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
36
37
  region: StrictStr
37
38
  state: StrictStr
@@ -39,12 +39,17 @@ class RESTResponse(io.IOBase):
39
39
  self.data = self.response.content
40
40
  return self.data
41
41
 
42
+ @property
43
+ def headers(self):
44
+ """Returns a dictionary of response headers."""
45
+ return self.response.headers
46
+
42
47
  def getheaders(self):
43
- """Returns a dictionary of the response headers."""
48
+ """Returns a dictionary of the response headers; use ``headers`` instead."""
44
49
  return self.response.headers
45
50
 
46
51
  def getheader(self, name, default=None):
47
- """Returns a given response header."""
52
+ """Returns a given response header; use ``headers.get()`` instead."""
48
53
  return self.response.headers.get(name, default)
49
54
 
50
55
 
@@ -94,6 +99,7 @@ class RESTClientObject:
94
99
  url,
95
100
  data=request_body,
96
101
  headers=headers,
102
+ timeout=_request_timeout,
97
103
  )
98
104
  elif content_type == "application/x-www-form-urlencoded":
99
105
  r = self.session.request(
@@ -101,6 +107,7 @@ class RESTClientObject:
101
107
  url,
102
108
  params=post_params,
103
109
  headers=headers,
110
+ timeout=_request_timeout,
104
111
  )
105
112
  elif content_type == "multipart/form-data":
106
113
  # must del headers['Content-Type'], or the correct
@@ -114,6 +121,7 @@ class RESTClientObject:
114
121
  url,
115
122
  files=post_params,
116
123
  headers=headers,
124
+ timeout=_request_timeout,
117
125
  )
118
126
  # Pass a `string` parameter directly in the body to support
119
127
  # other content types than JSON when `body` argument is
@@ -124,10 +132,17 @@ class RESTClientObject:
124
132
  url,
125
133
  data=body,
126
134
  headers=headers,
135
+ timeout=_request_timeout,
127
136
  )
128
137
  elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
129
138
  request_body = "true" if body else "false"
130
- r = self.session.request(method, url, data=request_body, headers=headers)
139
+ r = self.session.request(
140
+ method,
141
+ url,
142
+ data=request_body,
143
+ headers=headers,
144
+ timeout=_request_timeout,
145
+ )
131
146
  else:
132
147
  # Cannot generate the request from given parameters
133
148
  msg = """Cannot prepare a request message for provided
@@ -141,6 +156,7 @@ class RESTClientObject:
141
156
  url,
142
157
  params={},
143
158
  headers=headers,
159
+ timeout=_request_timeout,
144
160
  )
145
161
  except requests.exceptions.SSLError as e:
146
162
  msg = "\n".join([type(e).__name__, str(e)])