-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fixes DeprecationWarning when using .send method #3352
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?
Conversation
replace send() method with send_realtime_input() to fix depreciation
Summary of ChangesHello @SanjaySiddharth, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Response from ADK Triaging Agent Hello @SanjaySiddharth, thank you for your contribution! To help us review this PR, could you please provide a summary of all passed Additionally, our contribution guidelines require manual end-to-end (E2E) test evidence for changes like this. Could you please add a section with the setup, commands used, and console output to demonstrate that the fix works as expected and doesn't impact other functionalities? You can find more details in our Testing Requirements. Thanks! |
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.
Code Review
This pull request correctly replaces the deprecated send() method with send_realtime_input() to fix a DeprecationWarning. The change itself is correct. However, the corresponding unit test in tests/unittests/models/test_gemini_llm_connection.py has not been updated to reflect this change, which will cause the test suite to fail. Please update the unit test as suggested in the review comment.
| logger.debug('Sending LLM Blob: %s', input_blob) | ||
| await self._gemini_session.send(input=input_blob) | ||
| logger.debug('Sending LLM Blob: %s', input) | ||
| await self._gemini_session.send_realtime_input(media=input) |
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.
While this change to use send_realtime_input is correct for handling types.Blob, the associated unit test has not been updated. The test test_send_realtime_default_behavior in tests/unittests/models/test_gemini_llm_connection.py still asserts that mock_gemini_session.send is called, which will now fail.
Please update the test to verify that mock_gemini_session.send_realtime_input is called instead. Here is a suggested update for the test:
@pytest.mark.asyncio
async def test_send_realtime_blob(gemini_connection, mock_gemini_session, test_blob):
"""Test send_realtime with a blob."""
await gemini_connection.send_realtime(test_blob)
mock_gemini_session.send_realtime_input.assert_called_once_with(media=test_blob)
mock_gemini_session.send.assert_not_called()Failing to update tests alongside code changes can lead to a brittle test suite and hide potential regressions.
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.
Hi ! This is done ! Thanks
|
Could you add this: I have added tests that prove my fix is effective or that my feature works.? |
| logger.debug('Sending LLM Blob: %s', input_blob) | ||
| await self._gemini_session.send(input=input_blob) | ||
| logger.debug('Sending LLM Blob: %s', input) | ||
| await self._gemini_session.send_realtime_input(media=input) |
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.
Could you help explain why we migrate to this method and not others:
("Please use one of the more specific methods: send_client_content, send_realtime_input, or send_tool_response instead.
await self._gemini_session.send(input=input_blob)")
|
Please fix linter. You can use autoformat.sh to fix it. |
|
Please also do: Manual End-to-End (E2E) Tests:" |
|
Hi @SanjaySiddharth , Thank you again for your work on this. |
Replace send() method with send_realtime_input() to fix DeprecationWarning
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Testing Plan
Have run unit test for test_live_request_queue.py
Unit Tests:
Summary :
tests/unittests/agents/test_live_request_queue.py::test_send_realtime PASSED [100%]
Manual End-to-End (E2E) Tests:
Checklist