File size: 471 Bytes
fc2385b
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def get_response(user_input: str, scraped_data: str) -> str:
    user_input_lower = user_input.lower()
    scraped_data_lower = scraped_data.lower()

    print("User Input:", user_input_lower)
    print("Scraped Data:", scraped_data_lower)

    if "birthplace" in user_input_lower and "imran khan" in scraped_data_lower:
        return "Imran Khan was born in Lahore, Pakistan."
    else:
        return "I'm sorry, I couldn't find an answer based on the provided data."