mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Enable Smart Context (ChromaDB) support within OpenAI API (#1125)
* Add JetBrains IDE .idea folder to .gitignore * Enable Smart Context (ChromaDB) support within OpenAI API
This commit is contained in:
@ -636,6 +636,11 @@ function populateChatCompletion(prompts, chatCompletion, { bias, quietPrompt, ty
|
||||
chatCompletion.insert(vectorsMemory, 'main');
|
||||
}
|
||||
|
||||
// Smart Context (ChromaDB)
|
||||
if (prompts.has('smartContext')) {
|
||||
chatCompletion.insert(Message.fromPrompt(prompts.get('smartContext')), 'main');
|
||||
}
|
||||
|
||||
// Decide whether dialogue examples should always be added
|
||||
if (power_user.pin_examples) {
|
||||
populateDialogueExamples(prompts, chatCompletion);
|
||||
@ -711,6 +716,14 @@ function preparePromptsForChatCompletion({Scenario, charPersonality, name2, worl
|
||||
identifier: 'vectorsMemory',
|
||||
});
|
||||
|
||||
// Smart Context (ChromaDB)
|
||||
const smartContext = extensionPrompts['chromadb'];
|
||||
if (smartContext && smartContext.value) systemPrompts.push({
|
||||
role: 'system',
|
||||
content: smartContext.value,
|
||||
identifier: 'smartContext'
|
||||
});
|
||||
|
||||
// Persona Description
|
||||
if (power_user.persona_description && power_user.persona_description_position === persona_description_positions.IN_PROMPT) {
|
||||
systemPrompts.push({ role: 'system', content: power_user.persona_description, identifier: 'personaDescription' });
|
||||
|
Reference in New Issue
Block a user