Hi lakshmi
If you're looking to fall back to fetching answers from the internet when the information is not available in the private knowledge base (KB), you can implement conditional logic in your integration.
You mentioned using Azure Search credentials, so you might integrate an Azure Search service to query for information on the internet.
Depending on the results from the private KB and internet search, you can conditionally determine which response to provide to the user.
Look at this sample code
# User Query
user_query = get_user_input()
# Check Private KB
private_kb_response = query_private_kb(user_query)
if private_kb_response is not None:
# Return answer from private KB
return private_kb_response
else:
# Perform Internet Search using Azure Search
internet_search_response = query_internet_search(user_query)
if internet_search_response is not None:
# Return answer from internet search
return internet_search_response
else:
# Return a default response or inform the user that no answer was found
return "I'm sorry, I couldn't find an answer to your question."
If you find this useful kindly accept the answer thanks much.