Skip to content

Commit

Permalink
Fixed up test_vectorstore. (#16113)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyclements authored Sep 19, 2024
1 parent 52fb788 commit a18b946
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-vector-stores-mongodb"
readme = "README.md"
version = "0.3.0"
version = "0.3.1"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def documents() -> List[Document]:
text = Document.example().text
metadata = Document.example().metadata
texts = text.split("\n")
return [Document(text=text, metadata=metadata) for text in texts]
return [Document(text=text, metadata={"text": text}) for text in texts]


@pytest.fixture(scope="session")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_vectorstore(
"How do we best augment LLMs with our own private data?",
"easily used with LLMs.",
]
filters_compoound = MetadataFilters(
filters_compound = MetadataFilters(
condition=FilterCondition.AND,
filters=[
MetadataFilter(
Expand All @@ -122,7 +122,7 @@ def test_vectorstore(
query_str=query_str,
query_embedding=query_embedding,
similarity_top_k=n_similar,
filters=filters_compoound,
filters=filters_compound,
)
responses_with_filter_compound = vector_store.query(query=query)
assert len(responses_with_filter_compound.ids) == n_similar
Expand Down Expand Up @@ -158,7 +158,7 @@ def test_vectorstore(
query = VectorStoreQuery(
query_str="llamaindex",
query_embedding=query_embedding, # "What are LLMs useful for?"
hybrid_top_k=n_similar,
similarity_top_k=n_similar,
mode=VectorStoreQueryMode.HYBRID,
alpha=0.5,
)
Expand Down

0 comments on commit a18b946

Please sign in to comment.