Skip to content

[docs][examples] Clarify prompt brace handling and use single braces in JSON examples#810

Merged
wenjin272 merged 1 commit into
apache:mainfrom
wenjin272:fix-prompt
Jun 8, 2026
Merged

[docs][examples] Clarify prompt brace handling and use single braces in JSON examples#810
wenjin272 merged 1 commit into
apache:mainfrom
wenjin272:fix-prompt

Conversation

@wenjin272
Copy link
Copy Markdown
Contributor

@wenjin272 wenjin272 commented Jun 8, 2026

Linked issue: #781

Purpose of change

SafeFormatter (Python) and Prompt.formatMessages (Java) only substitute {key}; they do not collapse {{ }} to { }. Doubled braces reach the LLM verbatim, which may copy them into replies and break downstream json.loads.

  • Document the actual brace rules; drop the wrong "double to escape" note.
  • Switch all JSON examples in docs and the quickstart example to single braces. Cross-reference from yaml.md.

Tests

ut & e2e

API

no

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

…in JSON examples

SafeFormatter (Python) and Prompt.formatMessages (Java) only substitute
{key}; they do not collapse {{ }} to { }. Doubled braces reach the LLM
verbatim, which may copy them into replies and break downstream json.loads.

- Document the actual brace rules; drop the wrong "double to escape" note.
- Switch all JSON examples in docs and the quickstart example to single
  braces. Cross-reference from yaml.md.

Closes apache#781

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue. and removed doc-included Your PR already contains the necessary documentation updates. labels Jun 8, 2026
@wenjin272 wenjin272 merged commit a33f4f2 into apache:main Jun 8, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant