List Retriever#
Retrievers for SummaryIndex.
- llama_index.indices.list.retrievers.ListIndexEmbeddingRetriever#
alias of
SummaryIndexEmbeddingRetriever
- llama_index.indices.list.retrievers.ListIndexLLMRetriever#
alias of
SummaryIndexLLMRetriever
- llama_index.indices.list.retrievers.ListIndexRetriever#
alias of
SummaryIndexRetriever
- class llama_index.indices.list.retrievers.SummaryIndexEmbeddingRetriever(index: SummaryIndex, similarity_top_k: Optional[int] = 1, callback_manager: Optional[CallbackManager] = None, object_map: Optional[dict] = None, verbose: bool = False, **kwargs: Any)#
Embedding based retriever for SummaryIndex.
Generates embeddings in a lazy fashion for all nodes that are traversed.
- Parameters
index (SummaryIndex) โ The index to retrieve from.
similarity_top_k (Optional[int]) โ The number of top nodes to return.
- as_query_component(partial: Optional[Dict[str, Any]] = None, **kwargs: Any) QueryComponent #
Get query component.
- get_prompts() Dict[str, BasePromptTemplate] #
Get a prompt.
- get_service_context() Optional[ServiceContext] #
Attempts to resolve a service context. Short-circuits at self.service_context, self._service_context, or self._index.service_context.
- retrieve(str_or_query_bundle: Union[str, QueryBundle]) List[NodeWithScore] #
Retrieve nodes given query.
- Parameters
str_or_query_bundle (QueryType) โ Either a query string or a QueryBundle object.
- update_prompts(prompts_dict: Dict[str, BasePromptTemplate]) None #
Update prompts.
Other prompts will remain in place.
- class llama_index.indices.list.retrievers.SummaryIndexLLMRetriever(index: SummaryIndex, choice_select_prompt: Optional[PromptTemplate] = None, choice_batch_size: int = 10, format_node_batch_fn: Optional[Callable] = None, parse_choice_select_answer_fn: Optional[Callable] = None, service_context: Optional[ServiceContext] = None, callback_manager: Optional[CallbackManager] = None, object_map: Optional[dict] = None, verbose: bool = False, **kwargs: Any)#
LLM retriever for SummaryIndex.
- Parameters
index (SummaryIndex) โ The index to retrieve from.
choice_select_prompt (Optional[PromptTemplate]) โ A Choice-Select Prompt (see Prompt Templates).)
choice_batch_size (int) โ The number of nodes to query at a time.
format_node_batch_fn (Optional[Callable]) โ A function that formats a batch of nodes.
parse_choice_select_answer_fn (Optional[Callable]) โ A function that parses the choice select answer.
service_context (Optional[ServiceContext]) โ A service context.
- as_query_component(partial: Optional[Dict[str, Any]] = None, **kwargs: Any) QueryComponent #
Get query component.
- get_prompts() Dict[str, BasePromptTemplate] #
Get a prompt.
- get_service_context() Optional[ServiceContext] #
Attempts to resolve a service context. Short-circuits at self.service_context, self._service_context, or self._index.service_context.
- retrieve(str_or_query_bundle: Union[str, QueryBundle]) List[NodeWithScore] #
Retrieve nodes given query.
- Parameters
str_or_query_bundle (QueryType) โ Either a query string or a QueryBundle object.
- update_prompts(prompts_dict: Dict[str, BasePromptTemplate]) None #
Update prompts.
Other prompts will remain in place.
- class llama_index.indices.list.retrievers.SummaryIndexRetriever(index: SummaryIndex, callback_manager: Optional[CallbackManager] = None, object_map: Optional[dict] = None, verbose: bool = False, **kwargs: Any)#
Simple retriever for SummaryIndex that returns all nodes.
- Parameters
index (SummaryIndex) โ The index to retrieve from.
- as_query_component(partial: Optional[Dict[str, Any]] = None, **kwargs: Any) QueryComponent #
Get query component.
- get_prompts() Dict[str, BasePromptTemplate] #
Get a prompt.
- get_service_context() Optional[ServiceContext] #
Attempts to resolve a service context. Short-circuits at self.service_context, self._service_context, or self._index.service_context.
- retrieve(str_or_query_bundle: Union[str, QueryBundle]) List[NodeWithScore] #
Retrieve nodes given query.
- Parameters
str_or_query_bundle (QueryType) โ Either a query string or a QueryBundle object.
- update_prompts(prompts_dict: Dict[str, BasePromptTemplate]) None #
Update prompts.
Other prompts will remain in place.