From 669f9116f0eea5b6c5433c4bdd3b20de810dd77f Mon Sep 17 00:00:00 2001 From: Vladimir Blagojevic Date: Tue, 29 Aug 2023 15:53:34 +0200 Subject: [PATCH] Move WebRetriever's new init parameter to last parameter position --- haystack/nodes/retriever/web.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/haystack/nodes/retriever/web.py b/haystack/nodes/retriever/web.py index cfb50afd4f..6859f61dfd 100644 --- a/haystack/nodes/retriever/web.py +++ b/haystack/nodes/retriever/web.py @@ -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", @@ -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. @@ -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(