前/后处理器
通过对提示词和检索结果进行前/后处理来改进 RAG 输出。
预处理器
查询转换
namespace App\Neuron;
use NeuronAI\RAG\RAG;
use NeuronAI\RAG\PreProcessor\QueryTransformationPreProcessor;
use NeuronAI\RAG\PreProcessor\QueryTransformationType;
class MyChatBot extends RAG
{
...
protected function preProcessors(): array
{
return [
new QueryTransformationPreProcessor(
provider: $this->resolveProvider(),
transformation: QueryTransformationType::REWRITING,
),
];
}
}后处理器
重排序器
Jina 重排序器
Cohere 重排序器
固定阈值
自适应阈值
LocalAI 重排序器
监控

扩展框架
最后更新于