mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
release(qdrant): 1.0.0a1 (#33236)
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
from collections.abc import Callable
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from itertools import islice
|
from itertools import islice
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING,
|
TYPE_CHECKING,
|
||||||
Any,
|
Any,
|
||||||
Callable,
|
|
||||||
Optional,
|
Optional,
|
||||||
Union,
|
Union,
|
||||||
)
|
)
|
||||||
@@ -1079,6 +1079,7 @@ class QdrantVectorStore(VectorStore):
|
|||||||
self.content_payload_key,
|
self.content_payload_key,
|
||||||
self.metadata_payload_key,
|
self.metadata_payload_key,
|
||||||
),
|
),
|
||||||
|
strict=False,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1153,7 +1154,7 @@ class QdrantVectorStore(VectorStore):
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
for dense_vector, sparse_vector in zip(
|
for dense_vector, sparse_vector in zip(
|
||||||
dense_embeddings, sparse_embeddings
|
dense_embeddings, sparse_embeddings, strict=False
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import functools
|
|||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
import warnings
|
import warnings
|
||||||
|
from collections.abc import Callable
|
||||||
from itertools import islice
|
from itertools import islice
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from typing import TYPE_CHECKING, Any, Callable, Optional, Union
|
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from langchain_core._api.deprecation import deprecated
|
from langchain_core._api.deprecation import deprecated
|
||||||
@@ -2242,6 +2243,7 @@ class Qdrant(VectorStore):
|
|||||||
self.content_payload_key,
|
self.content_payload_key,
|
||||||
self.metadata_payload_key,
|
self.metadata_payload_key,
|
||||||
),
|
),
|
||||||
|
strict=False,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2282,6 +2284,7 @@ class Qdrant(VectorStore):
|
|||||||
self.content_payload_key,
|
self.content_payload_key,
|
||||||
self.metadata_payload_key,
|
self.metadata_payload_key,
|
||||||
),
|
),
|
||||||
|
strict=False,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ build-backend = "pdm.backend"
|
|||||||
[project]
|
[project]
|
||||||
authors = []
|
authors = []
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
requires-python = ">=3.9.0,<4.0.0"
|
requires-python = ">=3.10.0,<4.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"qdrant-client>=1.10.1,<2.0.0",
|
"qdrant-client>=1.10.1,<2.0.0",
|
||||||
"pydantic>=2.7.4,<3.0.0",
|
"pydantic>=2.7.4,<3.0.0",
|
||||||
"langchain-core!=0.3.0,!=0.3.1,!=0.3.10,!=0.3.11,!=0.3.12,!=0.3.13,!=0.3.14,!=0.3.2,!=0.3.3,!=0.3.4,!=0.3.5,!=0.3.6,!=0.3.7,!=0.3.8,!=0.3.9,<0.4.0,>=0.2.43",
|
"langchain-core>=1.0.0a6,<2.0.0",
|
||||||
]
|
]
|
||||||
name = "langchain-qdrant"
|
name = "langchain-qdrant"
|
||||||
version = "0.2.1"
|
version = "1.0.0a1"
|
||||||
description = "An integration package connecting Qdrant and LangChain"
|
description = "An integration package connecting Qdrant and LangChain"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
@@ -49,9 +49,6 @@ typing = ["mypy>=1.10.0,<2.0.0", "simsimd>=6.0.0,<7.0.0", "langchain-core"]
|
|||||||
langchain-core = { path = "../../core", editable = true }
|
langchain-core = { path = "../../core", editable = true }
|
||||||
langchain-tests = { path = "../../standard-tests", editable = true }
|
langchain-tests = { path = "../../standard-tests", editable = true }
|
||||||
|
|
||||||
[tool.ruff]
|
|
||||||
target-version = "py39"
|
|
||||||
|
|
||||||
[tool.ruff.format]
|
[tool.ruff.format]
|
||||||
docstring-code-format = true
|
docstring-code-format = true
|
||||||
|
|
||||||
@@ -68,6 +65,7 @@ ignore = [
|
|||||||
"UP045", # pyupgrade: non-pep604-annotation-optional
|
"UP045", # pyupgrade: non-pep604-annotation-optional
|
||||||
"PLR0913", # Function has too many arguments
|
"PLR0913", # Function has too many arguments
|
||||||
"C901", # Complex functions
|
"C901", # Complex functions
|
||||||
|
"TC003",
|
||||||
|
|
||||||
# TODO"
|
# TODO"
|
||||||
"ANN401",
|
"ANN401",
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ async def test_qdrant_aadd_texts_stores_ids(
|
|||||||
["abc", "def"], ids=ids, batch_size=batch_size
|
["abc", "def"], ids=ids, batch_size=batch_size
|
||||||
)
|
)
|
||||||
|
|
||||||
assert all(first == second for first, second in zip(ids, returned_ids))
|
assert all(
|
||||||
|
first == second for first, second in zip(ids, returned_ids, strict=False)
|
||||||
|
)
|
||||||
assert client.count(collection_name).count == 2
|
assert client.count(collection_name).count == 2
|
||||||
stored_ids = [point.id for point in client.scroll(collection_name)[0]]
|
stored_ids = [point.id for point in client.scroll(collection_name)[0]]
|
||||||
assert set(ids) == set(stored_ids)
|
assert set(ids) == set(stored_ids)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def qdrant_running_locally() -> bool:
|
|||||||
def assert_documents_equals(actual: list[Document], expected: list[Document]) -> None: # type: ignore[no-untyped-def]
|
def assert_documents_equals(actual: list[Document], expected: list[Document]) -> None: # type: ignore[no-untyped-def]
|
||||||
assert len(actual) == len(expected)
|
assert len(actual) == len(expected)
|
||||||
|
|
||||||
for actual_doc, expected_doc in zip(actual, expected):
|
for actual_doc, expected_doc in zip(actual, expected, strict=False):
|
||||||
assert actual_doc.page_content == expected_doc.page_content
|
assert actual_doc.page_content == expected_doc.page_content
|
||||||
|
|
||||||
assert "_id" in actual_doc.metadata
|
assert "_id" in actual_doc.metadata
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ def test_qdrant_add_texts_stores_ids(batch_size: int) -> None:
|
|||||||
vec_store = Qdrant(client, collection_name, ConsistentFakeEmbeddings())
|
vec_store = Qdrant(client, collection_name, ConsistentFakeEmbeddings())
|
||||||
returned_ids = vec_store.add_texts(["abc", "def"], ids=ids, batch_size=batch_size)
|
returned_ids = vec_store.add_texts(["abc", "def"], ids=ids, batch_size=batch_size)
|
||||||
|
|
||||||
assert all(first == second for first, second in zip(ids, returned_ids))
|
assert all(
|
||||||
|
first == second for first, second in zip(ids, returned_ids, strict=False)
|
||||||
|
)
|
||||||
assert client.count(collection_name).count == 2
|
assert client.count(collection_name).count == 2
|
||||||
stored_ids = [point.id for point in client.scroll(collection_name)[0]]
|
stored_ids = [point.id for point in client.scroll(collection_name)[0]]
|
||||||
assert set(ids) == set(stored_ids)
|
assert set(ids) == set(stored_ids)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import TYPE_CHECKING, Callable, Optional
|
from collections.abc import Callable
|
||||||
|
from typing import TYPE_CHECKING, Optional
|
||||||
|
|
||||||
import pytest # type: ignore[import-not-found]
|
import pytest # type: ignore[import-not-found]
|
||||||
|
|
||||||
|
|||||||
2390
libs/partners/qdrant/uv.lock
generated
2390
libs/partners/qdrant/uv.lock
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user