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

RAG AI plugin - support for Azure OpenAI #1398

Open
joezamolo opened this issue May 23, 2024 · 5 comments
Open

RAG AI plugin - support for Azure OpenAI #1398

joezamolo opened this issue May 23, 2024 · 5 comments
Labels
kind/enhancement New feature or request

Comments

@joezamolo
Copy link

Feature Suggestion

Support for Microsoft Azure OpenAI Service as an optional service provider that can be swapped out instead of OpenAI itself.

Possible Implementation

Not sure about implementation details, sorry 😅 this is just an idea I wanted to share here.

Context

This would allow customers for whom Azure is the primary cloud provider to take advantage of this plugin, especially where there are concerns around AI and usage of an organization's proprietary data.

@joezamolo joezamolo added the kind/enhancement New feature or request label May 23, 2024
@nia-potato
Copy link

also have the same request here!

@Xantier
Copy link
Contributor

Xantier commented May 28, 2024

Hi, thanks. This makes a ton of sense and would be a good addition. I don't have an Azure account with OpenAI enabled at the moment so we would need some implementation help on this. Luckily it shouldn't be too big of a task to add this in.

The implementation of this on a base level would be very similar as AWS Bedrock currently is. There would be a need to create a new (Azure OpenAI) embeddings package, add the configuration options for it, and use the Langchain dependency to initialize these embeddings.

The approach would likely be mostly copy-pasting the current AWS implementation and modifying it to call Azure OpenAI instead.

Resources for this:

  • LangChain docs provides a full working example of everything needed. This should likely work as a first draft already
  • The AWS embeddings package can be used as a more or less direct copy-paste source to start from

@szajcz
Copy link
Contributor

szajcz commented Jul 24, 2024

Hi @Xantier,

I started to look into the implementation of the Azure OpenAI support, but I ran into the following issue:
Using AzureOpenAIEmbeddings from the latest @langchain/openai throws an error, as roadie's DefaultVectorAugmentationIndexer uses a different version of @langchain/core than the latest @langchain/openai.

I did a bit of digging and found that version 0.0.9 of @langchain/openai uses the matching version of @langchain/core, but that version doesn't have the AzureOpenAIEmbeddings yet.

Do you know any implementation of AzureOpenAIEmbeddings that uses a @langchain/core version that can be used with the DefaultVectorAugmentationIndexer? It would be great to use something without the need to update the retrieval augmenter.

Otherwise the implementation indeed seems quite straight-forward.

P.S.: Here is the issue I'm getting:

Type 'AzureOpenAIEmbeddings' is not assignable to type 'Embeddings'.
  Types of property 'caller' are incompatible.
    Type 'import("/Users/x/dev/developer-portal-2/backstage/node_modules/@langchain/core/dist/utils/async_caller").AsyncCaller' is not assignable to type 'import("/Users/x/dev/developer-portal-2/backstage/node_modules/@roadiehq/rag-ai-node/node_modules/@langchain/core/dist/utils/async_caller").AsyncCaller'.
      Property 'maxConcurrency' is protected but type 'AsyncCaller' is not a class derived from 'AsyncCaller'.

@Xantier
Copy link
Contributor

Xantier commented Jul 24, 2024

@szajcz Would the upgrade of the rest of the libraries to match Azure lib versions solve this or are there too many dependencies that would break in that case?

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 22, 2024
@Xantier Xantier removed the stale label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants
@Xantier @joezamolo @szajcz @nia-potato and others