@promptbook/core 0.100.0-22 → 0.100.0-23
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/esm/index.es.js +95 -17
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +5 -1
- package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +6 -1
- package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +6 -1
- package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +5 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +95 -17
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -27,7 +27,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
27
27
|
* @generated
|
|
28
28
|
* @see https://github.com/webgptorg/promptbook
|
|
29
29
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-
|
|
30
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-23';
|
|
31
31
|
/**
|
|
32
32
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
33
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -208,9 +208,15 @@ class ActionCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
208
208
|
super('ACTION');
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
|
-
*
|
|
211
|
+
* Short one-line description of ACTION.
|
|
212
212
|
*/
|
|
213
213
|
get description() {
|
|
214
|
+
return 'Define agent capabilities and actions it can perform.';
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Markdown documentation for ACTION commitment.
|
|
218
|
+
*/
|
|
219
|
+
get documentation() {
|
|
214
220
|
return [
|
|
215
221
|
'# ACTION',
|
|
216
222
|
'',
|
|
@@ -268,9 +274,15 @@ class FormatCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
268
274
|
super('FORMAT');
|
|
269
275
|
}
|
|
270
276
|
/**
|
|
271
|
-
*
|
|
277
|
+
* Short one-line description of FORMAT.
|
|
272
278
|
*/
|
|
273
279
|
get description() {
|
|
280
|
+
return 'Specify output structure or formatting requirements.';
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Markdown documentation for FORMAT commitment.
|
|
284
|
+
*/
|
|
285
|
+
get documentation() {
|
|
274
286
|
return [
|
|
275
287
|
'# FORMAT',
|
|
276
288
|
'',
|
|
@@ -1040,9 +1052,15 @@ class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1040
1052
|
this.ragService = new FrontendRAGService();
|
|
1041
1053
|
}
|
|
1042
1054
|
/**
|
|
1043
|
-
*
|
|
1055
|
+
* Short one-line description of KNOWLEDGE.
|
|
1044
1056
|
*/
|
|
1045
1057
|
get description() {
|
|
1058
|
+
return 'Add domain **knowledge** via direct text or external sources (RAG).';
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Markdown documentation for KNOWLEDGE commitment.
|
|
1062
|
+
*/
|
|
1063
|
+
get documentation() {
|
|
1046
1064
|
return [
|
|
1047
1065
|
'# KNOWLEDGE',
|
|
1048
1066
|
'',
|
|
@@ -1145,9 +1163,15 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1145
1163
|
super('META IMAGE');
|
|
1146
1164
|
}
|
|
1147
1165
|
/**
|
|
1148
|
-
*
|
|
1166
|
+
* Short one-line description of META IMAGE.
|
|
1149
1167
|
*/
|
|
1150
1168
|
get description() {
|
|
1169
|
+
return "Set the agent's profile image URL.";
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Markdown documentation for META IMAGE commitment.
|
|
1173
|
+
*/
|
|
1174
|
+
get documentation() {
|
|
1151
1175
|
return [
|
|
1152
1176
|
'# META IMAGE',
|
|
1153
1177
|
'',
|
|
@@ -1163,7 +1187,9 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1163
1187
|
'META IMAGE /assets/agent-avatar.png',
|
|
1164
1188
|
'```',
|
|
1165
1189
|
'',
|
|
1166
|
-
]
|
|
1190
|
+
]
|
|
1191
|
+
.join('\\n')
|
|
1192
|
+
.replace(/\\\\n/g, '\\n');
|
|
1167
1193
|
}
|
|
1168
1194
|
applyToAgentModelRequirements(requirements, content) {
|
|
1169
1195
|
// META IMAGE doesn't modify the system message or model requirements
|
|
@@ -1219,9 +1245,15 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1219
1245
|
super('META LINK');
|
|
1220
1246
|
}
|
|
1221
1247
|
/**
|
|
1222
|
-
*
|
|
1248
|
+
* Short one-line description of META LINK.
|
|
1223
1249
|
*/
|
|
1224
1250
|
get description() {
|
|
1251
|
+
return 'Provide profile/source links for the person the agent models.';
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Markdown documentation for META LINK commitment.
|
|
1255
|
+
*/
|
|
1256
|
+
get documentation() {
|
|
1225
1257
|
return [
|
|
1226
1258
|
'# META LINK',
|
|
1227
1259
|
'',
|
|
@@ -1239,7 +1271,9 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1239
1271
|
'META LINK https://github.com/username',
|
|
1240
1272
|
'```',
|
|
1241
1273
|
'',
|
|
1242
|
-
]
|
|
1274
|
+
]
|
|
1275
|
+
.join('\\n')
|
|
1276
|
+
.replace(/\\\\n/g, '\\n');
|
|
1243
1277
|
}
|
|
1244
1278
|
applyToAgentModelRequirements(requirements, content) {
|
|
1245
1279
|
// META LINK doesn't modify the system message or model requirements
|
|
@@ -1299,9 +1333,15 @@ class ModelCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1299
1333
|
super('MODEL');
|
|
1300
1334
|
}
|
|
1301
1335
|
/**
|
|
1302
|
-
*
|
|
1336
|
+
* Short one-line description of MODEL.
|
|
1303
1337
|
*/
|
|
1304
1338
|
get description() {
|
|
1339
|
+
return 'Select the AI model and optional decoding parameters.';
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Markdown documentation for MODEL commitment.
|
|
1343
|
+
*/
|
|
1344
|
+
get documentation() {
|
|
1305
1345
|
return [
|
|
1306
1346
|
'# MODEL',
|
|
1307
1347
|
'',
|
|
@@ -1411,9 +1451,15 @@ class NoteCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1411
1451
|
super('NOTE');
|
|
1412
1452
|
}
|
|
1413
1453
|
/**
|
|
1414
|
-
*
|
|
1454
|
+
* Short one-line description of NOTE.
|
|
1415
1455
|
*/
|
|
1416
1456
|
get description() {
|
|
1457
|
+
return 'Add developer-facing notes without changing behavior or output.';
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Markdown documentation for NOTE commitment.
|
|
1461
|
+
*/
|
|
1462
|
+
get documentation() {
|
|
1417
1463
|
return [
|
|
1418
1464
|
'# NOTE',
|
|
1419
1465
|
'',
|
|
@@ -1496,9 +1542,15 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1496
1542
|
super('PERSONA');
|
|
1497
1543
|
}
|
|
1498
1544
|
/**
|
|
1499
|
-
*
|
|
1545
|
+
* Short one-line description of PERSONA.
|
|
1500
1546
|
*/
|
|
1501
1547
|
get description() {
|
|
1548
|
+
return 'Define who the agent is: background, expertise, and personality.';
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Markdown documentation for PERSONA commitment.
|
|
1552
|
+
*/
|
|
1553
|
+
get documentation() {
|
|
1502
1554
|
return [
|
|
1503
1555
|
'# PERSONA',
|
|
1504
1556
|
'',
|
|
@@ -1627,9 +1679,15 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1627
1679
|
super(type);
|
|
1628
1680
|
}
|
|
1629
1681
|
/**
|
|
1630
|
-
*
|
|
1682
|
+
* Short one-line description of RULE/RULES.
|
|
1631
1683
|
*/
|
|
1632
1684
|
get description() {
|
|
1685
|
+
return 'Add behavioral rules the agent must follow.';
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Markdown documentation for RULE/RULES commitment.
|
|
1689
|
+
*/
|
|
1690
|
+
get documentation() {
|
|
1633
1691
|
return [
|
|
1634
1692
|
`# ${this.type}`,
|
|
1635
1693
|
'',
|
|
@@ -1640,7 +1698,7 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1640
1698
|
'',
|
|
1641
1699
|
'Examples:',
|
|
1642
1700
|
'```book',
|
|
1643
|
-
|
|
1701
|
+
"RULE Always ask for clarification if the user's request is ambiguous",
|
|
1644
1702
|
'RULES Never provide medical advice, always refer to healthcare professionals',
|
|
1645
1703
|
'```',
|
|
1646
1704
|
'',
|
|
@@ -1692,9 +1750,15 @@ class SampleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1692
1750
|
super(type);
|
|
1693
1751
|
}
|
|
1694
1752
|
/**
|
|
1695
|
-
*
|
|
1753
|
+
* Short one-line description of SAMPLE/EXAMPLE.
|
|
1696
1754
|
*/
|
|
1697
1755
|
get description() {
|
|
1756
|
+
return 'Provide example responses to guide behavior.';
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* Markdown documentation for SAMPLE/EXAMPLE commitment.
|
|
1760
|
+
*/
|
|
1761
|
+
get documentation() {
|
|
1698
1762
|
return [
|
|
1699
1763
|
`# ${this.type}`,
|
|
1700
1764
|
'',
|
|
@@ -1709,7 +1773,9 @@ class SampleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1709
1773
|
'EXAMPLE For code questions, always include working code snippets',
|
|
1710
1774
|
'```',
|
|
1711
1775
|
'',
|
|
1712
|
-
]
|
|
1776
|
+
]
|
|
1777
|
+
.join('\\n')
|
|
1778
|
+
.replace(/\\\\n/g, '\\n');
|
|
1713
1779
|
}
|
|
1714
1780
|
applyToAgentModelRequirements(requirements, content) {
|
|
1715
1781
|
const trimmedContent = content.trim();
|
|
@@ -1757,9 +1823,15 @@ class StyleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1757
1823
|
super('STYLE');
|
|
1758
1824
|
}
|
|
1759
1825
|
/**
|
|
1760
|
-
*
|
|
1826
|
+
* Short one-line description of STYLE.
|
|
1761
1827
|
*/
|
|
1762
1828
|
get description() {
|
|
1829
|
+
return 'Control the tone and writing style of responses.';
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Markdown documentation for STYLE commitment.
|
|
1833
|
+
*/
|
|
1834
|
+
get documentation() {
|
|
1763
1835
|
return [
|
|
1764
1836
|
'# STYLE',
|
|
1765
1837
|
'',
|
|
@@ -1809,9 +1881,15 @@ class NotYetImplementedCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1809
1881
|
super(type);
|
|
1810
1882
|
}
|
|
1811
1883
|
/**
|
|
1812
|
-
*
|
|
1884
|
+
* Short one-line description of a placeholder commitment.
|
|
1813
1885
|
*/
|
|
1814
1886
|
get description() {
|
|
1887
|
+
return 'Placeholder commitment that appends content verbatim to the system message.';
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Markdown documentation available at runtime.
|
|
1891
|
+
*/
|
|
1892
|
+
get documentation() {
|
|
1815
1893
|
return [
|
|
1816
1894
|
`# ${this.type}`,
|
|
1817
1895
|
``,
|