mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Remove userPlaceholder #2962
This commit is contained in:
		| @@ -155,9 +155,5 @@ claude: | |||||||
|   # (e.g {{random}} macro or lorebooks not as in-chat injections). |   # (e.g {{random}} macro or lorebooks not as in-chat injections). | ||||||
|   # Otherwise, you'll just waste money on cache misses. |   # Otherwise, you'll just waste money on cache misses. | ||||||
|   enableSystemPromptCache: false |   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 -- | # -- SERVER PLUGIN CONFIGURATION -- | ||||||
| enableServerPlugins: false | enableServerPlugins: false | ||||||
|   | |||||||
| @@ -294,7 +294,7 @@ function convertCohereMessages(messages, charName = '', userName = '') { | |||||||
|                 msg.content = messages[index - 1].content; |                 msg.content = messages[index - 1].content; | ||||||
|                 messages.splice(index - 1, 1); |                 messages.splice(index - 1, 1); | ||||||
|             } else { |             } 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) |         // 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 |     // A prompt should end with a user/tool message | ||||||
|     if (!['user', 'tool'].includes(messages[messages.length - 1].role)) { |     if (messages.length && !['user', 'tool'].includes(messages[messages.length - 1].role)) { | ||||||
|         const userPlaceholder = getConfigValue('cohere.userPlaceholder', PROMPT_PLACEHOLDER || 'Continue'); |         messages[messages.length - 1].role = 'user'; | ||||||
|         messages.push({ |  | ||||||
|             role: 'user', |  | ||||||
|             content: userPlaceholder, |  | ||||||
|         }); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     return { chatHistory: messages }; |     return { chatHistory: messages }; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user