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:
parent
e74090139c
commit
7a3869c476
|
@ -26,6 +26,7 @@ public/settings.json
|
|||
/thumbnails
|
||||
whitelist.txt
|
||||
.vscode
|
||||
.idea/
|
||||
secrets.json
|
||||
/dist
|
||||
/backups/
|
||||
|
|
|
@ -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' });
|
||||
|
|
Loading…
Reference in New Issue