add QuotedMessage format for chat image payloads#278
Conversation
…r message quoting on endpoint send image
Summary of ChangesHello, 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 Highlights
🧠 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 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. Footnotes
|
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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."| QuotedMessage: | ||
| $ref: "#/definitions/QuotedMessage" |
There was a problem hiding this comment.
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:
MessageAudioMessageVideoMessageStickerMessageDocumentMessageContactMessageLocation
|
I followed Gemini’s suggestion and extended QuotedMessage support for consistency across media payload schemas in commit b8a76a4. Update completed:
I also re-validated the backend handlers, and these endpoints already parse and use QuotedMessage in the send flow. |
Summary
This PR updates the Swagger/OpenAPI documentation to include the
QuotedMessagerequest 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
QuotedMessageinstead ofQuotedText.Changes
QuotedMessageExtendedTextschema.QuotedMessageschema usingextendedTextMessage.text.QuotedMessageinMessageImage.QuotedMessageinMessageTextfor consistency with backend behavior.conversationfrom theQuotedMessageschema to align the docs with the currently expected format.Impact
Validation
QuotedMessagepayload format tested successfully for image message requests.Breaking Changes
None.
Short Version (Concise)
This PR adds Swagger/OpenAPI documentation for
QuotedMessagepayloads used in custom reply/quote flows, mainly for/chat/send/image. It introducesQuotedMessageExtendedText, addsQuotedMessage(extendedTextMessage.text), and references it in bothMessageImageandMessageText. Theconversationvariant was removed from the docs to match the currently used format. This is a documentation-only change with no runtime impact.