Function
The Custom Server is used to store custom tool functions that cannot be classified into standard modules (such as Retriever, Generation, Evaluation, etc.). It provides developers with a flexible extension space for implementing various logical components that cooperate with core RAG modules, such as:- Data cleaning and preprocessing
- Keyword extraction or feature construction
- Specific task logic (such as answer extraction, formatting, filtering, etc.)
The Custom Server is your free toolbox — any functional logic that does not belong to core Servers can be defined and reused here.
Implementation Example
The following takes a common exampleoutput_extract_from_boxed to show how to customize and register a Tool.
servers/custom/src/custom.py
\boxed{...} format from the model output string,
and the output result will be mapped to the variable pred_ls for use by downstream evaluation or post-processing modules.
Usage Example
After defining the custom tool, you only need to register the custom module in the Pipeline and call the corresponding Tool:examples/rag_full.yaml
custom.output_extract_from_boxed is used to extract the standardized answer from the model output,
and then it is passed to evaluation.evaluate for evaluation.