Skip to content

add QuotedMessage format for chat image payloads#278

Merged
asternic merged 3 commits intoasternic:mainfrom
paul-lestyo:main
Mar 25, 2026
Merged

add QuotedMessage format for chat image payloads#278
asternic merged 3 commits intoasternic:mainfrom
paul-lestyo:main

Conversation

@paul-lestyo
Copy link
Copy Markdown
Contributor

Summary

This PR updates the Swagger/OpenAPI documentation to include the QuotedMessage request format for chat media payloads, especially for /chat/send/image.

Background

The previous documentation did not clearly explain how to send a custom quoted message for image messages. This caused confusion when using QuotedMessage instead of QuotedText.

Changes

  • Added the QuotedMessageExtendedText schema.
  • Added the QuotedMessage schema using extendedTextMessage.text.
  • Linked QuotedMessage in MessageImage.
  • Linked QuotedMessage in MessageText for consistency with backend behavior.
  • Removed conversation from the QuotedMessage schema to align the docs with the currently expected format.

Impact

  • Clearer request payload documentation for custom quote/reply use cases.
  • Reduced integration errors caused by undocumented quote payload structure.
  • No API runtime behavior changes (documentation-only update).

Validation

  • OpenAPI file validates successfully with no schema errors.
  • QuotedMessage payload format tested successfully for image message requests.

Breaking Changes

None.

Short Version (Concise)

This PR adds Swagger/OpenAPI documentation for QuotedMessage payloads used in custom reply/quote flows, mainly for /chat/send/image. It introduces QuotedMessageExtendedText, adds QuotedMessage (extendedTextMessage.text), and references it in both MessageImage and MessageText. The conversation variant was removed from the docs to match the currently used format. This is a documentation-only change with no runtime impact.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 updates the Swagger/OpenAPI documentation to accurately reflect the QuotedMessage request format, particularly for chat media payloads like images. The changes aim to provide clearer documentation for custom reply and quote use cases, thereby reducing integration errors that previously arose from undocumented payload structures. This is a documentation-only update and introduces no runtime behavior changes to the API.

Highlights

  • New Schema Definitions: Added the QuotedMessageExtendedText schema to define the text content for quoted messages.
  • QuotedMessage Structure: Introduced the QuotedMessage schema, specifying its structure to use extendedTextMessage.text.
  • Schema Integration: Linked the new QuotedMessage schema within the MessageImage definition.
  • Consistency Update: Linked the QuotedMessage schema within the MessageText definition for consistency with backend behavior.
  • Documentation Alignment: Updated the QuotedMessage documentation to align with the current expected backend format, specifically by defining it with extendedTextMessage.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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
Copy Markdown
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 new OpenAPI definitions for QuotedMessage and QuotedMessageExtendedText to enable custom reply previews. It integrates the QuotedMessage property into the MessageText and MessageImage types. Feedback suggests clarifying the relationship and precedence between QuotedMessage and QuotedText in the MessageText description for better clarity. Additionally, it is recommended to extend the QuotedMessage property to other media message types (e.g., audio, video) for API consistency, as the backend already supports this functionality.

example: "Original message text"
QuotedMessage:
type: object
description: "Optional quoted message payload for custom reply preview using extendedTextMessage."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To avoid confusion between QuotedMessage and QuotedText in MessageText, it would be helpful to clarify their relationship in the description. QuotedMessage offers more control, and the backend prioritizes it if both are present.

Consider updating the description to something like:

"Optional quoted message payload for custom reply preview. This provides more control than the simpler QuotedText field. If both are provided in a MessageText payload, QuotedMessage will take precedence."

    description: "Optional quoted message payload for custom reply preview. This provides more control than the simpler `QuotedText` field. If both are provided in a `MessageText` payload, `QuotedMessage` will take precedence."

Comment on lines +2492 to +2493
QuotedMessage:
$ref: "#/definitions/QuotedMessage"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While adding QuotedMessage for image messages is a good improvement, for consistency it would be beneficial to add the QuotedMessage property to other media message types as well. The backend handlers for audio, video, documents, stickers, contacts, and locations all support the QuotedMessage field, but it's missing from their OpenAPI definitions.

Adding this to the other types would improve the API documentation and developer experience.

I'd suggest adding QuotedMessage with a $ref: "#/definitions/QuotedMessage" to the properties of:

  • MessageAudio
  • MessageVideo
  • MessageSticker
  • MessageDocument
  • MessageContact
  • MessageLocation

@paul-lestyo
Copy link
Copy Markdown
Contributor Author

I followed Gemini’s suggestion and extended QuotedMessage support for consistency across media payload schemas in commit b8a76a4.

Update completed:

  • Added QuotedMessage to MessageAudio
  • Added QuotedMessage to MessageVideo
  • Added QuotedMessage to MessageSticker
  • Added QuotedMessage to MessageDocument
  • Added QuotedMessage to MessageContact
  • Added QuotedMessage to MessageLocation

I also re-validated the backend handlers, and these endpoints already parse and use QuotedMessage in the send flow.
This is documentation alignment only, with no runtime behavior change.

@asternic asternic merged commit 8761f43 into asternic:main Mar 25, 2026
1 check passed
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.

2 participants