microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.59k stars 2.48k forks source link

Vector Search #90

Closed guitaliba closed 12 months ago

guitaliba commented 1 year ago

Hello here!

Any plans to release a new version to support Cognitive Search Vector Search? This would be a huge improvement.

Thanks again!

sarah-widder commented 1 year ago

Hi @guitaliba yes, we are working on this. Stay tuned :)

joshsavachik commented 1 year ago

Hey there, wanted to check if there were any updates on Vector Search support!

andreas-amundsen commented 1 year ago

I am also curious to know when Vector Search will be supported. I have been trying to implement Vector Search myself by adjusting the code bellow from the app.py file, but I still haven't found a way that works.

def prepare_body_headers_with_data(request):
    request_messages = request.json["messages"]

    body = {
        "messages": request_messages,
        "temperature": float(AZURE_OPENAI_TEMPERATURE),
        "max_tokens": int(AZURE_OPENAI_MAX_TOKENS),
        "top_p": float(AZURE_OPENAI_TOP_P),
        "stop": AZURE_OPENAI_STOP_SEQUENCE.split("|") if AZURE_OPENAI_STOP_SEQUENCE else None,
        "stream": SHOULD_STREAM,
        "dataSources": [
            {
                "type": "AzureCognitiveSearch",
                "parameters": {
                    "endpoint": f"https://{AZURE_SEARCH_SERVICE}.search.windows.net",
                    "key": AZURE_SEARCH_KEY,
                    "indexName": AZURE_SEARCH_INDEX,
                    "fieldsMapping": {
                        "contentField": AZURE_SEARCH_CONTENT_COLUMNS.split("|") if AZURE_SEARCH_CONTENT_COLUMNS else [],
                        "titleField": AZURE_SEARCH_TITLE_COLUMN if AZURE_SEARCH_TITLE_COLUMN else None,
                        "urlField": AZURE_SEARCH_URL_COLUMN if AZURE_SEARCH_URL_COLUMN else None,
                        "filepathField": AZURE_SEARCH_FILENAME_COLUMN if AZURE_SEARCH_FILENAME_COLUMN else None
                    },
                    "inScope": True if AZURE_SEARCH_ENABLE_IN_DOMAIN.lower() == "true" else False,
                    "topNDocuments": AZURE_SEARCH_TOP_K,
                    "queryType": "semantic" if AZURE_SEARCH_USE_SEMANTIC_SEARCH.lower() == "true" else "simple",
                    "semanticConfiguration": AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG if AZURE_SEARCH_USE_SEMANTIC_SEARCH.lower() == "true" and AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG else "",
                    "roleInformation": AZURE_OPENAI_SYSTEM_MESSAGE,
                }
            }
        ]
    }
pamelafox commented 1 year ago

@andreas-amundsen If you're eager to try vector search before it's available for this approach, you can try our other sample: https://github.com/Azure-Samples/azure-search-openai-demo Vectors were added a few weeks ago to it.

andreas-amundsen commented 1 year ago

Thanks!

@andreas-amundsen If you're eager to try vector search before it's available for this approach, you can try our other sample: https://github.com/Azure-Samples/azure-search-openai-demo Vectors were added a few weeks ago to it.

Thanks!

guitaliba commented 1 year ago

oh Great @pamelafox , thanks a lot for this info.

guitaliba commented 1 year ago

Hello @sarah-widder ! Any news about Vector Search? Any release date? Thanks again!

lindazqli commented 1 year ago

Hi @guitaliba, thanks for your patience. It is on our roadmap and unfortunately, we cannot promise on the release date. Please stay tuned.