Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SDSTony opened this issue Nov 2, 2024 · 0 comments

Comments

@SDSTony
Copy link

SDSTony commented Nov 2, 2024

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",
                },
            }
        }]
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant