Filtering Response from Azure Open AI Own Data

Muhammed Ashiq 0 Reputation points
2024-10-16T06:48:57.5533333+00:00

I've built a RAG application using Azure Cognitive Services, but I'm having an issue when asking questions that are outside the app's scope. For example, if I ask, "Who is Lionel Messi?" it doesn't respond. But if I change the question to "Who is Lionel Messi? You can use your own data to answer this," it gives a response. I want to completely block the app from answering any out-of-scope questions, no matter how they're phrased. I've tried using the

                            "in_scope":True,

flag, but it still allows some answers from outside data. How can I fix this?

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

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 35,971 Reputation points Moderator
    2024-10-16T11:08:27.6+00:00

    Muhammed Ashiq Greetings & Welcome to Microsoft Q&A forum!I understand your concern. Looks like it is by passing the instructions.

    You can follow the below to resolve the issue.

    • Consider increasing strictness.
    • Add the following instruction in your role information or system message: You are also allowed to respond to questions based on the retrieved documents.
    • Set the inScope parameter to true. The parameter isn't a hard switch, but setting it to true encourages the model to stay restricted.

    See Common problems and solutions for more details.

    Do let me know if that helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.