Skip to content

Conversation

@Ranga-Prasath-22
Copy link

#168)

This test suite verifies the integration and functionality of the ChatGoogleGenerativeAI model, including initialization, invocation, error handling, and support for model variants.

Purpose

  • Clear purpose of this PR

Proposed Changes

What does this PR add, remove or fix?

Issues

  • Links to relevant issues

Testing

  • How was it tested, what were the results?

…obotecAI#168)

This test suite verifies the integration and functionality of the ChatGoogleGenerativeAI model, including initialization, invocation, error handling, and support for model variants.
@maciejmajek
Copy link
Member

Thank you for the contribution! I appreciate the effort you put into adding tests for Google GenAI integration.

A few points to note:

  • The PR does not add the langchain-google-genai dependency, so these tests won’t run out of the box.
  • The added tests are heavily mocked. While they might make sense for testing the LangChain package itself, they don’t really test RAI, which uses LLMs in a less conventional way. Fully mocked tests like these don’t provide much value here.
  • For RAI, testing LLM integrations works better through manual testing. Before configuring the model in config.toml, the initialization module should be updated to support the new LLM vendor. Then you can manually test by running the demos to verify everything works as expected.

Just so you know, our current contributor @sachinkum0009 is also working on Google GenAI integration. You could coordinate to pick up the work together or test the capabilities separately.

Thanks again!

@sachinkum0009
Copy link
Contributor

Thanks for the PR and for the heads-up! I actually haven't started working on this specific issue yet. If you are already mid-way through, feel free to take the lead. Otherwise, I’m happy to discuss how we can divide the tasks so we aren't duplicating effort. What do you think?

@Ranga-Prasath-22
Copy link
Author

@maciejmajek Thank you for the feedback! I'll update the PR to include the langchain-google-genai dependency and add support for the Google LLM vendor in the initialization module. I'll also work on making the tests more meaningful for RAI.

@sachinkum0009 Thanks! I'm already partway through these changes, so I'll go ahead and finish the core setup. We can definitely coordinate on further features once the basic integration is merged!

- Add langchain-google-genai dependency to pyproject.toml
- Add GoogleConfig dataclass and vendor support in model_initialization.py
- Add [google] section to config template with gemini-3-flash/gemini-3-pro
- Add unit tests for RAI framework integration logic

Closes RobotecAI#168
Syncing patch-1 with main (latest fixes and upstream changes)
@Ranga-Prasath-22
Copy link
Author

@maciejmajek @sachinkum0009 Thank you for the guidance! I've updated the PR with the following changes:

  • Added langchain-google-genai as a dependency in pyproject.toml.
  • Updated model_initialization.py to support the Google LLM vendor.
  • Added the [google] configuration section to config_initialization.py and the config.toml template.
  • Added comprehensive unit tests for the initialization logic and integrated the Google GenAI model.

Please let me know if there's anything else I should address. This is my first open-source contribution, so I appreciate your patience!

- Remove top-level import of langchain_google_genai in model_initialization.py
- Update return type annotations to use Any for lazy-imported types
- Add try/except skip in test_langchain_google_genai.py for optional dependency
- Bump version from 2.6.0 to 2.7.0 for new feature addition

Fixes CI build errors caused by missing optional dependency during test collection
@sachinkum0009
Copy link
Contributor

Thanks @Ranga-Prasath-22, so far it looks good. I have suggested some changes.

@Ranga-Prasath-22
Copy link
Author

Thanks @sachinkum0009! I'm looking forward to your suggestions. Once you submit your review, I'll work on addressing those changes. I'm ready to update the branch with the main branch whenever you're done with your review.

config_path: Optional[str] = None,
**kwargs: Any,
) -> ChatOpenAI | ChatBedrock | ChatOllama:
) -> ChatOpenAI | ChatBedrock | ChatOllama | Any:
Copy link
Contributor

Choose a reason for hiding this comment

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

use ChatGoogleGenerativeAI instead of Any

use this to import
from langchain_google_genai import ChatGoogleGenerativeAI

config_path: Optional[str] = None,
**kwargs: Any,
) -> ChatOpenAI | ChatBedrock | ChatOllama:
) -> ChatOpenAI | ChatBedrock | ChatOllama | Any:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this test is not required. It doesn't align with agents. @maciejmajek what are your thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. These are more of google-genai tests and are not relevant to rai

Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, this test is also not required.
I suggest to update the test_model_initialization.py file to include the google genai config and then add the unit test to validate the model initialization from config.
@maciejmajek What are your suggestions for this?

langchain-aws = "*"
langchain-openai = "*"
langchain-ollama = "^0.3.4"
langchain-google-genai = "*"
Copy link
Contributor

@sachinkum0009 sachinkum0009 Jan 13, 2026

Choose a reason for hiding this comment

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

@maciejmajek Is it fine to update langchain-core to latest version, as it is required to install langchain-google-genai?

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, due to numpy 1.x requirement of ROS 2 jazzy and humble we are stuck with the langchain-core 0.X version

@Ranga-Prasath-22
Copy link
Author

Hey @sachinkum0009 @maciejmajek, thanks for the feedback! I've got all the changes sorted:

  • Updated the return types to use ChatGoogleGenerativeAI instead of Any (with the proper import from langchain_google_genai)
  • Removed the agent test file since it doesn't really fit with RAI
  • Deleted the separate initialization test and moved everything into test_model_initialization.py
  • Kept langchain-core on the 0.x version to stay compatible with ROS2's numpy 1.x requirement

Should be good to review now!

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.

3 participants