diff --git a/llama-index-core/llama_index/core/schema.py b/llama-index-core/llama_index/core/schema.py index 198c985ff3779..81c81e418b986 100644 --- a/llama-index-core/llama_index/core/schema.py +++ b/llama-index-core/llama_index/core/schema.py @@ -76,7 +76,10 @@ class BaseComponent(BaseModel): def __get_pydantic_json_schema__( cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler ) -> JsonSchemaValue: - json_schema = super().__get_pydantic_json_schema__(core_schema, handler) + json_schema = handler(core_schema) + json_schema = handler.resolve_ref_schema(json_schema) + + # inject class name to help with serde if "properties" in json_schema: json_schema["properties"]["class_name"] = { "title": "Class Name", diff --git a/llama-index-core/poetry.lock b/llama-index-core/poetry.lock index 11b0ed7be8c1e..f83f68943862d 100644 --- a/llama-index-core/poetry.lock +++ b/llama-index-core/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -5203,7 +5203,6 @@ files = [ {file = "tiktoken-0.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d8c2d0e5ba6453a290b86cd65fc51fedf247e1ba170191715b049dac1f628005"}, {file = "tiktoken-0.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d622d8011e6d6f239297efa42a2657043aaed06c4f68833550cac9e9bc723ef1"}, {file = "tiktoken-0.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2efaf6199717b4485031b4d6edb94075e4d79177a172f38dd934d911b588d54a"}, - {file = "tiktoken-0.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5637e425ce1fc49cf716d88df3092048359a4b3bbb7da762840426e937ada06d"}, {file = "tiktoken-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fb0e352d1dbe15aba082883058b3cce9e48d33101bdaac1eccf66424feb5b47"}, {file = "tiktoken-0.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:56edfefe896c8f10aba372ab5706b9e3558e78db39dd497c940b47bf228bc419"}, {file = "tiktoken-0.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:326624128590def898775b722ccc327e90b073714227175ea8febbc920ac0a99"}, @@ -6004,4 +6003,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "4668dd80f505e422113f7a6f0d8ca0ab191326fdc95ee04ad22bfe3d35b37c6b" +content-hash = "2d05bbc94387d9d452d51bc0c045bbd01aadf717301e4d213717ff88ae8b8234" diff --git a/llama-index-core/pyproject.toml b/llama-index-core/pyproject.toml index 3f28af4a0beb7..b1f5e1000bea4 100644 --- a/llama-index-core/pyproject.toml +++ b/llama-index-core/pyproject.toml @@ -70,7 +70,7 @@ tqdm = "^4.66.1" pillow = ">=9.0.0" PyYAML = ">=6.0.1" wrapt = "*" -pydantic = ">=2.7.0,<2.10.0" # TODO: 2.10 was breaking many things, unpin when it settles down +pydantic = ">=2.8.0" filetype = "^1.2.0" # Used for multi-modal MIME utils eval-type-backport = {python = "<3.10", version = "^0.2.0"}