Remove userPlaceholder #2962

face9462aa102e8523a47fee9af6d3bfc3debae3

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +3 -11Ignore whitespace
default/config.yaml+0 -4
@@ -155,9 +155,5 @@ claude:
155 # (e.g {{random}} macro or lorebooks not as in-chat injections).155 # (e.g {{random}} macro or lorebooks not as in-chat injections).
156 # Otherwise, you'll just waste money on cache misses.156 # Otherwise, you'll just waste money on cache misses.
157 enableSystemPromptCache: false157 enableSystemPromptCache: false
158# -- COHERE API CONFIGURATION --
159cohere:
160 # A placeholder prompt to be used when the message array doesn't end with a user message
161 userPlaceholder: "Continue"
162# -- SERVER PLUGIN CONFIGURATION --158# -- SERVER PLUGIN CONFIGURATION --
163enableServerPlugins: false159enableServerPlugins: false
src/prompt-converters.js+3 -7
@@ -294,7 +294,7 @@ function convertCohereMessages(messages, charName = '', userName = '') {
294 msg.content = messages[index - 1].content;294 msg.content = messages[index - 1].content;
295 messages.splice(index - 1, 1);295 messages.splice(index - 1, 1);
296 } else {296 } else {
297 msg.content = `I'm going to call the tool for that: ${msg.tool_calls.map(tc => tc?.function?.name).join(', ')}`;297 msg.content = `I'm going to call a tool for that: ${msg.tool_calls.map(tc => tc?.function?.name).join(', ')}`;
298 }298 }
299 }299 }
300 // No names support (who would've thought)300 // No names support (who would've thought)
@@ -317,12 +317,8 @@ function convertCohereMessages(messages, charName = '', userName = '') {
317 });317 });
318318
319 // A prompt should end with a user/tool message319 // A prompt should end with a user/tool message
320 if (!['user', 'tool'].includes(messages[messages.length - 1].role)) {320 if (messages.length && !['user', 'tool'].includes(messages[messages.length - 1].role)) {
321 const userPlaceholder = getConfigValue('cohere.userPlaceholder', PROMPT_PLACEHOLDER || 'Continue');321 messages[messages.length - 1].role = 'user';
322 messages.push({
323 role: 'user',
324 content: userPlaceholder,
325 });
326 }322 }
327323
328 return { chatHistory: messages };324 return { chatHistory: messages };