Skip to content

Conversation

@kamladi
Copy link
Contributor

@kamladi kamladi commented Dec 17, 2025

Update chat.sendMessage and chat.sendDm tool descriptions to document Google Chat's supported text formatting syntax, helping LLMs generate properly formatted messages.

Partially addresses #58 (Chat formatting task).

Changes:

  • Add CHAT_FORMATTING constant in src/utils/formatting/constants.ts
  • Add CHAT_FORMATTING_SHORT for parameter descriptions
  • Refactor tool descriptions to use shared constants

Testing:

  • Manual test: LLM converts **bold** and __bold__ to *bold*
  • Manual test: LLM converts *italic* to _italic_
  • Manual test: LLM converts [text](url) to <url|text>
  • Manual test: LLM flattens nested list items, but prefixes the list items with dashes to indicate depth (e.g., "- parent", "- -- child", "- --- grandchild")

Supported syntax:

- *bold* (single asterisks, not **)
- _italic_
- ~strikethrough~
- `inline code` and ```code blocks```
- Bulleted lists ("* " or "- " at line start)
- Links: <url|display text> (not [text](url))
- User mentions: <users/{user}>

Unsupported syntax (must be converted or avoided):

- **double asterisks** for bold
- # headings
- [text](url) markdown links
- > blockquotes

Update `chat.sendMessage` and `chat.sendDm` tool descriptions to document Google Chat's supported text formatting syntax, helping LLMs generate properly formatted messages.

Changes:
- Add `CHAT_FORMATTING` and `CHAT_FORMATTING_SHORT` constants in `src/utils/formatting/constants.ts`
- Update `chat.sendMessage` tool description to include full formatting instructions
- Update `chat.sendMessage` parameter description to include short formatting instructions
- Update `chat.sendDm` tool description to include full formatting instructions
- Update `chat.sendDm` parameter description to include short formatting instructions

Based on PR gemini-cli-extensions#103.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kamladi, 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 chat.sendMessage and chat.sendDm tools by embedding explicit documentation of Google Chat's unique Markdown formatting requirements directly into their descriptions. This change aims to guide Large Language Models (LLMs) in generating messages that adhere to Google Chat's syntax, thereby preventing formatting errors and improving the quality of automated communications.

Highlights

  • New Formatting Constants: Introduced new constants CHAT_FORMATTING and CHAT_FORMATTING_SHORT to centralize Google Chat's specific Markdown formatting rules.
  • Enhanced Tool Descriptions: Updated the chat.sendMessage and chat.sendDm tool descriptions to include detailed guidance on Google Chat's supported and unsupported text formatting, leveraging the new constants.
  • LLM Guidance: Refactored tool descriptions to dynamically include formatting guidelines, ensuring Large Language Models (LLMs) generate properly formatted messages for Google Chat.
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.

@kamladi kamladi marked this pull request as ready for review December 17, 2025 23:02
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 effectively documents the Google Chat specific formatting for the chat.sendMessage and chat.sendDm tools by introducing shared constants. My review includes suggestions to make the formatting documentation even more complete by including all unsupported syntax mentioned in the PR description. I've also recommended a minor stylistic improvement to use template literals for better code readability.

… unsupported markdown features in the formatting instructions
Copy link
Contributor

@allenhutchison allenhutchison left a comment

Choose a reason for hiding this comment

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

One question and one comment for you.

"chat.sendMessage",
{
description: 'Sends a message to a Google Chat space.',
description: `Sends a message to a Google Chat space. ${CHAT_FORMATTING}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you try adding these to the GEMINI-workspace.md file? It seems like a little overkill to add these to every tool description, but if you tried that and it didn't work I would understand why you took this route.

@@ -0,0 +1,28 @@
export const CHAT_FORMATTING_SHORT = [
Copy link
Contributor

Choose a reason for hiding this comment

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

We need a license header here to clear lint. If you run npm run lint:fix it should do the right thing.

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