diff --git a/.github/scripts/check_diff.py b/.github/scripts/check_diff.py index 2a7939b602858..5fb8d37226af3 100644 --- a/.github/scripts/check_diff.py +++ b/.github/scripts/check_diff.py @@ -2,10 +2,12 @@ import json import os import sys -import tomllib from collections import defaultdict from typing import Dict, List, Set from pathlib import Path +import tomllib + +from get_min_versions import get_min_version_from_toml LANGCHAIN_DIRS = [ @@ -103,33 +105,84 @@ def add_dependents(dirs_to_eval: Set[str], dependents: dict) -> List[str]: def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]: - if dir_ == "libs/core": - return [ - {"working-directory": dir_, "python-version": f"3.{v}"} - for v in range(9, 13) - ] - min_python = "3.9" - max_python = "3.12" + if job == "test-pydantic": + return _get_pydantic_test_configs(dir_) + if dir_ == "libs/core": + py_versions = ["3.9", "3.10", "3.11", "3.12"] # custom logic for specific directories - if dir_ == "libs/partners/milvus": + elif dir_ == "libs/partners/milvus": # milvus poetry doesn't allow 3.12 because they # declare deps in funny way - max_python = "3.11" + py_versions = ["3.9", "3.11"] - if dir_ in ["libs/community", "libs/langchain"] and job == "extended-tests": + elif dir_ in ["libs/community", "libs/langchain"] and job == "extended-tests": # community extended test resolution in 3.12 is slow # even in uv - max_python = "3.11" + py_versions = ["3.9", "3.11"] - if dir_ == "libs/community" and job == "compile-integration-tests": + elif dir_ == "libs/community" and job == "compile-integration-tests": # community integration deps are slow in 3.12 - max_python = "3.11" + py_versions = ["3.9", "3.11"] + else: + py_versions = ["3.9", "3.12"] - return [ - {"working-directory": dir_, "python-version": min_python}, - {"working-directory": dir_, "python-version": max_python}, + return [{"working-directory": dir_, "python-version": py_v} for py_v in py_versions] + + +def _get_pydantic_test_configs( + dir_: str, *, python_version: str = "3.11" +) -> List[Dict[str, str]]: + with open("./libs/core/poetry.lock", "rb") as f: + core_poetry_lock_data = tomllib.load(f) + for package in core_poetry_lock_data["package"]: + if package["name"] == "pydantic": + core_max_pydantic_minor = package["version"].split(".")[1] + break + + with open(f"./{dir_}/poetry.lock", "rb") as f: + dir_poetry_lock_data = tomllib.load(f) + + for package in dir_poetry_lock_data["package"]: + if package["name"] == "pydantic": + dir_max_pydantic_minor = package["version"].split(".")[1] + break + + core_min_pydantic_minor = get_min_version_from_toml( + "./libs/core/pyproject.toml", "release", python_version, include=["pydantic"] + )["pydantic"].split(".")[1] + dir_min_pydantic_minor = ( + get_min_version_from_toml( + f"./{dir_}/pyproject.toml", "release", python_version, include=["pydantic"] + ) + .get("pydantic", "0.0.0") + .split(".")[1] + ) + + custom_mins = { + # depends on pydantic-settings 2.4 which requires pydantic 2.7 + "libs/community": 7, + } + + max_pydantic_minor = min( + int(dir_max_pydantic_minor), + int(core_max_pydantic_minor), + ) + min_pydantic_minor = max( + int(dir_min_pydantic_minor), + int(core_min_pydantic_minor), + custom_mins.get(dir_, 0), + ) + + configs = [ + { + "working-directory": dir_, + "pydantic-version": f"2.{v}.0", + "python-version": python_version, + } + for v in range(min_pydantic_minor, max_pydantic_minor + 1) ] + return configs def _get_configs_for_multi_dirs( @@ -140,7 +193,7 @@ def _get_configs_for_multi_dirs( dirs_to_run["lint"] | dirs_to_run["test"] | dirs_to_run["extended-test"], dependents, ) - elif job in ["test", "compile-integration-tests", "dependencies"]: + elif job in ["test", "compile-integration-tests", "dependencies", "test-pydantic"]: dirs = add_dependents( dirs_to_run["test"] | dirs_to_run["extended-test"], dependents ) @@ -169,6 +222,7 @@ def _get_configs_for_multi_dirs( dirs_to_run["lint"] = all_package_dirs() dirs_to_run["test"] = all_package_dirs() dirs_to_run["extended-test"] = set(LANGCHAIN_DIRS) + for file in files: if any( file.startswith(dir_) @@ -186,6 +240,7 @@ def _get_configs_for_multi_dirs( if any(file.startswith(dir_) for dir_ in LANGCHAIN_DIRS): # add that dir and all dirs after in LANGCHAIN_DIRS # for extended testing + found = False for dir_ in LANGCHAIN_DIRS: if dir_ == "libs/core" and IGNORE_CORE_DEPENDENTS: @@ -240,6 +295,7 @@ def _get_configs_for_multi_dirs( "extended-tests", "compile-integration-tests", "dependencies", + "test-pydantic", ] } map_job_to_configs["test-doc-imports"] = ( diff --git a/.github/scripts/get_min_versions.py b/.github/scripts/get_min_versions.py index d7e7c885b0925..dd94ead136128 100644 --- a/.github/scripts/get_min_versions.py +++ b/.github/scripts/get_min_versions.py @@ -1,4 +1,5 @@ import sys +from typing import Optional if sys.version_info >= (3, 11): import tomllib @@ -7,6 +8,9 @@ import tomli as tomllib from packaging.version import parse as parse_version +from packaging.specifiers import SpecifierSet +from packaging.version import Version + import re MIN_VERSION_LIBS = [ @@ -46,7 +50,13 @@ def get_min_version(version: str) -> str: raise ValueError(f"Unrecognized version format: {version}") -def get_min_version_from_toml(toml_path: str, versions_for: str): +def get_min_version_from_toml( + toml_path: str, + versions_for: str, + python_version: str, + *, + include: Optional[list] = None, +): # Parse the TOML file with open(toml_path, "rb") as file: toml_data = tomllib.load(file) @@ -65,11 +75,20 @@ def get_min_version_from_toml(toml_path: str, versions_for: str): continue # Check if the lib is present in the dependencies if lib in dependencies: + if include and lib not in include: + continue # Get the version string version_string = dependencies[lib] if isinstance(version_string, dict): version_string = version_string["version"] + if isinstance(version_string, list): + version_string = [ + vs + for vs in version_string + if check_python_version(python_version, vs["python"]) + ][0]["version"] + # Use parse_version to get the minimum supported version from version_string min_version = get_min_version(version_string) @@ -80,13 +99,31 @@ def get_min_version_from_toml(toml_path: str, versions_for: str): return min_versions +def check_python_version(version_string, constraint_string): + """ + Check if the given Python version matches the given constraints. + + :param version_string: A string representing the Python version (e.g. "3.8.5"). + :param constraint_string: A string representing the package's Python version constraints (e.g. ">=3.6, <4.0"). + :return: True if the version matches the constraints, False otherwise. + """ + try: + version = Version(version_string) + constraints = SpecifierSet(constraint_string) + return version in constraints + except Exception as e: + print(f"Error: {e}") + return False + + if __name__ == "__main__": # Get the TOML file path from the command line argument toml_file = sys.argv[1] versions_for = sys.argv[2] + python_version = sys.argv[3] assert versions_for in ["release", "pull_request"] # Call the function to get the minimum versions - min_versions = get_min_version_from_toml(toml_file, versions_for) + min_versions = get_min_version_from_toml(toml_file, versions_for, python_version) print(" ".join([f"{lib}=={version}" for lib, version in min_versions.items()])) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index d3efddf67eb17..e7f62438f4a8b 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -164,6 +164,7 @@ jobs: - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} uses: "./.github/actions/poetry_setup" + id: setup-python with: python-version: ${{ env.PYTHON_VERSION }} poetry-version: ${{ env.POETRY_VERSION }} @@ -231,7 +232,7 @@ jobs: id: min-version run: | poetry run pip install packaging - min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml release)" + min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml release ${{ steps.setup-python.outputs.installed-python-version }})" echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT" echo "min-versions=$min_versions" diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index d73ffe65e05b4..a34e521d96fa0 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -31,12 +31,12 @@ jobs: - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} uses: "./.github/actions/poetry_setup" + id: setup-python with: python-version: ${{ inputs.python-version }} poetry-version: ${{ env.POETRY_VERSION }} working-directory: ${{ inputs.working-directory }} cache-key: core - - name: Install dependencies shell: bash run: poetry install --with test @@ -54,24 +54,15 @@ jobs: run: | make test - - name: Ensure the tests did not create any additional files - shell: bash - run: | - set -eu - - STATUS="$(git status)" - echo "$STATUS" - - # grep will exit non-zero if the target message isn't found, - # and `set -e` above will cause the step to fail. - echo "$STATUS" | grep 'nothing to commit, working tree clean' - - name: Get minimum versions working-directory: ${{ inputs.working-directory }} id: min-version + shell: bash run: | poetry run pip install packaging tomli - min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml pull_request)" + echo "Python version ${{ steps.setup-python.outputs.installed-python-version }}" + python_version="$(poetry run python --version | awk '{print $2}')" + min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml pull_request $python_version)" echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT" echo "min-versions=$min_versions" @@ -83,3 +74,16 @@ jobs: poetry run pip install --force-reinstall $MIN_VERSIONS --editable . make tests working-directory: ${{ inputs.working-directory }} + + - name: Ensure the tests did not create any additional files + shell: bash + run: | + set -eu + + STATUS="$(git status)" + echo "$STATUS" + + # grep will exit non-zero if the target message isn't found, + # and `set -e` above will cause the step to fail. + echo "$STATUS" | grep 'nothing to commit, working tree clean' + diff --git a/.github/workflows/_test_pydantic.yml b/.github/workflows/_test_pydantic.yml new file mode 100644 index 0000000000000..ee48f46500b96 --- /dev/null +++ b/.github/workflows/_test_pydantic.yml @@ -0,0 +1,64 @@ +name: test pydantic intermediate versions + +on: + workflow_call: + inputs: + working-directory: + required: true + type: string + description: "From which folder this pipeline executes" + python-version: + required: false + type: string + description: "Python version to use" + default: "3.11" + pydantic-version: + required: true + type: string + description: "Pydantic version to test." + +env: + POETRY_VERSION: "1.7.1" + +jobs: + build: + defaults: + run: + working-directory: ${{ inputs.working-directory }} + runs-on: ubuntu-latest + name: "make test # pydantic: ~=${{ inputs.pydantic-version }}, python: ${{ inputs.python-version }}, " + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: ${{ inputs.python-version }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: ${{ inputs.working-directory }} + cache-key: core + + - name: Install dependencies + shell: bash + run: poetry install --with test + + - name: Overwrite pydantic version + shell: bash + run: poetry run pip install pydantic~=${{ inputs.pydantic-version }} + + - name: Run core tests + shell: bash + run: | + make test + + - name: Ensure the tests did not create any additional files + shell: bash + run: | + set -eu + + STATUS="$(git status)" + echo "$STATUS" + + # grep will exit non-zero if the target message isn't found, + # and `set -e` above will cause the step to fail. + echo "$STATUS" | grep 'nothing to commit, working tree clean' \ No newline at end of file diff --git a/.github/workflows/check_diffs.yml b/.github/workflows/check_diffs.yml index 5e4b57839b6b2..4a42bf569e980 100644 --- a/.github/workflows/check_diffs.yml +++ b/.github/workflows/check_diffs.yml @@ -31,6 +31,7 @@ jobs: uses: Ana06/get-changed-files@v2.2.0 - id: set-matrix run: | + python -m pip install packaging python .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT outputs: lint: ${{ steps.set-matrix.outputs.lint }} @@ -39,6 +40,7 @@ jobs: compile-integration-tests: ${{ steps.set-matrix.outputs.compile-integration-tests }} dependencies: ${{ steps.set-matrix.outputs.dependencies }} test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }} + test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }} lint: name: cd ${{ matrix.job-configs.working-directory }} needs: [ build ] @@ -67,6 +69,20 @@ jobs: python-version: ${{ matrix.job-configs.python-version }} secrets: inherit + test-pydantic: + name: cd ${{ matrix.job-configs.working-directory }} + needs: [ build ] + if: ${{ needs.build.outputs.test-pydantic != '[]' }} + strategy: + matrix: + job-configs: ${{ fromJson(needs.build.outputs.test-pydantic) }} + fail-fast: false + uses: ./.github/workflows/_test_pydantic.yml + with: + working-directory: ${{ matrix.job-configs.working-directory }} + pydantic-version: ${{ matrix.job-configs.pydantic-version }} + secrets: inherit + test-doc-imports: needs: [ build ] if: ${{ needs.build.outputs.test-doc-imports != '[]' }} diff --git a/libs/community/langchain_community/utilities/dalle_image_generator.py b/libs/community/langchain_community/utilities/dalle_image_generator.py index 654770c6d3a15..ba7970effa6c4 100644 --- a/libs/community/langchain_community/utilities/dalle_image_generator.py +++ b/libs/community/langchain_community/utilities/dalle_image_generator.py @@ -8,7 +8,7 @@ get_pydantic_field_names, secret_from_env, ) -from pydantic import BaseModel, ConfigDict, Field, Secret, model_validator +from pydantic import BaseModel, ConfigDict, Field, SecretStr, model_validator from typing_extensions import Self from langchain_community.utils.openai import is_openai_v1 @@ -31,7 +31,7 @@ class DallEAPIWrapper(BaseModel): async_client: Any = Field(default=None, exclude=True) #: :meta private: model_name: str = Field(default="dall-e-2", alias="model") model_kwargs: Dict[str, Any] = Field(default_factory=dict) - openai_api_key: Secret[str] = Field( + openai_api_key: SecretStr = Field( alias="api_key", default_factory=secret_from_env( "OPENAI_API_KEY", diff --git a/libs/core/poetry.lock b/libs/core/poetry.lock index 5974f6dfe9f18..ceeb49a833835 100644 --- a/libs/core/poetry.lock +++ b/libs/core/poetry.lock @@ -278,37 +278,6 @@ files = [ {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, - {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, - {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, - {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, - {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, - {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, - {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, - {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, - {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, - {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, - {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, - {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, - {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, - {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, - {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, - {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, - {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, ] [package.dependencies] @@ -659,22 +628,26 @@ files = [ [[package]] name = "importlib-metadata" -version = "8.4.0" +version = "8.5.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.4.0-py3-none-any.whl", hash = "sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1"}, - {file = "importlib_metadata-8.4.0.tar.gz", hash = "sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5"}, + {file = "importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b"}, + {file = "importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7"}, ] [package.dependencies] -zipp = ">=0.5" +zipp = ">=3.20" [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +enabler = ["pytest-enabler (>=2.2)"] perf = ["ipython"] -test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-perf (>=0.9.2)", "pytest-ruff (>=0.2.1)"] +test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] +type = ["pytest-mypy"] [[package]] name = "iniconfig" @@ -1208,13 +1181,13 @@ url = "../text-splitters" [[package]] name = "langsmith" -version = "0.1.117" +version = "0.1.120" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = "<4.0,>=3.8.1" files = [ - {file = "langsmith-0.1.117-py3-none-any.whl", hash = "sha256:e936ee9bcf8293b0496df7ba462a3702179fbe51f9dc28744b0fbec0dbf206ae"}, - {file = "langsmith-0.1.117.tar.gz", hash = "sha256:a1b532f49968b9339bcaff9118d141846d52ed3d803f342902e7448edf1d662b"}, + {file = "langsmith-0.1.120-py3-none-any.whl", hash = "sha256:54d2785e301646c0988e0a69ebe4d976488c87b41928b358cb153b6ddd8db62b"}, + {file = "langsmith-0.1.120.tar.gz", hash = "sha256:25499ca187b41bd89d784b272b97a8d76f60e0e21bdf20336e8a2aa6a9b23ac9"}, ] [package.dependencies] @@ -2549,104 +2522,104 @@ testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs ( [[package]] name = "simsimd" -version = "5.1.2" +version = "5.2.0" description = "Fastest SIMD-Accelerated Vector Similarity Functions for x86 and Arm" optional = false python-versions = "*" files = [ - {file = "simsimd-5.1.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3f79de2ee2143304b41a935705b32b731a4df929679101b672d81552187a9879"}, - {file = "simsimd-5.1.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bf732a724dba94031445f69c9e86fc75586f54bf55b64970bde4b817ab3eacf7"}, - {file = "simsimd-5.1.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:10a3b8d1e1812a26a1a2f76ac2ab01241bf9afc765b09182b346a894104a9b51"}, - {file = "simsimd-5.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b67dfcd1a45c97470dfb468c1506c30ff33bda146abd2318a3bc41a0d89c804"}, - {file = "simsimd-5.1.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ab60ab784b26d4d5fe5f4c9da2885cb75c42e9c1ffa4c3770422ecb3b7c8c5e0"}, - {file = "simsimd-5.1.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1aa65c1461f6cab0bb6dbaa870a9adcab788734a938bba6d4edacad537fe1b43"}, - {file = "simsimd-5.1.2-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:d739945689957df39f6f1e9405b751d8d2506255741d168b8ee98e6c42bf2506"}, - {file = "simsimd-5.1.2-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:f2d3d641a547cb0593e6aab78b71353711886828c9030b752f5864f304bee99b"}, - {file = "simsimd-5.1.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:077e8d620f3b25824eb6e1f40059a675fab0e8467075ca075184a3645adde913"}, - {file = "simsimd-5.1.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fdcacf809aed5602e8fa1955bbf6468209c49e4b674721e92d86fad94a272e3d"}, - {file = "simsimd-5.1.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:6a3ef733869e821171e462ab621439f990789bf6dfaad12412d28d98751df908"}, - {file = "simsimd-5.1.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:dde031fa90fd9bcde2a5168ed76ac9b019b828b2167a48731611588040268cb1"}, - {file = "simsimd-5.1.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:02a425bd04f31087077ec2feabafbfeee70f4fcce99a8e8a900588bbffccbbf5"}, - {file = "simsimd-5.1.2-cp310-cp310-win32.whl", hash = "sha256:e186ac3e0651691a5be560468a8b8bfe45f8848b46fa4fbe5d2d951a853791d8"}, - {file = "simsimd-5.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:ddfa5c1ec93ca9c8389e757bda1b9434710fddc9cfd6de2c86fe60c910874330"}, - {file = "simsimd-5.1.2-cp310-cp310-win_arm64.whl", hash = "sha256:b9c203a93eff80b928ce864175c63cd3c5f005e19b468009dbdf5b0ca22d438a"}, - {file = "simsimd-5.1.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:abaf2fdeeaf084dd356c5d145ed701a9f654e869961dea8ec37452be7f5ad901"}, - {file = "simsimd-5.1.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6e2b8921bf2f59c17309883bc07bc0a649a1bfd5ef61d34d33c2082ed7b388c1"}, - {file = "simsimd-5.1.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ece58dcdfad2850f97e323135fdb6a417f7507451971db3813dfe33cd00489e8"}, - {file = "simsimd-5.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d2cc2f272effe8dd7dd145be94c2a880a2326ee3e76402c42d900c3cffc24d45"}, - {file = "simsimd-5.1.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d75015e22e97012ab4399e456365efb94608117fde898fe15d930cf860eeb74c"}, - {file = "simsimd-5.1.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:62ede5aeb43f77fe857f270f9f938cfae0efd1ece648a2f7b465ede0e4bcc4fc"}, - {file = "simsimd-5.1.2-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:e90bb1d6f7c9303c656f5a272cf7816a0b692d175859ac9729e9dce5ae536b13"}, - {file = "simsimd-5.1.2-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:4533d7e0a0c7fbe7a518017e0a3a6df01ab8b3243fdf97f20a7d1c95b0bd7d09"}, - {file = "simsimd-5.1.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4ee3c099b47452ac10530baa5e7cb0196d08591c1c0646fbe3d0a6b7f0779555"}, - {file = "simsimd-5.1.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5540f1d4947e875e547d6657309b93da2c6a6e2398550332f0c85880321fec2a"}, - {file = "simsimd-5.1.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:afbdcdf65d20c7f98aff947c47581ab2a945336056f8a2c1fec3f8c02fea41a6"}, - {file = "simsimd-5.1.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:8a929c2d07c07a9cb588f8cda5b70a6da93f3af18974fe9c350d4303a86ce19b"}, - {file = "simsimd-5.1.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3d644d1b1022dc79b7a40253a737dc2022716524042968821874879047bba4f7"}, - {file = "simsimd-5.1.2-cp311-cp311-win32.whl", hash = "sha256:8613edff20fcaece532122553dd6c4f033ae5a7eba0bd3ab585649747adb680b"}, - {file = "simsimd-5.1.2-cp311-cp311-win_amd64.whl", hash = "sha256:2dc9b26fe15db766a3da4f6cd7106c3edefbeac8fe8ae98eb52745fcfd453482"}, - {file = "simsimd-5.1.2-cp311-cp311-win_arm64.whl", hash = "sha256:3b8e96370dfae69825b5379d88e8a7aab3a0e22dcda79f4e81a3b9a61aceb5d7"}, - {file = "simsimd-5.1.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:5d7bf99b0efc6275c49b4e47bf0f0b42fead860224404305d00ee6dc9c281d82"}, - {file = "simsimd-5.1.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:dbc1f8d735dfcbb942b3cbd3c45e23add23d423095e968dc9989c45d08d9a5a2"}, - {file = "simsimd-5.1.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8907c22c5a674977d06f1131ea7f35e92c8236a34ac17b864d7d4f651e25d281"}, - {file = "simsimd-5.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a20ebddb8a92f4bdddf3b87a980881110fe021bdb74acef4913db2e8e49a118"}, - {file = "simsimd-5.1.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f84849307212c68ae36d36b91234a2a8ca42d9d6ed51c91976f07b5f8138fc73"}, - {file = "simsimd-5.1.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fd01a5f5c1788da8da1d1ab0b5120c9b43f218673b4dad92d802ef391ad3a4bf"}, - {file = "simsimd-5.1.2-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:11938c366c3ff840714a77ea6793aaadc2ef9d3973d061961b89344948dd2fa0"}, - {file = "simsimd-5.1.2-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:f6ffb8240d5956f65a33063539fa6c103d727f37a6a022ee3158bf1899dd2a51"}, - {file = "simsimd-5.1.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:816a6bc9a97643b28580a9fa980112d6f7c4c9dff91210b52de92210567271dc"}, - {file = "simsimd-5.1.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:2e67d8e78ef0636f12f921b093efc90ad9f191bb60f01560c3bc2ac2e615643d"}, - {file = "simsimd-5.1.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:13e0e41a073e2140ad3cee79a2de923d28907a4473100688488682a422ba3584"}, - {file = "simsimd-5.1.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:7c0a473b493386838b52ebcc62f66c283ebb5cad744ab2fca73fad956cc60c50"}, - {file = "simsimd-5.1.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b010c9f17636dbd8f59395cf818936e92868c36fbfe045631f2d5b5726d8d225"}, - {file = "simsimd-5.1.2-cp312-cp312-win32.whl", hash = "sha256:67698eea5cec0cdd70af8aff2983bb655ffe9006ccf82dae4c9f00d85bf540f4"}, - {file = "simsimd-5.1.2-cp312-cp312-win_amd64.whl", hash = "sha256:4a9d0eaf2509d62f2b74d2f98b5ef73af747d4969bf3f031540261a802142f2e"}, - {file = "simsimd-5.1.2-cp312-cp312-win_arm64.whl", hash = "sha256:1fbf66ff0d48fdef7ee4e520037394e82cced0b97c3d8d29e854e0d0c24f3c0e"}, - {file = "simsimd-5.1.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2252b815db196404b44560662e012b74240addf39883ae52ee3ebd62468a3475"}, - {file = "simsimd-5.1.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:13129398c48808f4c35acbcada23f179382ca77f5809d1cc0fa8dee513c29ecc"}, - {file = "simsimd-5.1.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a32b1ebbee8bb7734f200b86e37d9670d9deba50455e09d3bb275d68e183f4f2"}, - {file = "simsimd-5.1.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f5141e1f78bd982856c3ce4c56e696c11f09a77f11b3a6048bee23865c4ba608"}, - {file = "simsimd-5.1.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:371202b8b73f4a35b1d510bf505c4551b76e13e1af30c3d21ddb7119f90267cf"}, - {file = "simsimd-5.1.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:60b376bbca134510cfc10947d6c78c8f414f1675c237e4921e82be330505f6a1"}, - {file = "simsimd-5.1.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:bb3d901aa40dcd1fc8cc4dbd09186c6b76ef152a5547c6e336fa88fcfb16900d"}, - {file = "simsimd-5.1.2-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:41e4691a4e43d8823cc9b20d85a6498edf02d48744379855477445dc79bbff90"}, - {file = "simsimd-5.1.2-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:3780b291da0d9a8a50d7f57aabb2e778fa4917b6c0489d161f6f33e371b7c0cd"}, - {file = "simsimd-5.1.2-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:cf0ffaef6965abf1a2ea23cb184c3c3e8188cac6d74ccda056bef0f9cb741abd"}, - {file = "simsimd-5.1.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:05b13b5f3040620bb0544105fe27ab8338d57f5fafdcf33e541bb876b3effc73"}, - {file = "simsimd-5.1.2-cp37-cp37m-win32.whl", hash = "sha256:bb6c867ed0d48970d3f2632bfe4704523bed8f1dc927cf80ffbc039bd61c2937"}, - {file = "simsimd-5.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:214d9b97346220b66fc03eafcdef3641ea6d2dca044bb6db746690f8362402f7"}, - {file = "simsimd-5.1.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:db4930c9af6f659ba5dde3ef939438c31ee1f33f506de34961c04dcb5f55cf37"}, - {file = "simsimd-5.1.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:aacd2e36a45fcc9d83bde5fbc8467b08238a354eac1bf638a175c40061c30888"}, - {file = "simsimd-5.1.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1b8e9686dbd2496fafd0089ef0d045c86b6e3b7c5619900ae56fabbbacc7095b"}, - {file = "simsimd-5.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93942c70e3dc29a190707a5368978740dc8556b702b0c1c11439cf6f2f403240"}, - {file = "simsimd-5.1.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6bf4fd1a9758a4569d40ee3bf1fc487e2b4aeacfe053f2e5706134f57a27972d"}, - {file = "simsimd-5.1.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:46583f91ff3fa3a7e2025a85bd1a2b8433a6035897b97b3a2d4bc0be2ea58f94"}, - {file = "simsimd-5.1.2-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:409288a929c5d3c840a42a9ee606959d86603f6bff7db399bc41df552893558c"}, - {file = "simsimd-5.1.2-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:358a67ba67f5f50ee81769f2e7e5386938522f76db5a2b46a117b13cc7c393d9"}, - {file = "simsimd-5.1.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:9c37ab1068873c77e29eee1c422898651090a848693a21f370b954c85a1b0225"}, - {file = "simsimd-5.1.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:c72b0baa7e024737b43b8b26e96800ec980b94f6d91d9258a998ef4db9ed7ab8"}, - {file = "simsimd-5.1.2-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2b3ba08e11687def3bbea84b2e6c885b611d19b4485280373a48dd102b2f2b85"}, - {file = "simsimd-5.1.2-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:6005d90f75bc71539ba01c48ed0f7c86064bf6243e1c56421dba6eb1a2a83e3b"}, - {file = "simsimd-5.1.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:16e1f6899be8aa3cc4d5cc94d87da59544e7263e8b8b8fa5bfc2824d4bb0464e"}, - {file = "simsimd-5.1.2-cp38-cp38-win32.whl", hash = "sha256:292d6ab2be3ace81e52e6f061e82185f42af615794e35b465c432169bc45e779"}, - {file = "simsimd-5.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:a44513678f71ff7e152ae5db8cbae8570cf25cb2000461173fd7a266e4cd0042"}, - {file = "simsimd-5.1.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:70b6f5eecff5c299e804b8b5337b7793d56fcb67b789aa442aad59e0ce5c26c2"}, - {file = "simsimd-5.1.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3fe6564fce8139b2e882afa212542d38f0e5d85badbb89f58b606e9d985692d0"}, - {file = "simsimd-5.1.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:24a37b151243eab0d6e6f927a425d3e97b1223ca0acc43c149a442e4bcce0fa6"}, - {file = "simsimd-5.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46b54e12c51d08a024de4a07c13632a89b7c4f5753789a74e184f8f2d2722e0a"}, - {file = "simsimd-5.1.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad12bdf08de1e9e249ad76ec115804c80a8904d97619ce487f230ab60cfd1399"}, - {file = "simsimd-5.1.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:14d76d817401ecf6ab2021f0ea5eae9d732499e7e341504f405350682d6f6372"}, - {file = "simsimd-5.1.2-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:aba0899991d9af6f385efbd7f6031d213d0cef00aba20b843dca66ebb04bba25"}, - {file = "simsimd-5.1.2-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:d242375faa35c959e48af4de27a733793195f66898a852d353169870cd2bf8ec"}, - {file = "simsimd-5.1.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4e63350688298472f14486f455d53963a85d3151e330cc5d6a3dddd338d0e29d"}, - {file = "simsimd-5.1.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3c7d92a4402bbb1b5cdcc4f8ffba161904022bc64df54228ef058d3b7f62aa64"}, - {file = "simsimd-5.1.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:e73ea0f4e69c6937e69a748af703bd675265595f56b928826b4c03739a7ac37e"}, - {file = "simsimd-5.1.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:6ae4fa625870834b618d01fbe8c6b7a6690b34ab60915385910f8f485177dec8"}, - {file = "simsimd-5.1.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c5628471ac7f02b49a664f3fd505b2a10ab9c06d078c56bb6a5c73b006149e2f"}, - {file = "simsimd-5.1.2-cp39-cp39-win32.whl", hash = "sha256:bb5cfb6bb195dc68025dffeb14fb276b3c7c6a6fe7a14694d38562c3f4392aed"}, - {file = "simsimd-5.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:3a1d11818ff6ad495c40116832b04626d48531d153db2e0d8d5e5bd28ee477d4"}, - {file = "simsimd-5.1.2-cp39-cp39-win_arm64.whl", hash = "sha256:0ec21cde673571bc5831601253e51c930c1fd0a6e43c32c5a9077d60bb094dc4"}, - {file = "simsimd-5.1.2.tar.gz", hash = "sha256:358f6a6fe44b9ace4cf6ebae5d388edcaeea33f1982719ba8dca2562c95b716a"}, + {file = "simsimd-5.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25583014ea4e46ed075f68e22633a6d69c32d3d69f55c7bd3e51ec80c6b80781"}, + {file = "simsimd-5.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:17f638b8d0573122b465a5c0f4245498850ea972aec09384e60b28ca8dbd54c1"}, + {file = "simsimd-5.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e9ea1258862dba7df3d8d4b4c2515550333efd26268d366ed9fd68ae44b4e2e2"}, + {file = "simsimd-5.2.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:752dfe56ba62c0909583a95d0a938dfd966f7b53449175a21157903e1b26e2fa"}, + {file = "simsimd-5.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:972dab4884989465b2d6322a13b99cf4d5cbe3c670bdebecf2508dbe206b8727"}, + {file = "simsimd-5.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8a9abfe940d40e6f16fc72cdbc7012267e65cf97991151d7367c1db70284ce1e"}, + {file = "simsimd-5.2.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:0410adb76ad6bfa450b8d4a06ecef3f9707e8a6da12f35524d639788ee9c736b"}, + {file = "simsimd-5.2.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:ac87c86402d22ad6c0dc0225990acc526d4d85d270c7dcbcefcbcfda863fd9da"}, + {file = "simsimd-5.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d5ca7fb0505427bd4826007b937f5750a909f0c794e286161a49094b5487a7aa"}, + {file = "simsimd-5.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dd7d74fd4c5af6681b1e42657a99c16b3719e557200b284ccd500bd9733f76b9"}, + {file = "simsimd-5.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e81b70610dbf490644675610fc561a63bcd976e92971636d87039686df425bab"}, + {file = "simsimd-5.2.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:4f602f05c4bfe08453df0cb304bd4f52ead40599fd140317eeffa442aa32db9f"}, + {file = "simsimd-5.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ad11b0c7b9b3ae8a36806d51df8da193186f801edb5d73f0c29435e78b4f41fd"}, + {file = "simsimd-5.2.0-cp310-cp310-win32.whl", hash = "sha256:a017dedd56061a769af8f78e4b7fe027c5b61081549ff86f54f718346b0029a1"}, + {file = "simsimd-5.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:6ee548a3fff7ed5c6c22de60a8114d834a433b0a75bb1b26a247826ec026a918"}, + {file = "simsimd-5.2.0-cp310-cp310-win_arm64.whl", hash = "sha256:f99372079287ceeeb89b090217d11fa2c2ca42b50004c05457922d77bd466b49"}, + {file = "simsimd-5.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b555ff9c4c40138183a786681a60156e134210e73723bcd88e99104fd4f3da60"}, + {file = "simsimd-5.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:67c7f59180298fba530ddf6c45e1211f663a5ccf05471dcb752ce5b258535e1e"}, + {file = "simsimd-5.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:334fcc2eaee870fabe3455695c89ecdd645faa4ca479c592bcae223d84abb4f7"}, + {file = "simsimd-5.2.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1fd44c70aaf16812f6f252ed627de19b72ca9252fb6e18d9a951ad5cf64d2a52"}, + {file = "simsimd-5.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e51db967be3bd912fbf9db4d5e03ba9440895a03c861bda67b61fb939f437abc"}, + {file = "simsimd-5.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c9d6712d6d262734afd6bd29c9e35c72e6f263c877e5b316d2eefcc3097551e1"}, + {file = "simsimd-5.2.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:e5516f1e79a8f9c64206579e7000d12a2a7935b0777b02bfa4853a3738c6709c"}, + {file = "simsimd-5.2.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:18228a4e54b5906789339294d425b33f33eda4606ace5131d652149bbe606ad1"}, + {file = "simsimd-5.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b806c33e9c03055938dd88202e0e31116d4c163ff77a1b3da8de3ff7ec84f1dc"}, + {file = "simsimd-5.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:05d665e002370c1a9bb90c33bf714fb80c3a449668826bb65e7cf3027a56efe6"}, + {file = "simsimd-5.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:9dea725c612e175ecb141e53beef90eb4f3fe0c39a26f0e4f16772da804a8ffc"}, + {file = "simsimd-5.2.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:3a16838c3cebf7f7b0d9191c40b8a2eee718224248b7ac32c6f338ac39c8dc36"}, + {file = "simsimd-5.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:945b685351631cfb58145a990852773354a8c1bf8c51dcdd7a7b8b694cd03d1c"}, + {file = "simsimd-5.2.0-cp311-cp311-win32.whl", hash = "sha256:95cece1adb4e615dadbc21ec06c9bbaa9cdf2a7e42c2be0400926bef7bf5ed97"}, + {file = "simsimd-5.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:f65d02ac45e9ca776bc1e1aee8c4e77094282d8b0194d709cd4da87e033ed0cd"}, + {file = "simsimd-5.2.0-cp311-cp311-win_arm64.whl", hash = "sha256:19621f6fa6686a4e3ec43b0422be47a47931c2524420c3a632406ecf7c2a5f0c"}, + {file = "simsimd-5.2.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ba2f7c1d685ccab8fd6d8e87a4a607f4e12db7ac04f74721a6f1c6f2d5649cc2"}, + {file = "simsimd-5.2.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a5bae39301567724ad97da90d8917c9b5805c385895f665f5d477c4b8ec94be1"}, + {file = "simsimd-5.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d1e0672ec689bc985f324bc4d32ad8ad6ff7902b4c09c3db3e13f02d33404772"}, + {file = "simsimd-5.2.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01f85dff85f5b3575d070be0850ff4413c4a5609107daf73aa1cdcde263bf49d"}, + {file = "simsimd-5.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:469be38bd4c5362e315a0d13b7612a144dff21969a4c5fa2a80ce384fe29733c"}, + {file = "simsimd-5.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b26c4bd6f6d7b2c0540dc20f5b6d3c1be04fe4094f6c72d66d2df092809392c2"}, + {file = "simsimd-5.2.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:4afef1f8cc6b1dbed5b2519a41467b1a4156b343883aa3270d54e316463e8313"}, + {file = "simsimd-5.2.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:44a5f62cda1f70443ea9b55747e4e51683e18b8d06de6ef7e368e6519ca5d875"}, + {file = "simsimd-5.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7a9d9b7bd282123801050d9b8ef8031f5b6fce0eac466dfd845b3ed0870854a2"}, + {file = "simsimd-5.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:6292bae2b115d9398f0c34739c30e2fcc5ba82c07967ec98cca9a4611bfc6b6b"}, + {file = "simsimd-5.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c23274f46c8d61bea4c258d7153254393c409965b63750e3942ecc845bae3ef4"}, + {file = "simsimd-5.2.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:7ac768eabcce4834a4b02430d8ce73f13fe065565bd84d44b810d6f0b8b687d4"}, + {file = "simsimd-5.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eafb54da727df5be9de1a2e06a1dd5bef884f1facf7a116eafc803348e65f429"}, + {file = "simsimd-5.2.0-cp312-cp312-win32.whl", hash = "sha256:b03beefdeff8fd55d19bf7dc9ee1c90b7f22202d15b80bf82923d7b01e1c7b1c"}, + {file = "simsimd-5.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:0766dac1ccfa41631049f7afbba65b75e815bd184bfbc33dc2844c0693d8f99d"}, + {file = "simsimd-5.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:7782f7e50e6c7c0ae0796a4d818e1b3c033e4e6e3e41fd37b3d2d2ff2f1257ac"}, + {file = "simsimd-5.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:1694c13d136c6e0b0b9b7e7e9bde5cdb2c86bc10afc78e97336986df21de6a46"}, + {file = "simsimd-5.2.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d2ef45a29b81a4a0a791a79467cd70d60eb509f1d677b9ddfc4a5c1d97d5dcbd"}, + {file = "simsimd-5.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae090e5039130a4051e46653fd688bf47d7ae6c27fd016f36dd3b2dc237d5ab4"}, + {file = "simsimd-5.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:950c216cded4853959e0e394b6fef11aa67cbddce69731e74e9832253be1f9cc"}, + {file = "simsimd-5.2.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:a9c255abaacb69420a0feb07e561702faacf29ca5f3a2962767d1a1f56f6ba68"}, + {file = "simsimd-5.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:564a7b1428b28e145381665e31ff7e92eac398e00f7d13d1854f82af15fa6486"}, + {file = "simsimd-5.2.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:8deb4aee8cb2e009c28bda86cda8e01ad1dbc8bd6bf6c0fb48243c0ae2baf5ea"}, + {file = "simsimd-5.2.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:dff344c2224b5d45b09dac9a065983c06c58da9427d6803a44bd19b947ac9a97"}, + {file = "simsimd-5.2.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:03f0c22570f1747f4e09733af0926fce397224a4aaedb3bb5a19a76f78a29cab"}, + {file = "simsimd-5.2.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:64ea5a3e3790db0b37ec6afa78744fbe6dcb82d0f3108798eaa550eb54a19c76"}, + {file = "simsimd-5.2.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:3660a03658acd691080bd288816d096ec429fd2019b100cb721c4e0befcffbd0"}, + {file = "simsimd-5.2.0-cp37-cp37m-win32.whl", hash = "sha256:49a655c4ab43f4ea988fae8d96cf7a290329a70c9588b4690c58a5023ee47c9d"}, + {file = "simsimd-5.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:4f4d21d62ac78b87ade61ab3e21409623797583fe75ef4509bd3894c589fee96"}, + {file = "simsimd-5.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:8c3a3fa4eb65e1f97692093e05fd9252f5fc64cad4dafe50154d9f5cb0f8703e"}, + {file = "simsimd-5.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e2e72bb52dc63cf4ab898fed2882a966c375a05632eb27b81c6a2062a0bf19b8"}, + {file = "simsimd-5.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3066f8ea214980b2cc7e76fb1768429ccb78286923459eb4b395ec8d2b211e3e"}, + {file = "simsimd-5.2.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69d254ca042efc8eab430667ff43fa8bd38fe16f0fe7e2b4764e805bdce9883f"}, + {file = "simsimd-5.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a214de9f14d70a1c6090ae4f172ca16ee8754dfcf11d23e686fb5d29141cfcb"}, + {file = "simsimd-5.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c4281ae151ed91a00916cc5667bb45f67ce1eac9efa3b4edbc757f98132989c2"}, + {file = "simsimd-5.2.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:fcc814c984638033babcc83a283cb0b1c37b77481e9787441372a1f949899685"}, + {file = "simsimd-5.2.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:7922ce90b78b982d1859e8eba668ed3b1e15c0d22dcaa0278e9119a83f4de232"}, + {file = "simsimd-5.2.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6c7fddb92719dd20fdd5b012f11912a033a6dc220519086c7d1b76c7ccb0e6c2"}, + {file = "simsimd-5.2.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:f9360b34da425f2423ca4c99cb556b25631a8bfbaf1e83335b9b1f83da247a91"}, + {file = "simsimd-5.2.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:47ca4148af7d7a7ff9e5426387bc8bdf74412e0b35af79aa2951489f286f4d07"}, + {file = "simsimd-5.2.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:92feb9197c2de2e431fb304dbb1624679dc508ed1e7374a90d7c8d46a414658f"}, + {file = "simsimd-5.2.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4e32d785e3f3db32c954af7c249a329667ad0b694d4b01bf4288eaf8102a33d1"}, + {file = "simsimd-5.2.0-cp38-cp38-win32.whl", hash = "sha256:6e1d69097ccc543294b6b4e345a8a24b43f7fcb50416cef579ce0c733d134211"}, + {file = "simsimd-5.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:53a9e09ed52f3ccdc7925b174abfb47f5bc6ab34e900c3d247d24d9792bf8a3c"}, + {file = "simsimd-5.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:06d597890b8b36d3d97e23142e81b00b83a6468753205ad98ad24219377263f0"}, + {file = "simsimd-5.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:df765a9b55f9a3172717a679da549466ee25fc2ee90ef07c5b0b2fd6c26a4d22"}, + {file = "simsimd-5.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f68cd04399d74fee5a1720949c570b1c4799def7942c1236c03a099581ff7fcf"}, + {file = "simsimd-5.2.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:81cb360279f6df026149113bedaa34f991c0774347804ebb23866a42db3312d0"}, + {file = "simsimd-5.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bf5b8c42c70332245c78dae89e7858c8160090efa856655a06e518b4d0352d0f"}, + {file = "simsimd-5.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:597aa1fdc5c89c3620e9bf202ab5f42dea40c42ff9f7771e3bbfe67a4d83a3d8"}, + {file = "simsimd-5.2.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:b45a88fafe2144f56ffbe8c6fc34d56778603ff432c78fd87d0d2014b36bcaeb"}, + {file = "simsimd-5.2.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:cd9b0ad1cb2a531abe5f9ae291c80f2f14174452bcc3a069ea6fcd1336c3d23b"}, + {file = "simsimd-5.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:28f228c5368df47464f460cfbd1c66dae13b5deb02824b55b34d413bbea17e4c"}, + {file = "simsimd-5.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e44486023afccadd618dd4b76ccd5b96a200e4bdbdf35307f08ae1caa73cd3d2"}, + {file = "simsimd-5.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ed4c3872e98f47191ed79ed8db06049204c7960a35a94cc01d04cbea43c6f360"}, + {file = "simsimd-5.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:a10921ba4fe5ca21b198bb571ba47e95661277ee032f0c256e107c5dee7981b8"}, + {file = "simsimd-5.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1330b2545e1ced2a67c184a9b8f8400b4d35c2347eb923a8535e17718aa29187"}, + {file = "simsimd-5.2.0-cp39-cp39-win32.whl", hash = "sha256:7b1e22480904cb569f3b5f50515086474c9d7bc043a958128d788cbab5c6aa7c"}, + {file = "simsimd-5.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:5bad854e693ac6e37cadd0fb0feb550cf65772ea0bdcb3a4413b66f9159b68a4"}, + {file = "simsimd-5.2.0-cp39-cp39-win_arm64.whl", hash = "sha256:d2f7396d8c5914e1d59c68147d681620b361d036faa0eeef5243eafc31146116"}, + {file = "simsimd-5.2.0.tar.gz", hash = "sha256:6c2142481877b1209d02f887c304de6f8410426775c4dc598f0f95e3a23f16fc"}, ] [[package]] @@ -2903,13 +2876,13 @@ dev = ["flake8", "flake8-annotations", "flake8-bandit", "flake8-bugbear", "flake [[package]] name = "urllib3" -version = "2.2.2" +version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, - {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] @@ -3046,4 +3019,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "b64871f84ca286a52214d52134d1e3401a35ae4f0595b8acc7f6696e69b17001" +content-hash = "7d516cb9978fab31edd2a9568c7e24556cd7a63c7a0b627fa513f08c99a6001c" diff --git a/libs/core/pyproject.toml b/libs/core/pyproject.toml index 3f127f0ec1d94..c47e7cb455e08 100644 --- a/libs/core/pyproject.toml +++ b/libs/core/pyproject.toml @@ -37,7 +37,11 @@ jsonpatch = "^1.33" PyYAML = ">=5.3" packaging = ">=23.2,<25" typing-extensions = ">=4.7" -pydantic = "^2.7.4" +pydantic = [ + { version = "^2.5.2", python = "<3.12.4" }, + { version = "^2.7.4", python = ">=3.12.4" }, +] + [tool.poetry.extras] diff --git a/libs/core/tests/unit_tests/prompts/__snapshots__/test_chat.ambr b/libs/core/tests/unit_tests/prompts/__snapshots__/test_chat.ambr index f18294310cc4f..5a235a0f9f933 100644 --- a/libs/core/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +++ b/libs/core/tests/unit_tests/prompts/__snapshots__/test_chat.ambr @@ -93,11 +93,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -209,11 +205,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -297,11 +289,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -375,11 +363,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -450,11 +434,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -516,11 +496,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -618,11 +594,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -696,11 +668,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -763,11 +731,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -862,11 +826,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -935,11 +895,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -987,11 +943,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1069,11 +1021,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1133,7 +1081,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -1187,12 +1134,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -1201,11 +1143,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1224,7 +1162,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -1278,12 +1215,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -1292,11 +1224,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1347,7 +1275,6 @@ }), 'properties': dict({ 'history': dict({ - 'default': None, 'items': dict({ 'oneOf': list([ dict({ @@ -1497,11 +1424,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -1613,11 +1536,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -1701,11 +1620,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1779,11 +1694,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1854,11 +1765,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1920,11 +1827,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2022,11 +1925,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2100,11 +1999,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2167,11 +2062,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2266,11 +2157,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2339,11 +2226,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2391,11 +2274,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2473,11 +2352,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2537,7 +2412,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -2591,12 +2465,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -2605,11 +2474,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2628,7 +2493,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -2682,12 +2546,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -2696,11 +2555,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ diff --git a/libs/core/tests/unit_tests/prompts/test_chat.py b/libs/core/tests/unit_tests/prompts/test_chat.py index ec73c4aaf5739..7fc17d128d610 100644 --- a/libs/core/tests/unit_tests/prompts/test_chat.py +++ b/libs/core/tests/unit_tests/prompts/test_chat.py @@ -31,6 +31,7 @@ SystemMessagePromptTemplate, _convert_to_message, ) +from tests.unit_tests.pydantic_utils import _normalize_schema @pytest.fixture @@ -795,14 +796,18 @@ def test_chat_input_schema(snapshot: SnapshotAssertion) -> None: assert prompt_all_required.optional_variables == [] with pytest.raises(ValidationError): prompt_all_required.input_schema(input="") - assert prompt_all_required.get_input_jsonschema() == snapshot(name="required") + assert _normalize_schema(prompt_all_required.get_input_jsonschema()) == snapshot( + name="required" + ) prompt_optional = ChatPromptTemplate( messages=[MessagesPlaceholder("history", optional=True), ("user", "${input}")] ) # input variables only lists required variables assert set(prompt_optional.input_variables) == {"input"} prompt_optional.input_schema(input="") # won't raise error - assert prompt_optional.get_input_jsonschema() == snapshot(name="partial") + assert _normalize_schema(prompt_optional.get_input_jsonschema()) == snapshot( + name="partial" + ) def test_chat_prompt_w_msgs_placeholder_ser_des(snapshot: SnapshotAssertion) -> None: diff --git a/libs/core/tests/unit_tests/prompts/test_structured.py b/libs/core/tests/unit_tests/prompts/test_structured.py index eb17bcd0ca6d8..a405b17f35c4e 100644 --- a/libs/core/tests/unit_tests/prompts/test_structured.py +++ b/libs/core/tests/unit_tests/prompts/test_structured.py @@ -79,7 +79,7 @@ def test_structured_prompt_dict() -> None: assert chain.invoke({"hello": "there"}) == {"name": 1, "value": 42} - assert loads(dumps(prompt)) == prompt + assert loads(dumps(prompt)).model_dump() == prompt.model_dump() chain = loads(dumps(prompt)) | model @@ -104,7 +104,7 @@ def test_structured_prompt_kwargs() -> None: model = FakeStructuredChatModel(responses=[]) chain = prompt | model assert chain.invoke({"hello": "there"}) == {"name": 1, "value": 7} - assert loads(dumps(prompt)) == prompt + assert loads(dumps(prompt)).model_dump() == prompt.model_dump() chain = loads(dumps(prompt)) | model assert chain.invoke({"hello": "there"}) == {"name": 1, "value": 7} diff --git a/libs/core/tests/unit_tests/pydantic_utils.py b/libs/core/tests/unit_tests/pydantic_utils.py index 10a3318c7ba92..a97ca6c0b257f 100644 --- a/libs/core/tests/unit_tests/pydantic_utils.py +++ b/libs/core/tests/unit_tests/pydantic_utils.py @@ -57,17 +57,20 @@ def remove_all_none_default(schema: Any) -> None: remove_all_none_default(item) -def _remove_enum_description(obj: Any) -> None: +def _remove_enum(obj: Any) -> None: """Remove the description from enums.""" if isinstance(obj, dict): if "enum" in obj: if "description" in obj and obj["description"] == "An enumeration.": del obj["description"] + if "type" in obj and obj["type"] == "string": + del obj["type"] + del obj["enum"] for value in obj.values(): - _remove_enum_description(value) + _remove_enum(value) elif isinstance(obj, list): for item in obj: - _remove_enum_description(item) + _remove_enum(item) def _schema(obj: Any) -> dict: @@ -91,7 +94,7 @@ def _schema(obj: Any) -> dict: replace_all_of_with_ref(schema_) remove_all_none_default(schema_) - _remove_enum_description(schema_) + _remove_enum(schema_) return schema_ @@ -118,5 +121,5 @@ def _normalize_schema(obj: Any) -> Dict[str, Any]: data = obj remove_all_none_default(data) replace_all_of_with_ref(data) - _remove_enum_description(data) + _remove_enum(data) return data diff --git a/libs/core/tests/unit_tests/runnables/__snapshots__/test_graph.ambr b/libs/core/tests/unit_tests/runnables/__snapshots__/test_graph.ambr index a9fd8ebac4e51..aa70b9bb5a3e9 100644 --- a/libs/core/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +++ b/libs/core/tests/unit_tests/runnables/__snapshots__/test_graph.ambr @@ -453,11 +453,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -569,11 +565,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -657,11 +649,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -735,11 +723,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -810,11 +794,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -876,11 +856,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -978,11 +954,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1056,11 +1028,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1123,11 +1091,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1222,11 +1186,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1295,11 +1255,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1347,11 +1303,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1429,11 +1381,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1493,7 +1441,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -1547,12 +1494,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -1561,11 +1503,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -1584,7 +1522,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -1638,12 +1575,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -1652,11 +1584,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ diff --git a/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr b/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr index 245ac4c6847fd..eb5e147204233 100644 --- a/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +++ b/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr @@ -624,13 +624,7 @@ dict({ '$defs': dict({ 'Chat_Responses': dict({ - 'enum': list([ - 'hello', - 'bye', - 'helpful', - ]), 'title': 'Chat Responses', - 'type': 'string', }), 'Configurable': dict({ 'properties': dict({ @@ -670,20 +664,10 @@ 'type': 'object', }), 'LLM': dict({ - 'enum': list([ - 'chat', - 'default', - ]), 'title': 'LLM', - 'type': 'string', }), 'Prompt_Template': dict({ - 'enum': list([ - 'hello', - 'good_morning', - ]), 'title': 'Prompt Template', - 'type': 'string', }), }), 'properties': dict({ @@ -699,13 +683,7 @@ dict({ 'definitions': dict({ 'Chat_Responses': dict({ - 'enum': list([ - 'hello', - 'bye', - 'helpful', - ]), 'title': 'Chat Responses', - 'type': 'string', }), 'Configurable': dict({ 'properties': dict({ @@ -757,20 +735,10 @@ 'type': 'object', }), 'LLM': dict({ - 'enum': list([ - 'chat', - 'default', - ]), 'title': 'LLM', - 'type': 'string', }), 'Prompt_Template': dict({ - 'enum': list([ - 'hello', - 'good_morning', - ]), 'title': 'Prompt Template', - 'type': 'string', }), }), 'properties': dict({ @@ -2087,11 +2055,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -2203,11 +2167,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -2291,11 +2251,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2369,11 +2325,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2444,11 +2396,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2510,11 +2458,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2612,11 +2556,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2690,11 +2630,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2757,11 +2693,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2856,11 +2788,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2929,11 +2857,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -2981,11 +2905,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3063,11 +2983,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3127,7 +3043,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -3181,12 +3096,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -3195,11 +3105,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3218,7 +3124,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -3272,12 +3177,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -3286,11 +3186,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3486,11 +3382,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -3602,11 +3494,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -3690,11 +3578,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3768,11 +3652,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3835,11 +3715,7 @@ 'type': dict({ 'const': 'ChatPromptValueConcrete', 'default': 'ChatPromptValueConcrete', - 'enum': list([ - 'ChatPromptValueConcrete', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3909,11 +3785,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -3975,11 +3847,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4077,11 +3945,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4155,11 +4019,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4222,11 +4082,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4248,11 +4104,7 @@ 'type': dict({ 'const': 'StringPromptValue', 'default': 'StringPromptValue', - 'enum': list([ - 'StringPromptValue', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4344,11 +4196,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4417,11 +4265,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4469,11 +4313,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4551,11 +4391,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4615,7 +4451,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -4669,12 +4504,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -4683,11 +4513,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4706,7 +4532,6 @@ 'type': 'object', }), 'artifact': dict({ - 'default': None, 'title': 'Artifact', }), 'content': dict({ @@ -4760,12 +4585,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -4774,11 +4594,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -4986,11 +4802,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -5102,11 +4914,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -5190,11 +4998,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5268,11 +5072,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5335,11 +5135,7 @@ 'type': dict({ 'const': 'ChatPromptValueConcrete', 'default': 'ChatPromptValueConcrete', - 'enum': list([ - 'ChatPromptValueConcrete', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5409,11 +5205,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5475,11 +5267,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5577,11 +5365,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5655,11 +5439,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5722,11 +5502,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5748,11 +5524,7 @@ 'type': dict({ 'const': 'StringPromptValue', 'default': 'StringPromptValue', - 'enum': list([ - 'StringPromptValue', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5844,11 +5616,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5917,11 +5685,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -5969,11 +5733,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6051,11 +5811,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6168,12 +5924,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -6182,11 +5933,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6258,12 +6005,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -6272,11 +6014,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6422,11 +6160,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -6538,11 +6272,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -6626,11 +6356,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6704,11 +6430,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6779,11 +6501,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6845,11 +6563,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -6947,11 +6661,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7025,11 +6735,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7092,11 +6798,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7191,11 +6893,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7264,11 +6962,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7316,11 +7010,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7398,11 +7088,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7515,12 +7201,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -7529,11 +7210,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7605,12 +7282,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -7619,11 +7291,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -7861,11 +7529,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -7977,11 +7641,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -8065,11 +7725,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8143,11 +7799,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8210,11 +7862,7 @@ 'type': dict({ 'const': 'ChatPromptValueConcrete', 'default': 'ChatPromptValueConcrete', - 'enum': list([ - 'ChatPromptValueConcrete', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8284,11 +7932,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8350,11 +7994,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8452,11 +8092,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8530,11 +8166,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8597,11 +8229,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8623,11 +8251,7 @@ 'type': dict({ 'const': 'StringPromptValue', 'default': 'StringPromptValue', - 'enum': list([ - 'StringPromptValue', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8719,11 +8343,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8792,11 +8412,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8844,11 +8460,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -8926,11 +8538,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9043,12 +8651,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -9057,11 +8660,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9133,12 +8732,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -9147,11 +8741,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9342,11 +8932,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -9458,11 +9044,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -9546,11 +9128,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9624,11 +9202,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9699,11 +9273,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9765,11 +9335,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9867,11 +9433,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -9945,11 +9507,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10012,11 +9570,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10111,11 +9665,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10184,11 +9734,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10236,11 +9782,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10318,11 +9860,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10435,12 +9973,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -10449,11 +9982,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10525,12 +10054,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -10539,11 +10063,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10689,11 +10209,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -10805,11 +10321,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -10893,11 +10405,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -10971,11 +10479,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11038,11 +10542,7 @@ 'type': dict({ 'const': 'ChatPromptValueConcrete', 'default': 'ChatPromptValueConcrete', - 'enum': list([ - 'ChatPromptValueConcrete', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11112,11 +10612,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11178,11 +10674,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11280,11 +10772,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11358,11 +10846,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11425,11 +10909,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11462,11 +10942,7 @@ 'type': dict({ 'const': 'StringPromptValue', 'default': 'StringPromptValue', - 'enum': list([ - 'StringPromptValue', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11558,11 +11034,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11631,11 +11103,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11683,11 +11151,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11765,11 +11229,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11882,12 +11342,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -11896,11 +11351,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -11972,12 +11423,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -11986,11 +11432,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12148,11 +11590,7 @@ 'type': dict({ 'const': 'ai', 'default': 'ai', - 'enum': list([ - 'ai', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -12264,11 +11702,7 @@ 'type': dict({ 'const': 'AIMessageChunk', 'default': 'AIMessageChunk', - 'enum': list([ - 'AIMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), 'usage_metadata': dict({ 'anyOf': list([ @@ -12352,11 +11786,7 @@ 'type': dict({ 'const': 'chat', 'default': 'chat', - 'enum': list([ - 'chat', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12430,11 +11860,7 @@ 'type': dict({ 'const': 'ChatMessageChunk', 'default': 'ChatMessageChunk', - 'enum': list([ - 'ChatMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12497,11 +11923,7 @@ 'type': dict({ 'const': 'ChatPromptValueConcrete', 'default': 'ChatPromptValueConcrete', - 'enum': list([ - 'ChatPromptValueConcrete', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12571,11 +11993,7 @@ 'type': dict({ 'const': 'function', 'default': 'function', - 'enum': list([ - 'function', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12637,11 +12055,7 @@ 'type': dict({ 'const': 'FunctionMessageChunk', 'default': 'FunctionMessageChunk', - 'enum': list([ - 'FunctionMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12739,11 +12153,7 @@ 'type': dict({ 'const': 'human', 'default': 'human', - 'enum': list([ - 'human', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12817,11 +12227,7 @@ 'type': dict({ 'const': 'HumanMessageChunk', 'default': 'HumanMessageChunk', - 'enum': list([ - 'HumanMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12884,11 +12290,7 @@ }), 'type': dict({ 'const': 'invalid_tool_call', - 'enum': list([ - 'invalid_tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -12910,11 +12312,7 @@ 'type': dict({ 'const': 'StringPromptValue', 'default': 'StringPromptValue', - 'enum': list([ - 'StringPromptValue', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -13006,11 +12404,7 @@ 'type': dict({ 'const': 'system', 'default': 'system', - 'enum': list([ - 'system', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -13079,11 +12473,7 @@ 'type': dict({ 'const': 'SystemMessageChunk', 'default': 'SystemMessageChunk', - 'enum': list([ - 'SystemMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -13131,11 +12521,7 @@ }), 'type': dict({ 'const': 'tool_call', - 'enum': list([ - 'tool_call', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -13213,11 +12599,7 @@ }), 'type': dict({ 'const': 'tool_call_chunk', - 'enum': list([ - 'tool_call_chunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -13330,12 +12712,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -13344,11 +12721,7 @@ 'type': dict({ 'const': 'tool', 'default': 'tool', - 'enum': list([ - 'tool', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ @@ -13420,12 +12793,7 @@ }), 'status': dict({ 'default': 'success', - 'enum': list([ - 'success', - 'error', - ]), 'title': 'Status', - 'type': 'string', }), 'tool_call_id': dict({ 'title': 'Tool Call Id', @@ -13434,11 +12802,7 @@ 'type': dict({ 'const': 'ToolMessageChunk', 'default': 'ToolMessageChunk', - 'enum': list([ - 'ToolMessageChunk', - ]), 'title': 'Type', - 'type': 'string', }), }), 'required': list([ diff --git a/libs/core/tests/unit_tests/runnables/test_graph.py b/libs/core/tests/unit_tests/runnables/test_graph.py index f31d7d9299d27..9f75682cdc31f 100644 --- a/libs/core/tests/unit_tests/runnables/test_graph.py +++ b/libs/core/tests/unit_tests/runnables/test_graph.py @@ -11,6 +11,7 @@ from langchain_core.runnables.base import Runnable, RunnableConfig from langchain_core.runnables.graph import Edge, Graph, Node from langchain_core.runnables.graph_mermaid import _escape_node_label +from tests.unit_tests.pydantic_utils import _normalize_schema def test_graph_single_runnable(snapshot: SnapshotAssertion) -> None: @@ -56,7 +57,7 @@ class Schema(BaseModel): graph.add_edge(answer, ask, conditional=True) graph.add_edge(answer, end, conditional=True) - assert graph.to_json() == snapshot + assert _normalize_schema(graph.to_json()) == snapshot assert graph.first_node() is start assert graph.last_node() is end # can't trim start or end node @@ -208,8 +209,10 @@ def conditional_str_parser(input: str) -> Runnable: } ) graph = sequence.get_graph() - assert graph.to_json(with_schemas=True) == snapshot(name="graph_with_schema") - assert graph.to_json() == snapshot(name="graph_no_schemas") + assert _normalize_schema(graph.to_json(with_schemas=True)) == snapshot( + name="graph_with_schema" + ) + assert _normalize_schema(graph.to_json()) == snapshot(name="graph_no_schemas") assert graph.draw_ascii() == snapshot(name="ascii") assert graph.draw_mermaid() == snapshot(name="mermaid") assert graph.draw_mermaid(with_styles=False) == snapshot(name="mermaid-simple") diff --git a/libs/core/tests/unit_tests/runnables/test_runnable.py b/libs/core/tests/unit_tests/runnables/test_runnable.py index 5aa6365c7c31d..cb6d16dd1cc9e 100644 --- a/libs/core/tests/unit_tests/runnables/test_runnable.py +++ b/libs/core/tests/unit_tests/runnables/test_runnable.py @@ -308,7 +308,7 @@ async def typed_async_lambda_impl(x: str) -> int: "title": "FakeRetrieverInput", "type": "string", } - assert fake_ret.get_output_jsonschema() == { + assert _normalize_schema(fake_ret.get_output_jsonschema()) == { "$defs": { "Document": { "description": "Class for storing a piece of text and " @@ -338,9 +338,7 @@ async def typed_async_lambda_impl(x: str) -> int: "type": { "const": "Document", "default": "Document", - "enum": ["Document"], "title": "Type", - "type": "string", }, }, "required": ["page_content"], @@ -373,10 +371,10 @@ async def typed_async_lambda_impl(x: str) -> int: ] ) - assert chat_prompt.get_input_jsonschema() == snapshot( + assert _normalize_schema(chat_prompt.get_input_jsonschema()) == snapshot( name="chat_prompt_input_schema" ) - assert chat_prompt.get_output_jsonschema() == snapshot( + assert _normalize_schema(chat_prompt.get_output_jsonschema()) == snapshot( name="chat_prompt_output_schema" ) @@ -392,7 +390,7 @@ async def typed_async_lambda_impl(x: str) -> int: prompt_mapper = PromptTemplate.from_template("Hello, {name}!").map() - assert prompt_mapper.get_input_jsonschema() == { + assert _normalize_schema(prompt_mapper.get_input_jsonschema()) == { "$defs": { "PromptInput": { "properties": {"name": {"title": "Name", "type": "string"}}, diff --git a/libs/core/tests/unit_tests/test_tools.py b/libs/core/tests/unit_tests/test_tools.py index 5baa9e3a2cb34..83a5b5956d9ee 100644 --- a/libs/core/tests/unit_tests/test_tools.py +++ b/libs/core/tests/unit_tests/test_tools.py @@ -18,13 +18,14 @@ Optional, Tuple, Type, + TypeVar, Union, ) import pytest from pydantic import BaseModel, Field, ValidationError from pydantic.v1 import BaseModel as BaseModelV1 -from typing_extensions import Annotated, TypedDict, TypeVar +from typing_extensions import Annotated, TypedDict from langchain_core import tools from langchain_core.callbacks import ( @@ -1875,7 +1876,6 @@ def test__is_message_content_type(obj: Any, expected: bool) -> None: @pytest.mark.skipif(PYDANTIC_MAJOR_VERSION != 2, reason="Testing pydantic v2.") @pytest.mark.parametrize("use_v1_namespace", [True, False]) -@pytest.mark.filterwarnings("error") def test__get_all_basemodel_annotations_v2(use_v1_namespace: bool) -> None: A = TypeVar("A") @@ -1888,9 +1888,9 @@ class ModelA(BM1, Generic[A], extra="allow"): from pydantic import BaseModel as BM2 from pydantic import ConfigDict - class ModelA(BM2, Generic[A], extra="allow"): # type: ignore[no-redef] + class ModelA(BM2, Generic[A]): # type: ignore[no-redef] a: A - model_config = ConfigDict(arbitrary_types_allowed=True) + model_config = ConfigDict(arbitrary_types_allowed=True, extra="allow") class ModelB(ModelA[str]): b: Annotated[ModelA[Dict[str, Any]], "foo"]