Skip to content

Commit

Permalink
Move WebRetriever's new init parameter to last parameter position (#5673
Browse files Browse the repository at this point in the history
)
  • Loading branch information
vblagoje authored Aug 29, 2023
1 parent fbc1951 commit a9b8fd9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions haystack/nodes/retriever/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def __init__(
self,
api_key: str,
search_engine_provider: Union[str, SearchEngine] = "SerperDev",
allowed_domains: Optional[List[str]] = None,
link_content_fetcher: Optional[LinkContentFetcher] = None,
top_search_results: Optional[int] = 10,
top_k: Optional[int] = 5,
mode: Literal["snippets", "raw_documents", "preprocessed_documents"] = "snippets",
Expand All @@ -60,13 +58,12 @@ def __init__(
cache_index: Optional[str] = None,
cache_headers: Optional[Dict[str, str]] = None,
cache_time: int = 1 * 24 * 60 * 60,
allowed_domains: Optional[List[str]] = None,
link_content_fetcher: Optional[LinkContentFetcher] = None,
):
"""
:param api_key: API key for the search engine provider.
:param search_engine_provider: Name of the search engine provider class, see `providers.py` for a list of supported providers.
:param allowed_domains: List of domains to restrict the search to. If not provided, the search is unrestricted.
:param link_content_fetcher: LinkContentFetcher to be used to fetch the content from the links. If not provided,
the default LinkContentFetcher is used.
:param top_search_results: Number of top search results to be retrieved.
:param top_k: Top k documents to be returned by the retriever.
:param mode: Whether to return snippets, raw documents, or preprocessed documents. Snippets are the default.
Expand All @@ -75,6 +72,10 @@ def __init__(
:param cache_index: Index name to be used to cache search results.
:param cache_headers: Headers to be used to cache search results.
:param cache_time: Time in seconds to cache search results. Defaults to 24 hours.
:param allowed_domains: List of domains to restrict the search to. If not provided, the search is unrestricted.
:param link_content_fetcher: LinkContentFetcher to be used to fetch the content from the links. If not provided,
the default LinkContentFetcher is used.
"""
super().__init__()
self.web_search = WebSearch(
Expand Down

0 comments on commit a9b8fd9

Please sign in to comment.