Skip to content

Conversation

@SanjaySiddharth
Copy link

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:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary :

tests/unittests/agents/test_live_request_queue.py::test_send_realtime PASSED [100%]

Manual End-to-End (E2E) Tests:

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • 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.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

replace send() method with send_realtime_input() to fix depreciation
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 DeprecationWarning by updating the method used to send real-time inputs within the GeminiLLMConnection. The change ensures compatibility with the latest API by replacing an outdated send() call with the recommended send_realtime_input() method, specifically when dealing with blob data, thereby improving code maintainability and future compatibility.

Highlights

  • Deprecation Warning Fix: Replaced the deprecated .send() method with .send_realtime_input() for handling types.Blob inputs within the GeminiLLMConnection, resolving a DeprecationWarning.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot adk-bot added the live [Component] This issue is related to live, voice and video chat label Nov 1, 2025
@adk-bot
Copy link
Collaborator

adk-bot commented Nov 1, 2025

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 pytest results?

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!

Copy link

@gemini-code-assist gemini-code-assist bot left a 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)

Choose a reason for hiding this comment

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

high

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.

Copy link
Author

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

@hangfei
Copy link
Collaborator

hangfei commented Nov 2, 2025

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)
Copy link
Collaborator

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)")

@hangfei
Copy link
Collaborator

hangfei commented Nov 2, 2025

Please fix linter. You can use autoformat.sh to fix it.

@ryanaiagent ryanaiagent self-assigned this Nov 3, 2025
@hangfei
Copy link
Collaborator

hangfei commented Nov 5, 2025

Please also do: Manual End-to-End (E2E) Tests:"

@ryanaiagent
Copy link
Collaborator

Hi @SanjaySiddharth , Thank you again for your work on this.
To move forward, we'll need you to please do Manual End-to-End (E2E) Tests.
Additionally, your current branch has merge conflicts with main. These will need to be resolved first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live [Component] This issue is related to live, voice and video chat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning: "session.send" in send_realtime

4 participants