mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

AzureOpenAI features not supported and are hard coded

Open neilbhutada opened this issue 1 year ago • 1 comments

🐛 Describe the bug

In the documentation and the code base there seems to be a discrepancy. In the documentation, it says to use the following environment variables while using AzureOpenAI services, but the name of the environment variables differs. Secondly, I was looking at the source code and it seems that the api version was hard coded. It would be nice to pull the from yaml config. Thirdly, I couldn't see the embedder for AzureOpenAI in the source code. Thank you!

neilbhutada avatar Apr 28 '24 03:04 neilbhutada

Facing same issue

pratikkotian04 avatar Apr 30 '24 05:04 pratikkotian04

I was able to load the version from the YAML config, in the latest version, below an example how it worked.

os.environ["OPENAI_API_VERSION"] = "2024-02-01"

denaha avatar May 22 '24 19:05 denaha

I will take this up

PranavPuranik avatar Jun 12 '24 02:06 PranavPuranik

@neilbhutada

My PR will fix the mismatch in the documentation for azure openai environment variables, and let you add api_version from the config.

Azure OpenAI embedder is already present in the code and docs. You can put your deployment name in config and use it.

However, I feel it should be in a different file such as embedders/azure_openai.py, and self.config.deployment_name should not be used to differentiate between azure and openai embedded. @Dev-Khant let me know if you think the same, will make that change.

Please let me know if you have any other issues.

PranavPuranik avatar Jun 17 '24 05:06 PranavPuranik

@PranavPuranik Thanks for working on this. Yes, I agree that we should put azure_openai embedder in a different. Thanks for opening a PR, I'll review it.

Dev-Khant avatar Jun 17 '24 09:06 Dev-Khant