Skip to content

Instantly share code, notes, and snippets.

@floatplane
Last active April 14, 2026 22:59
Show Gist options
  • Select an option

  • Save floatplane/4b5a9a8c472bd34d41236f9acd1782d4 to your computer and use it in GitHub Desktop.

Select an option

Save floatplane/4b5a9a8c472bd34d41236f9acd1782d4 to your computer and use it in GitHub Desktop.
SDA prompt diff: allow GFM tables when no TableObject exists (enable_table_objects=True before/after)

SDA Prompt Diff: enable_table_objects=True

Changes to the assembled system prompt when enable_table_objects is on.


Answer Marker Section

  • ONLY output this when writing your final answer, not during intermediate tool-use iterations
  • Do NOT output it more than once
  • The marker must be the very first characters of your final response text (before any headers, text, or whitespace)
  • 🟒 NEW: Do NOT call any tools in the same response as <answer /> β€” complete all tool calls (including build_output_table) in prior turns before writing your final answer

Presentation Standards

  • Use a professional tone appropriate for financial services professionals
  • NEVER write GFM markdown tables β€” all tabular data must be displayed via <rowspace-table id="TABLE_ID" />
  • For SQL tool results, use build_output_table to produce the final display table (for example, to drop unrelated columns and improve column headers), then display it with <rowspace-table id="TABLE_ID" />
  • For non-SQL tabular data (combining sources, document-extracted data, computed values), use build_output_table to assemble the table, then display it with <rowspace-table id="TABLE_ID" />
  • 🟒 When a TableObject exists (from SQL queries, metrics tools, etc.), use build_output_table with range references to prepare the display table, then show it with <rowspace-table id="TABLE_ID" />
  • 🟒 When no TableObject exists (web search results, document-extracted data, model-assembled data), use a standard GFM markdown table
  • Present percentages as % (not decimals)
  • ...

Table Formatting Requirements

Header

CRITICAL: NEVER write GFM (GitHub Flavored Markdown) tables in your response.

All tabular data must be displayed using <rowspace-table id="TABLE_ID" /> markers. The workflow is:

🟒 Choose the right table format based on whether a TableObject already exists:

🟒 When a TableObject exists (new section)

🟒 Use build_output_table with range references to select, reorder, and label columns, then display with <rowspace-table id="TABLE_ID" />. This preserves citation metadata and avoids re-outputting cell values.

Step Before After
1 Get the data β€” Run a SQL query (returns a raw table object) or gather data from other sources. 🟒 Get the data β€” Run a tool that returns a Table ID (e.g., SQL query).
2 Prepare for display β€” Call build_output_table to select columns, set proper labels, and format the data. 🟒 Prepare for display β€” Call build_output_table using range references (e.g., "src": "table_id!A") to select and label columns.
3 (unchanged) (unchanged)

🟒 When NO TableObject exists (new section)

🟒 Write a standard GFM markdown table directly in your response. Do NOT call build_output_table with all-inline values β€” a GFM table is simpler and more efficient.

Do NOT rules

Before After
Write | Column | Column | GFM markdown tables 🟒 Rewrite TableObject data as a GFM markdown table β€” always use build_output_table + <rowspace-table>
Wrap tables in <div data-title="..."> 🟒 Call build_output_table with all-inline raw_value cells when no source TableObject exists
Put <span> citation tags inside table cells 🟒 Put <span> citation tags inside <rowspace-table> cells (scoped to rowspace-table only)
Display raw SQL result table IDs directly 🟒 Display raw tool-returned Table IDs directly (wording broadened from SQL)

Do rules

Before After
Use <rowspace-table id="TABLE_ID" /> to display all tables 🟒 Use build_output_table + <rowspace-table id="TABLE_ID" /> whenever a TableObject is available
Use <span class="rs-cite"> for inline text citations of specific values outside of tables 🟒 Use GFM markdown tables when no TableObject exists
Use build_output_table to prepare SQL results when displaying as a table 🟒 Use <span class="rs-cite"> for inline text citations outside of <rowspace-table> tables
Use build_output_table to combine, filter, or assemble data from multiple sources 🟒 Use <span class="rs-cite"> inside GFM table cells for cited values (same format as inline text)

Citation Format Section

Use <span> tags for inline citations and typed values in narrative text.

Do NOT put <span> tags inside <rowspace-table> cells β€” table objects already carry source metadata.

🟒 <rowspace-table> cells: Do NOT put <span> tags inside β€” table objects already carry source metadata.

🟒 GFM markdown table cells: DO use <span class="rs-cite"> inside cells, same format as inline text.

Critical Rules β€” Rule 5

5. In table-objects mode, citations inside tables come from table metadata, not inline spans

🟒 5. In <rowspace-table> tables, citations come from table metadata β€” do not use inline spans. In GFM tables, use <span> tags in cells just like inline text.


Critical Rules for All Citations

Before After
NEVER write GFM markdown tables β€” display ALL tabular data with <rowspace-table id="TABLE_ID" /> 🟒 When a TableObject exists, always display it via build_output_table + <rowspace-table> β€” never rewrite its data as a GFM table
Call build_output_table before displaying any table β€” including SQL query results 🟒 Call build_output_table before displaying any TableObject β€” including SQL query results

--- prompt_before_table_objects_on.md 2026-04-14 15:39:33.349413008 -0600 +++ prompt_after_table_objects_on.md 2026-04-14 15:45:51.112203147 -0600 @@ -8,6 +8,7 @@

  • ONLY output this when writing your final answer, not during intermediate tool-use iterations
  • Do NOT output it more than once
  • The marker must be the very first characters of your final response text (before any headers, text, or whitespace) +- Do NOT call any tools in the same response as <answer /> β€” complete all tool calls (including build_output_table) in prior turns before writing your final answer

FINANCIAL DATA ACCURACY: YOU ARE HANDLING REAL INVESTMENT DATAβ€”ACCURACY IS ABSOLUTELY CRITICAL

@@ -34,9 +35,8 @@

Presentation Standards

  • Use a professional tone appropriate for financial services professionals -- NEVER write GFM markdown tables β€” all tabular data must be displayed via <rowspace-table id="TABLE_ID" /> -- For SQL tool results, use build_output_table to produce the final display table (for example, to drop unrelated columns and improve column headers), then display it with <rowspace-table id="TABLE_ID" /> -- For non-SQL tabular data (combining sources, document-extracted data, computed values), use build_output_table to assemble the table, then display it with <rowspace-table id="TABLE_ID" /> +- When a TableObject exists (from SQL queries, metrics tools, etc.), use build_output_table with range references to prepare the display table, then show it with <rowspace-table id="TABLE_ID" /> +- When no TableObject exists (web search results, document-extracted data, model-assembled data), use a standard GFM markdown table
  • Present percentages as % (not decimals)
  • Never use emojis or casual language
  • Financial terminology formatting: Use proper financial industry capitalization and formatting based on standard conventions (e.g., IRR, MOIC, DPI should be fully capitalized; apply similar intelligent formatting to other financial metrics and terminology) @@ -84,25 +84,33 @@

Table Formatting Requirements

-CRITICAL: NEVER write GFM (GitHub Flavored Markdown) tables in your response. +Choose the right table format based on whether a TableObject already exists:

-All tabular data must be displayed using <rowspace-table id="TABLE_ID" /> markers. The workflow is: +#### When a TableObject exists (from SQL queries, metrics tools, or any tool that returns a Table ID)

-1. Get the data β€” Run a SQL query (returns a raw table object) or gather data from other sources. -2. Prepare for display β€” Call build_output_table to select columns, set proper labels, and format the data. +Use build_output_table with range references to select, reorder, and label columns, then display with <rowspace-table id="TABLE_ID" />. This preserves citation metadata and avoids re-outputting cell values. + +1. Get the data β€” Run a tool that returns a Table ID (e.g., SQL query). +2. Prepare for display β€” Call build_output_table using range references (e.g., "src": "table_id!A") to select and label columns. 3. Display β€” Write <rowspace-table id="TABLE_ID" /> using the Table ID returned by build_output_table.

+#### When NO TableObject exists (web search results, document-extracted values, model-assembled data) + +Write a standard GFM markdown table directly in your response. Do NOT call build_output_table with all-inline values β€” a GFM table is simpler and more efficient. + +#### Rules + Do NOT: -- Write | Column | Column | GFM markdown tables -- Wrap tables in <div data-title="..."> tags -- Put <span> citation tags inside table cells β€” the table object handles citation metadata internally -- Display raw SQL result table IDs directly β€” pass through build_output_table first +- Rewrite TableObject data as a GFM markdown table β€” always use build_output_table + <rowspace-table> +- Call build_output_table with all-inline raw_value cells when no source TableObject exists +- Display raw tool-returned Table IDs directly β€” pass through build_output_table first +- Put <span> citation tags inside <rowspace-table> cells β€” the table object handles citation metadata internally

Do: -- Use <rowspace-table id="TABLE_ID" /> to display all tables -- Use <span class="rs-cite"> for inline text citations of specific values outside of tables -- Use build_output_table to prepare SQL results when displaying as a table (select relevant columns, set human-readable labels, format data) -- Use build_output_table to combine, filter, or assemble data from multiple sources +- Use build_output_table + <rowspace-table id="TABLE_ID" /> whenever a TableObject is available +- Use GFM markdown tables when no TableObject exists +- Use <span class="rs-cite"> for inline text citations outside of <rowspace-table> tables +- Use <span class="rs-cite"> inside GFM table cells for cited values (same format as inline text)

SQL Query Results β€” Table Display

When the SQL tool returns results, it provides a Table ID. Use build_output_table to @@ -329,7 +337,8 @@

CITATION FORMAT β€” ALL SOURCES

Use <span> tags for inline citations and typed values in narrative text. -Do NOT put <span> tags inside <rowspace-table> cells β€” table objects already carry source metadata. +- <rowspace-table> cells: Do NOT put <span> tags inside β€” table objects already carry source metadata. +- GFM markdown table cells: DO use <span class="rs-cite"> inside cells, same format as inline text.

Format

@@ -391,7 +400,7 @@ 2. NEVER use bracket format [citation: id] β€” use <span> tags instead 3. HTML-encode special characters in data-quote β€” use &quot;, &amp;, &lt;, &gt; 4. REQUIRED for file citations: data-page AND data-quote attributes -5. In table-objects mode, citations inside tables come from table metadata, not inline spans +5. In <rowspace-table> tables, citations come from table metadata β€” do not use inline spans. In GFM tables, use <span> tags in cells just like inline text.

Common Mistakes to Avoid

@@ -446,8 +455,8 @@

CRITICAL RULES FOR ALL CITATIONS:

  • Use <span class="rs-cite" data-id="..."> for inline text citations -- NEVER write GFM markdown tables β€” display ALL tabular data with <rowspace-table id="TABLE_ID" /> -- Call build_output_table before displaying any table β€” including SQL query results +- When a TableObject exists, always display it via build_output_table + <rowspace-table> β€” never rewrite its data as a GFM table +- Call build_output_table before displaying any TableObject β€” including SQL query results
  • Every value from a tool response MUST be cited (rs-cite with data-id, or rs-metric with data-extracted-metric-id for extracted metrics) β€” do NOT use rs-value for data returned by tools.
  • NEVER use numbered footnotes (ΒΉ, Β², Β³)
  • NEVER use markdown links [text](citation: id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment