optional usage of names in prompt
This commit is contained in:
@@ -40,7 +40,7 @@ export class GeminiChat extends ChatCommand {
|
|||||||
const chatMessages = messageParts.map(part => {
|
const chatMessages = messageParts.map(part => {
|
||||||
return {
|
return {
|
||||||
role: part.bot ? "assistant" : "user",
|
role: part.bot ? "assistant" : "user",
|
||||||
content: (Environment.USE_NAMES_IN_PROMPT ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, "/gemini")
|
content: (Environment.USE_NAMES_IN_PROMPT && !part.bot ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, "/gemini")
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
chatMessages.reverse();
|
chatMessages.reverse();
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export class MistralChat extends ChatCommand {
|
|||||||
const content = [];
|
const content = [];
|
||||||
content.push({
|
content.push({
|
||||||
type: "text",
|
type: "text",
|
||||||
text: (Environment.USE_NAMES_IN_PROMPT ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, Environment.BOT_PREFIX),
|
text: (Environment.USE_NAMES_IN_PROMPT && !part.bot ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, Environment.BOT_PREFIX),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (imageFilePath && i === 0) {
|
if (imageFilePath && i === 0) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export class OllamaChat extends ChatCommand {
|
|||||||
const chatMessages = messageParts.map((part, i) => {
|
const chatMessages = messageParts.map((part, i) => {
|
||||||
return {
|
return {
|
||||||
role: part.bot ? "assistant" : "user",
|
role: part.bot ? "assistant" : "user",
|
||||||
content: (Environment.USE_NAMES_IN_PROMPT ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, Environment.BOT_PREFIX),
|
content: (Environment.USE_NAMES_IN_PROMPT && !part.bot ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, Environment.BOT_PREFIX),
|
||||||
images: imageFilePath && i === 0 ? [imageFilePath] : null
|
images: imageFilePath && i === 0 ? [imageFilePath] : null
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user