Module Usage#
Currently the following LlamaIndex modules are supported within a QueryPipeline. Remember, you can define your own!
LLMs (both completion and chat)#
Base class:
LLMIf chat model:
Input:
messages. Takes in anyList[ChatMessage]or any stringable input.Output:
output. OutputsChatResponse(stringable)
If completion model:
Input:
prompt. Takes in any stringable input.Output:
output. OutputsCompletionResponse(stringable)
Prompts#
Base class:
PromptTemplateInput: Prompt template variables. Each variable can be a stringable input.
Output:
output. Outputs formatted prompt string (stringable)
Query Engines#
Base class:
BaseQueryEngineInput:
input. Takes in any stringable input.Output:
output. OutputsResponse(stringable)
Query Transforms#
Base class:
BaseQueryTransformInput:
query_str,metadata(optional).query_stris any stringable input.Output:
query_str. Outputs string.
Retrievers#
Base class:
BaseRetrieverInput:
input. Takes in any stringable input.Output:
output. Outputs list of nodesList[BaseNode].
Output Parsers#
Base class:
BaseOutputParserInput:
input. Takes in any stringable input.Output:
output. Outputs whatever type output parser is supposed to parse out.
Postprocessors/Rerankers#
Base class:
BaseNodePostprocessorInput:
nodes,query_str(optional).nodesisList[BaseNode],query_stris any stringable input.Output:
nodes. Outputs list of nodesList[BaseNode].
Response Synthesizers#
Base class:
BaseSynthesizerInput:
nodes,query_str.nodesisList[BaseNode],query_stris any stringable input.Output:
output. OutputsResponseobject (stringable).
Other QueryPipeline objects#
You can define a QueryPipeline as a module within another query pipeline. This makes it easy for you to string together complex workflows.
Custom Components#
See our custom components guide for more details.