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

Add support for vector search and document level access control #180

Merged
merged 1 commit into from Aug 21, 2023

Conversation

sarah-widder
Copy link
Contributor

  • adds support for vector search when using Azure OpenAI on your data
  • adds support for document level access control when using Azure OpenAI on your data via AAD Auth and the MS Graph API
  • resolves endpoint/domain name issues

@avivansh
Copy link

avivansh commented Aug 21, 2023

@sarah-widder could you please share the resources for adding vector search capabilities.
Currently, https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions-extensions, in this documentation vector search isn't been included yet.

Also, how to validate the changes you made in this Pull request associated with vector search are working?

@sarah-widder
Copy link
Contributor Author

Hi @avivansh we are still finalizing vector search support with associated documentation. We're targeting this in the next week, please stay tuned!

@sarah-widder sarah-widder marked this pull request as ready for review August 21, 2023 18:45
@sarah-widder sarah-widder merged commit 0e14412 into main Aug 21, 2023
1 check passed
@phfontes
Copy link

Hello Sara!

We are trying to implement vector search and we have some doubts. Do I need to make any changes to the.env file? Adding values to the variables you entered in the app.py file, if so, I believe it is necessary to update the readme and .env file.

@hanhsia
Copy link

hanhsia commented Aug 25, 2023

Hi Sarah,
when I send request with vector type information, it always returns 500 Internal server error. Here is my request:
https://.openai.azure.com/openai/deployments/gpt-4/extensions/chat/completions?api-version=2023-06-01-preview
curl -X 'POST'
'https://.openai.azure.com/openai/deployments/gpt-4/extensions/chat/completions?api-version=2023-06-01-preview'
-H 'accept: /'
-H 'Content-Type: application/json'
-d '{"dataSources":[{"type":"AzureCognitiveSearch","parameters":{"endpoint":"https://.search.windows.net","key":"","indexName":"kbindex","semanticConfiguration":"","queryType":"vector","fieldsMapping":{"contentFieldsSeparator":"\n","contentFields":["content"],"filepathField":"file_name","titleField":null,"urlField":null,"vectorFields":["contentVector"]},"inScope":true,
"embeddingEndpoint":"https://.openai.azure.com/","embeddingKey":"","roleInformation":"You are an AI assistant that helps people find information.","filter":"role/any(g:search.in(g, '''1'''))"}}],"messages":[{"role":"user","content":"how to clean c: root?"}],"deployment":"gpt-4","temperature":0,"top_p":1,"max_tokens":800,"stop":null,"stream":false}'
if the queryType is "simple", it works well. I also called azure search api to retrieve data using vectors. It also works.
Is there anything missed in my request?
Thanks!

@sarah-widder
Copy link
Contributor Author

Hi @avivansh , @phfontes , @hanhsia please see the updated documentation with vector search: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions-extensions
Accepted queryType values are vector, vectorSimpleHybrid, vectorSemanticHybrid. For the embeddingEndpoint you need the full embeddings endpoint, e.g. "https://{AOAI resource name}.openai.azure.com/openai/deployments/{Ada deployment name}/embeddings?api-version=2023-03-15-preview". Hope that helps :)

@sarah-widder sarah-widder mentioned this pull request Aug 28, 2023
DanielleHeymann pushed a commit to ctkraft/sample-app-aoai-chatGPT that referenced this pull request Oct 5, 2023
…osoft#180)

Co-authored-by: Sarah Widder <sawidder@microsoft.com>
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

Successfully merging this pull request may close these issues.

None yet

5 participants