Fix pretty printing

This commit is contained in:
2024-11-02 15:22:32 +01:00
parent a58ee40c2c
commit 96d14fc46d
6 changed files with 213 additions and 33 deletions

View File

@@ -147,6 +147,17 @@ The LLM is free to escape data any way it wants,
as long as it results in valid XML.
The response is validated against a schema.
#### XML Data Flow
Entries store their content as raw text. During context compilation, the XML formatter
wraps text content in CDATA sections, except when the content contains CDATA closing sequences.
In those cases, the formatter uses standard XML escaping.
This separation between storage and formatting:
- Keeps entry data clean and unescaped
- Centralizes XML formatting rules
- Makes it easy to change escaping rules without modifying entries
- Allows different formatting for different use cases
The Context is escaped using CDATA blocks.
Except when the data contains CDATA closing sequences.
Then the whole block is escaped using standard XML escaping.