@mathew-macharia/black-mamba 1.0.5 → 1.0.7
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/package.json +1 -1
- package/src/pi/prompt.js +18 -8
package/package.json
CHANGED
package/src/pi/prompt.js
CHANGED
|
@@ -84,20 +84,30 @@ Pi is connected to chat.deepseek and sends and listens to https://chat.deepseek.
|
|
|
84
84
|
return prompt;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
return `[Tool output received from user's machine. To take another action, output a DSML block and end turn. If complete, respond directly to the user.]
|
|
89
|
-
|
|
90
|
-
REMINDER: When calling a tool, four tags must be there, in this order:
|
|
91
|
-
|
|
92
|
-
<|DSML|tool_calls>
|
|
87
|
+
const DSML_TOOL_BLOCK_TEMPLATE = `<|DSML|tool_calls>
|
|
93
88
|
<|DSML|invoke name="TOOL">
|
|
94
89
|
<|DSML|parameter name="PARAM" string="true">VALUE</|DSML|parameter>
|
|
95
90
|
</|DSML|invoke>
|
|
96
91
|
</|DSML|tool_calls>`;
|
|
92
|
+
|
|
93
|
+
const DSML_TOOL_BLOCK_FOOTER =
|
|
94
|
+
'The closing tag is </|DSML|tool_calls>, not "calls". Do not change pipe characters or tag names.';
|
|
95
|
+
|
|
96
|
+
export function formatToolTurnDirective(_tools = []) {
|
|
97
|
+
return `[Tool output received from user's machine. To take another action, output a DSML block and end turn. If complete, respond directly to the user.]
|
|
98
|
+
|
|
99
|
+
REQUIRED — Your next tool call MUST use this exact block. Copy the tag names verbatim. If any tag is wrong or missing, Pi will not run the tool.
|
|
100
|
+
|
|
101
|
+
${DSML_TOOL_BLOCK_TEMPLATE}
|
|
102
|
+
|
|
103
|
+
${DSML_TOOL_BLOCK_FOOTER}`;
|
|
97
104
|
}
|
|
98
105
|
|
|
99
|
-
export const USER_TOOL_REMINDER =
|
|
100
|
-
|
|
106
|
+
export const USER_TOOL_REMINDER = `[REQUIRED: To run a tool, output one DSML block exactly as specified in the tool rules and end your turn. Wrong tags are ignored. If no tool is needed, reply in plain text only.]
|
|
107
|
+
|
|
108
|
+
${DSML_TOOL_BLOCK_TEMPLATE}
|
|
109
|
+
|
|
110
|
+
${DSML_TOOL_BLOCK_FOOTER}`;
|
|
101
111
|
|
|
102
112
|
function renderDsmlToolBlock(tc) {
|
|
103
113
|
const name = toolCallName(tc);
|