Skip to content

Commit b0e7d29

Browse files
Allow using pydantic v2 (#429)
* Allow using pydantic v2 * bump version
1 parent b8688a2 commit b0e7d29

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

clients/python/llmengine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.0.0b22"
15+
__version__ = "0.0.0b23"
1616

1717
import os
1818
from typing import Sequence

clients/python/llmengine/data_types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
from enum import Enum
66
from typing import Any, Dict, List, Literal, Optional, Union
77

8-
from pydantic import BaseModel, Field, HttpUrl
8+
import pydantic
9+
10+
if int(pydantic.__version__.split(".")[0]) > 1:
11+
from pydantic.v1 import BaseModel, Field, HttpUrl
12+
else:
13+
from pydantic import BaseModel, Field, HttpUrl
914

1015
CpuSpecificationType = Union[str, int, float]
1116
StorageSpecificationType = Union[str, int, float] # TODO(phil): we can make this more specific.

clients/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "scale-llm-engine"
3-
version = "0.0.0.beta22"
3+
version = "0.0.0.beta23"
44
description = "Scale LLM Engine Python client"
55
license = "Apache-2.0"
66
authors = ["Phil Chen <[email protected]>"]

clients/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
setup(
44
name="scale-llm-engine",
55
python_requires=">=3.7",
6-
version="0.0.0.beta22",
6+
version="0.0.0.beta23",
77
packages=find_packages(),
88
)

0 commit comments

Comments
 (0)