File size: 375 Bytes
0d0eac6
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def test_rag_pipeline(rag_chain, questions):
    results = []
    for question in questions:
        response = rag_chain.invoke({"question": question})
        results.append({
            "question": question,
            "answer": response['response']
        })
        print(f"Question: {question}")
        print(f"Answer: {response['response']}\n")
    return results