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

UPDATED: Added support for Azure #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

swiecki
Copy link

@swiecki swiecki commented Jun 15, 2023

Thanks very much for the great package.

I want to use this in an enterprise setting, in the browser, using our AzureOpenAI endpoint, without exposing our API key.

  • Added properties azureProxy, azureEndpoint, azureApiKey, and openAIEndpoint to the VectorStorage class
  • Modified the constructor to accept these new options
  • Updated embedTexts function to use the Azure endpoint and API key if provided, or fallback to the OpenAI API key
  • Adjusted the code to handle the different scenarios for API key and endpoint
  • Updated the IVSOptions interface to include the new options

- Added properties `azureProxy`, `azureEndpoint`, `azureApiKey`, and `openAIEndpoint` to the `VectorStorage` class
- Modified the constructor to accept these new options
- UpdatedembedTexts` function to use the Azure endpoint and API key if provided, or fallback to the OpenAI API key
- Adjusted the code to handle the different scenarios for API key and endpoint
- Updated the `IVSOptions` interface to include the new options
- The clearAll method clears all documents in the clearing the documents, the updated storage is saved to IndexDB.
- The clearAll method clears all documents in the clearing the documents, the updated storage is saved to IndexDB.
- Implemented clearMatching method in VectorStorage class, which removes matching documents based on filter options
…ments.

- Added new method `retainMatching to the VectorStorage class.
- This method filters the documents based on the given filter options.
- The filtered documents are stored in the `documents` property.
- After filtering, documents are saved to the index DB storage.
…the matchesCriteria function to handle arrays in the criteria metadata

- If the criteria metadata value is an array, it checks if the document metadata value is included in the array; otherwise, it checks for strict equality
- This allows for more flexible filtering options for documents based on metadata
Copy link

@dllz dllz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested these changes locally and they work well. I would merge @nitaiaharoni1

@cgisky1980
Copy link

This is just what I want.

@easychen
Copy link

Great job, thank you!

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.

4 participants