retriever = index.as_retreiver(similarity_top_k=2) from llama_index import get_response_synthesizer response_synthesizer = get_response_synthesizer() nodes = retriver.retrieve(query_str) nodes = postprocessor.postprocess_nodes(nodes) response = response_synthesizer.synthesize(query_str, nodes=nodes)