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: `MESSAGE FROM USER "${part.name}":\n` + extractText(part.content, "/gemini")
|
content: (Environment.USE_NAMES_IN_PROMPT ? `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: `MESSAGE FROM USER "${part.name}":\n` + extractText(part.content, Environment.BOT_PREFIX),
|
text: (Environment.USE_NAMES_IN_PROMPT ? `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: `MESSAGE FROM USER "${part.name}":\n` + extractText(part.content, Environment.BOT_PREFIX),
|
content: (Environment.USE_NAMES_IN_PROMPT ? `MESSAGE FROM USER "${part.name}":\n` : "") + extractText(part.content, Environment.BOT_PREFIX),
|
||||||
images: imageFilePath && i === 0 ? [imageFilePath] : null
|
images: imageFilePath && i === 0 ? [imageFilePath] : null
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ export class Environment {
|
|||||||
static USE_DAD: boolean;
|
static USE_DAD: boolean;
|
||||||
static USE_FU: boolean;
|
static USE_FU: boolean;
|
||||||
|
|
||||||
|
static USE_NAMES_IN_PROMPT: boolean;
|
||||||
|
|
||||||
static OLLAMA_MODEL?: string;
|
static OLLAMA_MODEL?: string;
|
||||||
static OLLAMA_ADDRESS?: string;
|
static OLLAMA_ADDRESS?: string;
|
||||||
static OLLAMA_API_KEY?: string;
|
static OLLAMA_API_KEY?: string;
|
||||||
@@ -43,6 +45,8 @@ export class Environment {
|
|||||||
Environment.USE_DAD = process.env.USE_DAD == "true";
|
Environment.USE_DAD = process.env.USE_DAD == "true";
|
||||||
Environment.USE_FU = process.env.USE_FU == "true";
|
Environment.USE_FU = process.env.USE_FU == "true";
|
||||||
|
|
||||||
|
Environment.USE_NAMES_IN_PROMPT = process.env.USE_NAMES_IN_PROMPT == "true";
|
||||||
|
|
||||||
Environment.OLLAMA_MODEL = process.env.OLLAMA_MODEL;
|
Environment.OLLAMA_MODEL = process.env.OLLAMA_MODEL;
|
||||||
Environment.OLLAMA_ADDRESS = process.env.OLLAMA_ADDRESS;
|
Environment.OLLAMA_ADDRESS = process.env.OLLAMA_ADDRESS;
|
||||||
Environment.OLLAMA_API_KEY = process.env.OLLAMA_API_KEY;
|
Environment.OLLAMA_API_KEY = process.env.OLLAMA_API_KEY;
|
||||||
|
|||||||
Reference in New Issue
Block a user