mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Do not apped start new chat messages on example chat handling
The prompt manager does this job now.
This commit is contained in:
		| @@ -488,10 +488,6 @@ function prepareExampleMessages(messages, exampleMessages, includeAll = false, ) | |||||||
|         for (const element of exampleMessages) { |         for (const element of exampleMessages) { | ||||||
|             // get the current example block with multiple user/bot messages |             // get the current example block with multiple user/bot messages | ||||||
|             let example_block = element; |             let example_block = element; | ||||||
|             // add the first message from the user to tell the model that it's a new dialogue |  | ||||||
|             if (example_block.length != 0) { |  | ||||||
|                 examples_tosend.push(new_chat_msg); |  | ||||||
|             } |  | ||||||
|             for (const example of example_block) { |             for (const example of example_block) { | ||||||
|                 // add all the messages from the example |                 // add all the messages from the example | ||||||
|                 examples_tosend.push(example); |                 examples_tosend.push(example); | ||||||
| @@ -529,9 +525,6 @@ function prepareExampleMessages(messages, exampleMessages, includeAll = false, ) | |||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             // include the heading |  | ||||||
|             example_block = [new_chat_msg, ...example_block]; |  | ||||||
|  |  | ||||||
|             // add the block only if there is enough space for all its messages |             // add the block only if there is enough space for all its messages | ||||||
|             const example_count = countTokens(example_block) |             const example_count = countTokens(example_block) | ||||||
|             if ((total_count + example_count) < (oai_settings.openai_max_context - oai_settings.openai_max_tokens)) { |             if ((total_count + example_count) < (oai_settings.openai_max_context - oai_settings.openai_max_tokens)) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user