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

Fixed Azure OpenAI Deprecations and Adjusted the Tests #1437

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

halanm
Copy link
Contributor

@halanm halanm commented Jun 21, 2024

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Changed the AzureOpenAIEmbeddings import package from "langchain_community.embeddings" to "langchain_openai.embeddings"

Changed the AzureChatOpenAI import package from "langchain_community.embeddings" to "langchain_openai.embeddings"

Changed the default openai_api_version from "2023-05-15" to the newest: "2024-02-01"

Replaced chat(messages).content for chat.invoke(messages).content BaseChatModel.__call__ is deprecated

Changed the tests for azure open ai to patch the new packages instead of the older ones

Fixes #1373

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Please delete options that are not relevant.

  • Unit Test

Tested using a valid AZURE_OPENAI_API_KEY, endpoint and deployment_name. The test code was the same as the one in the documentation.

https://docs.embedchain.ai/components/embedding-models#azure-openai

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

@deshraj deshraj merged commit 8700165 into mem0ai:main Jun 24, 2024
3 checks passed
@halanm halanm deleted the fix-azure-openai-deprecations branch June 25, 2024 04:46
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.

Lots of deprecation warnings
3 participants