diff --git a/libs/partners/voyageai/poetry.lock b/libs/partners/voyageai/poetry.lock index fe75394e67b10..ce14515802589 100644 --- a/libs/partners/voyageai/poetry.lock +++ b/libs/partners/voyageai/poetry.lock @@ -606,52 +606,49 @@ files = [ [[package]] name = "mypy" -version = "0.991" +version = "1.11.2" description = "Optional static typing for Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "mypy-0.991-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7d17e0a9707d0772f4a7b878f04b4fd11f6f5bcb9b3813975a9b13c9332153ab"}, - {file = "mypy-0.991-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0714258640194d75677e86c786e80ccf294972cc76885d3ebbb560f11db0003d"}, - {file = "mypy-0.991-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c8f3be99e8a8bd403caa8c03be619544bc2c77a7093685dcf308c6b109426c6"}, - {file = "mypy-0.991-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc9ec663ed6c8f15f4ae9d3c04c989b744436c16d26580eaa760ae9dd5d662eb"}, - {file = "mypy-0.991-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4307270436fd7694b41f913eb09210faff27ea4979ecbcd849e57d2da2f65305"}, - {file = "mypy-0.991-cp310-cp310-win_amd64.whl", hash = "sha256:901c2c269c616e6cb0998b33d4adbb4a6af0ac4ce5cd078afd7bc95830e62c1c"}, - {file = "mypy-0.991-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d13674f3fb73805ba0c45eb6c0c3053d218aa1f7abead6e446d474529aafc372"}, - {file = "mypy-0.991-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1c8cd4fb70e8584ca1ed5805cbc7c017a3d1a29fb450621089ffed3e99d1857f"}, - {file = "mypy-0.991-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:209ee89fbb0deed518605edddd234af80506aec932ad28d73c08f1400ef80a33"}, - {file = "mypy-0.991-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37bd02ebf9d10e05b00d71302d2c2e6ca333e6c2a8584a98c00e038db8121f05"}, - {file = "mypy-0.991-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:26efb2fcc6b67e4d5a55561f39176821d2adf88f2745ddc72751b7890f3194ad"}, - {file = "mypy-0.991-cp311-cp311-win_amd64.whl", hash = "sha256:3a700330b567114b673cf8ee7388e949f843b356a73b5ab22dd7cff4742a5297"}, - {file = "mypy-0.991-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:1f7d1a520373e2272b10796c3ff721ea1a0712288cafaa95931e66aa15798813"}, - {file = "mypy-0.991-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:641411733b127c3e0dab94c45af15fea99e4468f99ac88b39efb1ad677da5711"}, - {file = "mypy-0.991-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3d80e36b7d7a9259b740be6d8d906221789b0d836201af4234093cae89ced0cd"}, - {file = "mypy-0.991-cp37-cp37m-win_amd64.whl", hash = "sha256:e62ebaad93be3ad1a828a11e90f0e76f15449371ffeecca4a0a0b9adc99abcef"}, - {file = "mypy-0.991-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b86ce2c1866a748c0f6faca5232059f881cda6dda2a893b9a8373353cfe3715a"}, - {file = "mypy-0.991-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ac6e503823143464538efda0e8e356d871557ef60ccd38f8824a4257acc18d93"}, - {file = "mypy-0.991-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0cca5adf694af539aeaa6ac633a7afe9bbd760df9d31be55ab780b77ab5ae8bf"}, - {file = "mypy-0.991-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a12c56bf73cdab116df96e4ff39610b92a348cc99a1307e1da3c3768bbb5b135"}, - {file = "mypy-0.991-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:652b651d42f155033a1967739788c436491b577b6a44e4c39fb340d0ee7f0d70"}, - {file = "mypy-0.991-cp38-cp38-win_amd64.whl", hash = "sha256:4175593dc25d9da12f7de8de873a33f9b2b8bdb4e827a7cae952e5b1a342e243"}, - {file = "mypy-0.991-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:98e781cd35c0acf33eb0295e8b9c55cdbef64fcb35f6d3aa2186f289bed6e80d"}, - {file = "mypy-0.991-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6d7464bac72a85cb3491c7e92b5b62f3dcccb8af26826257760a552a5e244aa5"}, - {file = "mypy-0.991-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c9166b3f81a10cdf9b49f2d594b21b31adadb3d5e9db9b834866c3258b695be3"}, - {file = "mypy-0.991-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8472f736a5bfb159a5e36740847808f6f5b659960115ff29c7cecec1741c648"}, - {file = "mypy-0.991-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e80e758243b97b618cdf22004beb09e8a2de1af481382e4d84bc52152d1c476"}, - {file = "mypy-0.991-cp39-cp39-win_amd64.whl", hash = "sha256:74e259b5c19f70d35fcc1ad3d56499065c601dfe94ff67ae48b85596b9ec1461"}, - {file = "mypy-0.991-py3-none-any.whl", hash = "sha256:de32edc9b0a7e67c2775e574cb061a537660e51210fbf6006b0b36ea695ae9bb"}, - {file = "mypy-0.991.tar.gz", hash = "sha256:3c0165ba8f354a6d9881809ef29f1a9318a236a6d81c690094c5df32107bde06"}, + {file = "mypy-1.11.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d42a6dd818ffce7be66cce644f1dff482f1d97c53ca70908dff0b9ddc120b77a"}, + {file = "mypy-1.11.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:801780c56d1cdb896eacd5619a83e427ce436d86a3bdf9112527f24a66618fef"}, + {file = "mypy-1.11.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:41ea707d036a5307ac674ea172875f40c9d55c5394f888b168033177fce47383"}, + {file = "mypy-1.11.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6e658bd2d20565ea86da7d91331b0eed6d2eee22dc031579e6297f3e12c758c8"}, + {file = "mypy-1.11.2-cp310-cp310-win_amd64.whl", hash = "sha256:478db5f5036817fe45adb7332d927daa62417159d49783041338921dcf646fc7"}, + {file = "mypy-1.11.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:75746e06d5fa1e91bfd5432448d00d34593b52e7e91a187d981d08d1f33d4385"}, + {file = "mypy-1.11.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a976775ab2256aadc6add633d44f100a2517d2388906ec4f13231fafbb0eccca"}, + {file = "mypy-1.11.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cd953f221ac1379050a8a646585a29574488974f79d8082cedef62744f0a0104"}, + {file = "mypy-1.11.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:57555a7715c0a34421013144a33d280e73c08df70f3a18a552938587ce9274f4"}, + {file = "mypy-1.11.2-cp311-cp311-win_amd64.whl", hash = "sha256:36383a4fcbad95f2657642a07ba22ff797de26277158f1cc7bd234821468b1b6"}, + {file = "mypy-1.11.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e8960dbbbf36906c5c0b7f4fbf2f0c7ffb20f4898e6a879fcf56a41a08b0d318"}, + {file = "mypy-1.11.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:06d26c277962f3fb50e13044674aa10553981ae514288cb7d0a738f495550b36"}, + {file = "mypy-1.11.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6e7184632d89d677973a14d00ae4d03214c8bc301ceefcdaf5c474866814c987"}, + {file = "mypy-1.11.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3a66169b92452f72117e2da3a576087025449018afc2d8e9bfe5ffab865709ca"}, + {file = "mypy-1.11.2-cp312-cp312-win_amd64.whl", hash = "sha256:969ea3ef09617aff826885a22ece0ddef69d95852cdad2f60c8bb06bf1f71f70"}, + {file = "mypy-1.11.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:37c7fa6121c1cdfcaac97ce3d3b5588e847aa79b580c1e922bb5d5d2902df19b"}, + {file = "mypy-1.11.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4a8a53bc3ffbd161b5b2a4fff2f0f1e23a33b0168f1c0778ec70e1a3d66deb86"}, + {file = "mypy-1.11.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ff93107f01968ed834f4256bc1fc4475e2fecf6c661260066a985b52741ddce"}, + {file = "mypy-1.11.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:edb91dded4df17eae4537668b23f0ff6baf3707683734b6a818d5b9d0c0c31a1"}, + {file = "mypy-1.11.2-cp38-cp38-win_amd64.whl", hash = "sha256:ee23de8530d99b6db0573c4ef4bd8f39a2a6f9b60655bf7a1357e585a3486f2b"}, + {file = "mypy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:801ca29f43d5acce85f8e999b1e431fb479cb02d0e11deb7d2abb56bdaf24fd6"}, + {file = "mypy-1.11.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:af8d155170fcf87a2afb55b35dc1a0ac21df4431e7d96717621962e4b9192e70"}, + {file = "mypy-1.11.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f7821776e5c4286b6a13138cc935e2e9b6fde05e081bdebf5cdb2bb97c9df81d"}, + {file = "mypy-1.11.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:539c570477a96a4e6fb718b8d5c3e0c0eba1f485df13f86d2970c91f0673148d"}, + {file = "mypy-1.11.2-cp39-cp39-win_amd64.whl", hash = "sha256:3f14cd3d386ac4d05c5a39a51b84387403dadbd936e17cb35882134d4f8f0d24"}, + {file = "mypy-1.11.2-py3-none-any.whl", hash = "sha256:b499bc07dbdcd3de92b0a8b29fdf592c111276f6a12fe29c30f6c417dd546d12"}, + {file = "mypy-1.11.2.tar.gz", hash = "sha256:7f9993ad3e0ffdc95c2a14b66dee63729f021968bff8ad911867579c65d13a79"}, ] [package.dependencies] -mypy-extensions = ">=0.4.3" +mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=3.10" +typing-extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] install-types = ["pip"] -python2 = ["typed-ast (>=1.4.0,<2)"] +mypyc = ["setuptools (>=50)"] reports = ["lxml"] [[package]] @@ -1157,17 +1154,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typing-extensions" -version = "4.11.0" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, -] - [[package]] name = "typing-extensions" version = "4.12.2" @@ -1361,4 +1347,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "1fef9f0e2bb00d52d9637052073509f2c733acb2520111221ebefb283965d10f" +content-hash = "8f634bbfc6b06935c5a110440d7ce93a3e35854d00d6bc8e0b76172efc3b33ad" diff --git a/libs/partners/voyageai/pyproject.toml b/libs/partners/voyageai/pyproject.toml index 2d19dd5241031..108a28c7caf79 100644 --- a/libs/partners/voyageai/pyproject.toml +++ b/libs/partners/voyageai/pyproject.toml @@ -55,7 +55,7 @@ optional = true ruff = "^0.1.5" [tool.poetry.group.typing.dependencies] -mypy = "^0.991" +mypy = "^1.10" langchain-core = { path = "../../core", develop = true } [tool.poetry.group.dev] diff --git a/libs/partners/voyageai/tests/integration_tests/test_embeddings.py b/libs/partners/voyageai/tests/integration_tests/test_embeddings.py index 0a958ccc2de26..532ded1756ce4 100644 --- a/libs/partners/voyageai/tests/integration_tests/test_embeddings.py +++ b/libs/partners/voyageai/tests/integration_tests/test_embeddings.py @@ -9,7 +9,7 @@ def test_langchain_voyageai_embedding_documents() -> None: """Test voyage embeddings.""" documents = ["foo bar"] - embedding = VoyageAIEmbeddings(model=MODEL) + embedding = VoyageAIEmbeddings(model=MODEL) # type: ignore[call-arg] output = embedding.embed_documents(documents) assert len(output) == 1 assert len(output[0]) == 1024 @@ -29,7 +29,7 @@ def test_langchain_voyageai_embedding_documents_multiple() -> None: def test_langchain_voyageai_embedding_query() -> None: """Test voyage embeddings.""" document = "foo bar" - embedding = VoyageAIEmbeddings(model=MODEL) + embedding = VoyageAIEmbeddings(model=MODEL) # type: ignore[call-arg] output = embedding.embed_query(document) assert len(output) == 1024 @@ -48,6 +48,6 @@ async def test_langchain_voyageai_async_embedding_documents_multiple() -> None: async def test_langchain_voyageai_async_embedding_query() -> None: """Test voyage embeddings.""" document = "foo bar" - embedding = VoyageAIEmbeddings(model=MODEL) + embedding = VoyageAIEmbeddings(model=MODEL) # type: ignore[call-arg] output = await embedding.aembed_query(document) assert len(output) == 1024 diff --git a/libs/partners/voyageai/tests/integration_tests/test_rerank.py b/libs/partners/voyageai/tests/integration_tests/test_rerank.py index e4c88f5adbcaf..3e18ca0366eb7 100644 --- a/libs/partners/voyageai/tests/integration_tests/test_rerank.py +++ b/libs/partners/voyageai/tests/integration_tests/test_rerank.py @@ -9,12 +9,12 @@ def test_voyageai_reranker_init() -> None: """Test the voyageai reranker initializes correctly.""" - VoyageAIRerank(voyage_api_key="foo", model="foo") + VoyageAIRerank(voyage_api_key="foo", model="foo") # type: ignore[arg-type] def test_sync() -> None: rerank = VoyageAIRerank( - voyage_api_key=os.environ["VOYAGE_API_KEY"], + voyage_api_key=os.environ["VOYAGE_API_KEY"], # type: ignore[arg-type] model="rerank-lite-1", ) doc_list = [ @@ -42,7 +42,7 @@ def test_sync() -> None: async def test_async() -> None: rerank = VoyageAIRerank( - voyage_api_key=os.environ["VOYAGE_API_KEY"], + voyage_api_key=os.environ["VOYAGE_API_KEY"], # type: ignore[arg-type] model="rerank-lite-1", ) doc_list = [ diff --git a/libs/partners/voyageai/tests/unit_tests/test_embeddings.py b/libs/partners/voyageai/tests/unit_tests/test_embeddings.py index 990ffeb5a97d3..354c2c6a32532 100644 --- a/libs/partners/voyageai/tests/unit_tests/test_embeddings.py +++ b/libs/partners/voyageai/tests/unit_tests/test_embeddings.py @@ -9,7 +9,7 @@ def test_initialization_voyage_2() -> None: """Test embedding model initialization.""" - emb = VoyageAIEmbeddings(api_key="NOT_A_VALID_KEY", model=MODEL) + emb = VoyageAIEmbeddings(api_key="NOT_A_VALID_KEY", model=MODEL) # type: ignore assert isinstance(emb, Embeddings) assert emb.batch_size == 72 assert emb.model == MODEL @@ -20,7 +20,7 @@ def test_initialization_voyage_2_with_full_api_key_name() -> None: """Test embedding model initialization.""" # Testing that we can initialize the model using `voyage_api_key` # instead of `api_key` - emb = VoyageAIEmbeddings(voyage_api_key="NOT_A_VALID_KEY", model=MODEL) + emb = VoyageAIEmbeddings(voyage_api_key="NOT_A_VALID_KEY", model=MODEL) # type: ignore assert isinstance(emb, Embeddings) assert emb.batch_size == 72 assert emb.model == MODEL @@ -29,7 +29,7 @@ def test_initialization_voyage_2_with_full_api_key_name() -> None: def test_initialization_voyage_1() -> None: """Test embedding model initialization.""" - emb = VoyageAIEmbeddings(api_key="NOT_A_VALID_KEY", model="voyage-01") + emb = VoyageAIEmbeddings(api_key="NOT_A_VALID_KEY", model="voyage-01") # type: ignore assert isinstance(emb, Embeddings) assert emb.batch_size == 7 assert emb.model == "voyage-01" @@ -39,7 +39,9 @@ def test_initialization_voyage_1() -> None: def test_initialization_voyage_1_batch_size() -> None: """Test embedding model initialization.""" emb = VoyageAIEmbeddings( - api_key="NOT_A_VALID_KEY", model="voyage-01", batch_size=15 + api_key="NOT_A_VALID_KEY", # type: ignore + model="voyage-01", + batch_size=15, ) assert isinstance(emb, Embeddings) assert emb.batch_size == 15 diff --git a/libs/partners/voyageai/tests/unit_tests/test_rerank.py b/libs/partners/voyageai/tests/unit_tests/test_rerank.py index d86b3c3d156e1..b12687dab855a 100644 --- a/libs/partners/voyageai/tests/unit_tests/test_rerank.py +++ b/libs/partners/voyageai/tests/unit_tests/test_rerank.py @@ -29,7 +29,7 @@ @pytest.mark.requires("voyageai") def test_init() -> None: VoyageAIRerank( - voyage_api_key="foo", + voyage_api_key="foo", # type: ignore[arg-type] model="rerank-lite-1", ) @@ -63,7 +63,7 @@ def test_rerank_unit_test(mocker: Any) -> None: ] rerank = VoyageAIRerank( - voyage_api_key="foo", + voyage_api_key="foo", # type: ignore[arg-type] model="rerank-lite-1", ) result = rerank.compress_documents( @@ -74,7 +74,7 @@ def test_rerank_unit_test(mocker: Any) -> None: def test_rerank_empty_input() -> None: rerank = VoyageAIRerank( - voyage_api_key="foo", + voyage_api_key="foo", # type: ignore[arg-type] model="rerank-lite-1", ) result = rerank.compress_documents(