Skip to content

Commit 3471183

Browse files
committed
chore: explicit input/output types
1 parent 69f28d9 commit 3471183

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/open_search_hybrid_retriever.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
66

7-
from haystack import Pipeline, default_from_dict, default_to_dict, logging, super_component
7+
from haystack import Document, Pipeline, component, default_from_dict, default_to_dict, logging, super_component
88
from haystack.components.embedders.types import TextEmbedder
99
from haystack.components.joiners import DocumentJoiner
1010
from haystack.components.joiners.document_joiner import JoinMode
@@ -239,8 +239,6 @@ def __init__(
239239

240240
def warm_up(self) -> None: ...
241241

242-
def run(self, query: str, filters_bm25=None, filters_embedding=None) -> Dict[str, Any]: ...
243-
244242
def _create_pipeline(self, data: dict[str, Any]) -> Pipeline:
245243
"""
246244
Create the pipeline for the OpenSearchHybridRetriever.
@@ -325,3 +323,15 @@ def from_dict(cls, data):
325323
data["init_parameters"]["join_mode"] = join_mode
326324

327325
return default_from_dict(cls, data)
326+
327+
@component.output_types(documents=List[Document])
328+
def run(
329+
self,
330+
query: str,
331+
filters_bm25: Optional[Dict[str, Any]] = None,
332+
filters_embedding: Optional[Dict[str, Any]] = None,
333+
**kwargs: Any, # noqa
334+
):
335+
# Technically not necessary to override this method
336+
# We only do it to have input/output types immediately available
337+
super().run(query=query, filters_bm25=filters_bm25, filters_embedding=filters_embedding) # type: ignore

0 commit comments

Comments
 (0)