@mathew-macharia/black-mamba 1.0.6 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/pi/prompt.js +17 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathew-macharia/black-mamba",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "OpenAI-compatible proxy that maps chat sessions onto DeepSeek web chat",
5
5
  "type": "module",
6
6
  "main": "index.js",
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
+ const DSML_TOOL_BLOCK_TEMPLATE = `<|DSML|tool_calls>
88
+ <|DSML|invoke name="TOOL">
89
+ <|DSML|parameter name="PARAM" string="true">VALUE</|DSML|parameter>
90
+ </|DSML|invoke>
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
+
87
96
  export function formatToolTurnDirective(_tools = []) {
88
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.]
89
98
 
90
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.
91
100
 
92
- <|DSML|tool_calls>
93
- <|DSML|invoke name="TOOL">
94
- <|DSML|parameter name="PARAM" string="true">VALUE</|DSML|parameter>
95
- </|DSML|invoke>
96
- </|DSML|tool_calls>`;
101
+ ${DSML_TOOL_BLOCK_TEMPLATE}
102
+
103
+ ${DSML_TOOL_BLOCK_FOOTER}`;
97
104
  }
98
105
 
99
- export const USER_TOOL_REMINDER =
100
- "[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.]";
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);