haive.core.engine.retriever.providers.WikipediaRetrieverConfigΒΆ
Wikipedia Retriever implementation for the Haive framework.
from typing import Any This module provides a configuration class for the Wikipedia retriever, which retrieves articles from Wikipedia based on search queries.
The WikipediaRetriever works by: 1. Taking a search query 2. Searching Wikipedia for matching articles 3. Returning article content as documents
This retriever is particularly useful when: - Need access to encyclopedic knowledge - Building general knowledge applications - Combining with other retrievers for comprehensive coverage - Providing factual background information
The implementation integrates with LangChainβs WikipediaRetriever while providing a consistent Haive configuration interface.
ClassesΒΆ
Configuration for Wikipedia retriever in the Haive framework. |
Module ContentsΒΆ
- class haive.core.engine.retriever.providers.WikipediaRetrieverConfig.WikipediaRetrieverConfig[source]ΒΆ
Bases:
haive.core.engine.retriever.retriever.BaseRetrieverConfig
Configuration for Wikipedia retriever in the Haive framework.
This retriever searches Wikipedia for articles matching the query and returns their content as documents.
- retriever_typeΒΆ
The type of retriever (always WIKIPEDIA).
- Type:
Examples
>>> from haive.core.engine.retriever import WikipediaRetrieverConfig >>> >>> # Create the wikipedia retriever config >>> config = WikipediaRetrieverConfig( ... name="wikipedia_retriever", ... top_k_results=5, ... lang="en" ... ) >>> >>> # Instantiate and use the retriever >>> retriever = config.instantiate() >>> docs = retriever.get_relevant_documents("artificial intelligence")
- instantiate()[source]ΒΆ
Create a Wikipedia retriever from this configuration.
- Returns:
Instantiated retriever ready for document retrieval.
- Return type:
WikipediaRetriever
- Raises:
ImportError β If required packages are not available.