-
Notifications
You must be signed in to change notification settings - Fork 55
test: add langchain-google-genai integration tests for RAI features (… #740
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
base: main
Are you sure you want to change the base?
test: add langchain-google-genai integration tests for RAI features (… #740
Conversation
…obotecAI#168) This test suite verifies the integration and functionality of the ChatGoogleGenerativeAI model, including initialization, invocation, error handling, and support for model variants.
|
Thank you for the contribution! I appreciate the effort you put into adding tests for Google GenAI integration. A few points to note:
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! |
|
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? |
|
@maciejmajek Thank you for the feedback! I'll update the PR to include the @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)
|
@maciejmajek @sachinkum0009 Thank you for the guidance! I've updated the PR with the following changes:
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
|
Thanks @Ranga-Prasath-22, so far it looks good. I have suggested some changes. |
|
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: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 = "*" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
|
Hey @sachinkum0009 @maciejmajek, thanks for the feedback! I've got all the changes sorted:
Should be good to review now! |
…#168)
This test suite verifies the integration and functionality of the ChatGoogleGenerativeAI model, including initialization, invocation, error handling, and support for model variants.
Purpose
Proposed Changes
What does this PR add, remove or fix?
Issues
Testing