Skip to content

Conversation

@TadakiAsechi
Copy link
Contributor

Description

This PR implements the client-side enhancement described in #499.
It allows callers to specify historyLength (and other message configuration options)
directly via the optional configuration parameter in BaseClient.send_message,
complementing the server-side support added in #497.

Summary of Changes

  • Added optional argument configuration: MessageSendConfiguration | None to BaseClient.send_message.
  • When provided, merges call-site configuration with ClientConfig defaults.
  • Allows partial overrides (e.g., setting historyLength only).
  • Updated docstrings to reflect the new parameter behavior.
  • Added unit tests covering both non-streaming and streaming scenarios.

Motivation

Previously, BaseClient.send_message built MessageSendConfiguration internally from ClientConfig,
but ClientConfig does not include history_length.
This prevented clients from specifying it on a per-call basis, unlike get_task,
which already supports historyLength via TaskQueryParams.
After this change, client behavior becomes consistent across both methods.

Related Issues

Fixes #499
Complements #497 (server-side historyLength support)

@TadakiAsechi TadakiAsechi requested a review from a team as a code owner October 11, 2025 06:28
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @TadakiAsechi, 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 enhances the BaseClient.send_message method by introducing an optional configuration parameter. This allows developers to specify or override message sending settings, such as historyLength, directly at the call site, providing greater flexibility and consistency with other client methods. The change integrates call-site configurations with existing client defaults, ensuring that only explicitly provided options are applied.

Highlights

  • Enhanced Message Configuration: Introduced a new configuration parameter to BaseClient.send_message for per-call message configuration overrides, addressing the need to specify options like historyLength directly.
  • Flexible Configuration Merging: Implemented logic to merge call-site MessageSendConfiguration with default client settings, allowing for partial overrides where only specified options are applied.
  • Updated Documentation: Updated docstrings for BaseClient.send_message to clearly reflect the behavior and usage of the new configuration parameter.
  • Comprehensive Unit Tests: Added new unit tests to validate the configuration override behavior for both streaming and non-streaming message sending, ensuring robustness and correctness.
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.

Copy link
Contributor

@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 introduces a valuable enhancement by allowing per-call configuration overrides in BaseClient.send_message. The implementation is straightforward and correctly merges the call-site configuration with the client's defaults. The addition of unit tests for both streaming and non-streaming scenarios ensures the new functionality is well-covered. I have a few minor suggestions to improve the readability of the new tests.

@TadakiAsechi
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@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 introduces the ability to specify historyLength and other message configuration options directly via the configuration parameter in BaseClient.send_message. This enhancement aligns client behavior across methods and fixes issue #499. The changes include adding an optional argument to send_message, merging call-site configuration with defaults, updating docstrings, and adding unit tests. No style guide was provided, so the review focuses on correctness, efficiency, maintainability, and security.

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.

[Feat]: Support call-site MessageSendConfiguration in BaseClient.send_message to allow specifying historyLength

5 participants