Skip to content

Inquiry on Lab 6 and proposed solution to address it if it needs to be addressed #89

Open
@SDSTony

Description

Module: Implement Retrieval Augmented Generation (RAG) with Azure OpenAI Service

Lab/Demo: Instructions/Exercises/06-use-own-data.md

Task: Add code to use the Azure OpenAI service

Step: 1

Description of issue
I'm curious about the intention of the mentioned task above from the course design perspective. Is the underlying intention for the above task to use keyword search from Azure AI Search for retrieving the documents or to use vector search for the retrieval? If the intention is to use vector search to utilize the vector index of the Margie's Travel brochures that students have created from the previous steps, I believe current code does not utilize vector search for retrieval. We can verify this by looking at the metrics of the AOAI service.

image

When we use the current code, the metrics will show that only gpt-35-turbo-16k model is receiving requests when we send the user query using the ownData.py file. This implies that user query is not getting embedded with the same embedding model used to embed the brochures from the Margie's Travel.

If we implement the proposed changed in code shown below and send user query using the 'ownData.py' file, metrics will show that requests are now being sent to both gpt-35-turbo-16k and text-embedding-ada-002. This implies that user query is now being embedded with the same text-embedding-ada-002 model used to embed the source data(brochures from Margie's Travel) in order to perform vector search.

Repro steps:

  1. follow the current steps using the current code on Implement Retrieval Augmented Generation (RAG) with Azure OpenAI Service lab.
  2. implement the code changes below on ownData.py file to view the changes mentioned in the metrics shown above.
# Initialize the Azure OpenAI client
client = AzureOpenAI(
    azure_endpoint=azure_oai_endpoint,
    api_key=azure_oai_key,
    api_version="2024-05-01-preview")
# Configure your data source
extension_config = dict(data_sources = [
    {
        "type": "azure_search",
        "parameters": {
            "endpoint":azure_search_endpoint,
            "authentication": {
                "type": "api_key",
                "key": azure_search_key,
                },
            "index_name": azure_search_index,
            "query_type": "vector",
            "embedding_dependency": {
                "type": "deployment_name",
                "deployment_name": "text-embedding-ada-002",
                },
            }
        }]
    )

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions