mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-13 16:43:44 +00:00
Move WebRetriever's new init parameter to last parameter position (#5673)
This commit is contained in:
parent
fbc1951e74
commit
a9b8fd9658
@ -50,8 +50,6 @@ class WebRetriever(BaseRetriever):
|
|||||||
self,
|
self,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
search_engine_provider: Union[str, SearchEngine] = "SerperDev",
|
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_search_results: Optional[int] = 10,
|
||||||
top_k: Optional[int] = 5,
|
top_k: Optional[int] = 5,
|
||||||
mode: Literal["snippets", "raw_documents", "preprocessed_documents"] = "snippets",
|
mode: Literal["snippets", "raw_documents", "preprocessed_documents"] = "snippets",
|
||||||
@ -60,13 +58,12 @@ class WebRetriever(BaseRetriever):
|
|||||||
cache_index: Optional[str] = None,
|
cache_index: Optional[str] = None,
|
||||||
cache_headers: Optional[Dict[str, str]] = None,
|
cache_headers: Optional[Dict[str, str]] = None,
|
||||||
cache_time: int = 1 * 24 * 60 * 60,
|
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 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 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_search_results: Number of top search results to be retrieved.
|
||||||
:param top_k: Top k documents to be returned by the retriever.
|
: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.
|
:param mode: Whether to return snippets, raw documents, or preprocessed documents. Snippets are the default.
|
||||||
@ -75,6 +72,10 @@ class WebRetriever(BaseRetriever):
|
|||||||
:param cache_index: Index name to be used to cache search results.
|
: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_headers: Headers to be used to cache search results.
|
||||||
:param cache_time: Time in seconds to cache search results. Defaults to 24 hours.
|
: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__()
|
super().__init__()
|
||||||
self.web_search = WebSearch(
|
self.web_search = WebSearch(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user