@zimtsui/typechat 0.0.99 → 0.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/verbatim/instruction.md +15 -11
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Motivation
|
|
4
4
|
|
|
5
|
-
When
|
|
5
|
+
When an LLM outputs structured data in JSON format (e.g., legacy LLM function calling), if there are too many special characters in a string property (e.g., a large LaTeX document, or a complex shell command), the LLM is prone to make mistakes in JSON escaping.
|
|
6
6
|
|
|
7
7
|
XML Verbatim Channel is designed to avoid escaping in LLM messages.
|
|
8
8
|
|
|
9
9
|
## Declaration of Channels
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
LLM developer/user messages are expected to declare all available XML Verbatim Channels in the form of
|
|
12
12
|
|
|
13
13
|
<verbatim:declaration name="NAME OF CHANNEL">
|
|
14
14
|
<verbatim:description>DESCRIPTION OF CHANNEL</verbatim:description>
|
|
@@ -26,35 +26,39 @@ The LLM system/user message is expected to declare all available XML Verbatim Ch
|
|
|
26
26
|
|
|
27
27
|
## Request through Channels
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
In an LLM AI message you output, you can make a request through a specified channel in the form of
|
|
30
30
|
|
|
31
31
|
<verbatim:request name="NAME OF CHANNEL">
|
|
32
|
-
<verbatim:parameter name="NAME OF PARAMETER 1"><![CDATA[ARGUMENT OF THIS PARAMETER]]></verbatim:parameter>
|
|
33
|
-
<verbatim:parameter name="NAME OF PARAMETER 2"><![CDATA[ARGUMENT OF THIS PARAMETER]]></verbatim:parameter>
|
|
32
|
+
<verbatim:parameter name="NAME OF PARAMETER 1"><![CDATA[VERBATIM ARGUMENT OF THIS PARAMETER]]></verbatim:parameter>
|
|
33
|
+
<verbatim:parameter name="NAME OF PARAMETER 2"><![CDATA[VERBATIM ARGUMENT OF THIS PARAMETER]]></verbatim:parameter>
|
|
34
34
|
</verbatim:request>
|
|
35
35
|
|
|
36
36
|
- The only attribute of <verbatim:request> is `name`. Additional attributes will be ignored.
|
|
37
37
|
- The only attribute of <verbatim:parameter> is `name`. Additional attributes will be ignored.
|
|
38
|
-
- All arguments must be wrapped in CDATA. The CDATA sections will be extracted not by standard XML parsers, but by regular expressions instead. Therefore, they can directly contain `]]>`, which is not allowed in standard
|
|
38
|
+
- All arguments must be wrapped in CDATA. The CDATA sections will be extracted not by standard XML parsers, but by regular expressions instead. Therefore, they can directly contain `]]>`, which is not allowed in standard XML.
|
|
39
39
|
|
|
40
40
|
## Response from Channels
|
|
41
41
|
|
|
42
|
-
The LLM user message may contain the responses
|
|
42
|
+
The LLM user message following your requests may contain the responses to your requests in the form of
|
|
43
43
|
|
|
44
|
-
<verbatim:response name="NAME OF CHANNEL"><![CDATA[RESPONSE]]></verbatim:response>
|
|
44
|
+
<verbatim:response name="NAME OF CHANNEL"><![CDATA[VERBATIM RESPONSE]]></verbatim:response>
|
|
45
|
+
|
|
46
|
+
The CDATA section may directly contain `]]>`, which is not allowed in standard XML.
|
|
45
47
|
|
|
46
48
|
Not all requests have a response.
|
|
47
49
|
|
|
48
50
|
## Verbatim Quotation
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
LLM developer/user messages may contain verbatim quotations in the form of
|
|
53
|
+
|
|
54
|
+
<verbatim:quotation author="AUTHOR OF QUOTATION"><![CDATA[VERBATIM QUOTATION]]></verbatim:quotation>
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
The CDATA section may directly contain `]]>`, which is not allowed in standard XML.
|
|
53
57
|
|
|
54
58
|
The attribute `author` is optional.
|
|
55
59
|
|
|
56
60
|
## System Information
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
LLM developer/user messages may contain system information from the AI agent framework in the form of
|
|
59
63
|
|
|
60
64
|
<verbatim:system></verbatim:system>
|