Find answers from the community

Updated 8 months ago

class SimilarityNodePostprocessor(

class SimilarityNodePostprocessor(BaseNodePostprocessor):
def _postprocess_nodes(
self, nodes: List[TextNode], query_bundle: Optional[QueryBundle], value: Optional[int] = None
) -> List[TextNode]:
results = []
for n in nodes:
if n.metadata['x'] == value:
results.append(n)
return results


assemble query engine

query_engine = RetrieverQueryEngine(
retriever=retriever,
response_synthesizer=response_synthesizer,
node_postprocessors=[SimilarityNodePostprocessor()],
)

i am passing the value and nodes and this return this error hwo can i pass the value and nodes to this class
L
1 comment
What is the error?
Add a reply
Sign up and join the conversation on Discord