Skip to content

Commit d9c48f3

Browse files
committed
SPDX headers
1 parent a035c79 commit d9c48f3

6 files changed

Lines changed: 26 additions & 8 deletions

File tree

integrations/valkey/examples/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# git clone https://github.com/anakin87/neural-search-pills
77

88
# Run example
9-
# uv run examples/pipeline_example.py
9+
# uv run examples/example.py
1010

1111
# Create the indexing Pipeline and index some documents
1212

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
from .embedding_retriever import ValkeyEmbeddingRetriever
26

37
__all__ = ["ValkeyEmbeddingRetriever"]

integrations/valkey/src/haystack_integrations/components/retrievers/valkey/embedding_retriever.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from __future__ import annotations
1+
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
24

3-
from typing import Any
5+
from typing import Any, Optional, Union
46

57
from haystack import component, default_from_dict, default_to_dict
68
from haystack.dataclasses import Document
@@ -61,9 +63,9 @@ def __init__(
6163
self,
6264
*,
6365
document_store: ValkeyDocumentStore,
64-
filters: dict[str, Any] | None = None,
66+
filters: Optional[dict[str, Any]] = None,
6567
top_k: int = 10,
66-
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
68+
filter_policy: Union[str, FilterPolicy] = FilterPolicy.REPLACE,
6769
):
6870
"""
6971
:param document_store: The Valkey Document Store.
@@ -99,7 +101,7 @@ def to_dict(self) -> dict[str, Any]:
99101
)
100102

101103
@classmethod
102-
def from_dict(cls, data: dict[str, Any]) -> ValkeyEmbeddingRetriever:
104+
def from_dict(cls, data: dict[str, Any]) -> "ValkeyEmbeddingRetriever":
103105
"""
104106
Deserializes the component from a dictionary.
105107
:param data:
@@ -120,8 +122,8 @@ def from_dict(cls, data: dict[str, Any]) -> ValkeyEmbeddingRetriever:
120122
def run(
121123
self,
122124
query_embedding: list[float],
123-
filters: dict[str, Any] | None = None,
124-
top_k: int | None = None,
125+
filters: Optional[dict[str, Any]] = None,
126+
top_k: Optional[int] = None,
125127
) -> dict[str, list[Document]]:
126128
"""
127129
Retrieve documents from the `ValkeyDocumentStore`, based on their dense embeddings.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
from .document_store import ValkeyDocumentStore, ValkeyDocumentStoreError
26

37
__all__ = ("ValkeyDocumentStore", "ValkeyDocumentStoreError")

integrations/valkey/src/haystack_integrations/document_stores/valkey/document_store.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
from __future__ import annotations
26

37
import asyncio

integrations/valkey/src/haystack_integrations/document_stores/valkey/filters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
"""Valkey document store filtering utilities.
26
37
This module provides filter conversion from Haystack's filter format to Valkey Search query syntax.

0 commit comments

Comments
 (0)