Can we use Azure open AI service for private data usage and also for data from internet

lakshmi 671 Reputation points
2023-11-27T17:07:34.4+00:00

We have tried to integrate the Azure open ai service with the bot framework.

We were able to add private data in azure open ai and able to fetch answers from the data provided.

But after integrating the private data, we were not able to fetch the general data from the internet. We have changed the search options in the request as we need to include azure search credentials also. Can we use the same deployment model to fetch the answers from internet if the answer is not there in the private kb

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,627 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Azar 22,115 Reputation points MVP
    2023-11-27T19:52:34+00:00

    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.