diff --git a/default/config.yaml b/default/config.yaml index 902f8a4d5..b3057451a 100644 --- a/default/config.yaml +++ b/default/config.yaml @@ -155,9 +155,5 @@ claude: # (e.g {{random}} macro or lorebooks not as in-chat injections). # Otherwise, you'll just waste money on cache misses. enableSystemPromptCache: false -# -- COHERE API CONFIGURATION -- -cohere: - # A placeholder prompt to be used when the message array doesn't end with a user message - userPlaceholder: "Continue" # -- SERVER PLUGIN CONFIGURATION -- enableServerPlugins: false diff --git a/src/prompt-converters.js b/src/prompt-converters.js index a0c90c148..47cd9e368 100644 --- a/src/prompt-converters.js +++ b/src/prompt-converters.js @@ -294,7 +294,7 @@ function convertCohereMessages(messages, charName = '', userName = '') { msg.content = messages[index - 1].content; messages.splice(index - 1, 1); } else { - msg.content = `I'm going to call the tool for that: ${msg.tool_calls.map(tc => tc?.function?.name).join(', ')}`; + msg.content = `I'm going to call a tool for that: ${msg.tool_calls.map(tc => tc?.function?.name).join(', ')}`; } } // No names support (who would've thought) @@ -317,12 +317,8 @@ function convertCohereMessages(messages, charName = '', userName = '') { }); // A prompt should end with a user/tool message - if (!['user', 'tool'].includes(messages[messages.length - 1].role)) { - const userPlaceholder = getConfigValue('cohere.userPlaceholder', PROMPT_PLACEHOLDER || 'Continue'); - messages.push({ - role: 'user', - content: userPlaceholder, - }); + if (messages.length && !['user', 'tool'].includes(messages[messages.length - 1].role)) { + messages[messages.length - 1].role = 'user'; } return { chatHistory: messages };