Retriever Query Engine#
- class llama_index.query_engine.retriever_query_engine.RetrieverQueryEngine(retriever: BaseRetriever, response_synthesizer: Optional[BaseSynthesizer] = None, node_postprocessors: Optional[List[BaseNodePostprocessor]] = None, callback_manager: Optional[CallbackManager] = None)#
Retriever query engine.
- Parameters
retriever (BaseRetriever) β A retriever object.
response_synthesizer (Optional[BaseSynthesizer]) β A BaseSynthesizer object.
callback_manager (Optional[CallbackManager]) β A callback manager.
- as_query_component(partial: Optional[Dict[str, Any]] = None, **kwargs: Any) QueryComponent #
Get query component.
- classmethod from_args(retriever: BaseRetriever, response_synthesizer: Optional[BaseSynthesizer] = None, service_context: Optional[ServiceContext] = None, node_postprocessors: Optional[List[BaseNodePostprocessor]] = None, response_mode: ResponseMode = ResponseMode.COMPACT, text_qa_template: Optional[BasePromptTemplate] = None, refine_template: Optional[BasePromptTemplate] = None, summary_template: Optional[BasePromptTemplate] = None, simple_template: Optional[BasePromptTemplate] = None, output_cls: Optional[BaseModel] = None, use_async: bool = False, streaming: bool = False, **kwargs: Any) RetrieverQueryEngine #
Initialize a RetrieverQueryEngine object.β.
- Parameters
retriever (BaseRetriever) β A retriever object.
service_context (Optional[ServiceContext]) β A ServiceContext object.
node_postprocessors (Optional[List[BaseNodePostprocessor]]) β A list of node postprocessors.
verbose (bool) β Whether to print out debug info.
response_mode (ResponseMode) β A ResponseMode object.
text_qa_template (Optional[BasePromptTemplate]) β A BasePromptTemplate object.
refine_template (Optional[BasePromptTemplate]) β A BasePromptTemplate object.
simple_template (Optional[BasePromptTemplate]) β A BasePromptTemplate object.
use_async (bool) β Whether to use async.
streaming (bool) β Whether to use streaming.
optimizer (Optional[BaseTokenUsageOptimizer]) β A BaseTokenUsageOptimizer object.
- get_prompts() Dict[str, BasePromptTemplate] #
Get a prompt.
- property retriever: BaseRetriever#
Get the retriever object.
- update_prompts(prompts_dict: Dict[str, BasePromptTemplate]) None #
Update prompts.
Other prompts will remain in place.