ragas icon indicating copy to clipboard operation
ragas copied to clipboard

Replace deprecated VertexAI classes and add langchain-google-genai dependency

Open sohamadhikari2000 opened this issue 6 months ago • 3 comments

Replaced deprecated ChatVertexAI and VertexAI with ChatGoogleGenerativeAI and GoogleGenerativeAI.

Added langchain-google-genai dependency to pyproject.toml to support the updated imports.

Issue Link / Problem Description

  • Fixes #2741
  • This PR resolves deprecation warnings caused by the usage of ChatVertexAI and VertexAI, which are no longer recommended and may be removed in future versions.

Changes Made

  • Replaced ChatVertexAI with ChatGoogleGenerativeAI
  • Replaced VertexAI with GoogleGenerativeAI
  • Updated import statements to use langchain_google_genai
  • Added langchain-google-genai dependency in pyproject.toml

Testing

How to Test

  • [ ] Automated tests added/updated
  • [x] Manual testing steps:
    1. Install dependencies (including langchain-google-genai)
    2. Run the affected modules/scripts
    3. Verify that imports work correctly and no deprecation warnings appear

References

  • Documentation: LangChain Google Generative AI integration docs

Screenshots/Examples (if applicable)

image image image

sohamadhikari2000 avatar May 23 '26 13:05 sohamadhikari2000

✅ No documentation update needed — Internal dependency replacement (deprecated VertexAI classes swapped for langchain-google-genai equivalents) with no user-facing API changes or new features requiring documentation.

github-actions[bot] avatar May 23 '26 13:05 github-actions[bot]

Hi! 👋

This PR replaces deprecated VertexAI usage with the newer Google Generative AI classes and adds the required dependency.

Let me know if any changes are needed — happy to update!

sohamadhikari2000 avatar May 23 '26 14:05 sohamadhikari2000

Please merge soon since my projects have started to fail due to this issue

maalolankannan1 avatar May 25 '26 15:05 maalolankannan1