Skip to content

Commit e4edb72

Browse files
committed
remove system prompt
1 parent 2524a18 commit e4edb72

10 files changed

Lines changed: 27 additions & 115 deletions

File tree

src/data/primary_llm_system_prompt.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/providers/anthropic.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import Anthropic from "@anthropic-ai/sdk";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithAnthropic(
168
instruction: string,
@@ -26,7 +18,7 @@ export async function processWithAnthropic(
2618
const response = await anthropic.messages.create({
2719
model,
2820
max_tokens: 4096,
29-
system: loadSystemPrompt(),
21+
system: SYSTEM_PROMPT,
3022
messages: [{ role: "user", content: instruction }],
3123
});
3224

src/providers/gemini.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import { GoogleGenerativeAI } from "@google/generative-ai";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithGemini(
168
instruction: string,
@@ -25,7 +17,7 @@ export async function processWithGemini(
2517

2618
const genModel = genAI.getGenerativeModel({
2719
model,
28-
systemInstruction: loadSystemPrompt(),
20+
systemInstruction: SYSTEM_PROMPT,
2921
});
3022

3123
const result = await genModel.generateContent(instruction);

src/providers/huggingface.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import fs from "fs";
2-
import path from "path";
31
import OpenAI from "openai";
42
import { logger } from "../shared/logger";
53

64
const HUGGINGFACE_BASE_URL = "https://router.huggingface.co/v1";
75

8-
function loadSystemPrompt(): string {
9-
try {
10-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
11-
return fs.readFileSync(promptPath, "utf-8");
12-
} catch {
13-
return "You are a helpful coding assistant.";
14-
}
15-
}
6+
const SYSTEM_PROMPT =
7+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
168

179
export async function processWithHuggingFace(
1810
instruction: string,
@@ -32,7 +24,7 @@ export async function processWithHuggingFace(
3224
model,
3325
max_tokens: 4096,
3426
messages: [
35-
{ role: "system", content: loadSystemPrompt() },
27+
{ role: "system", content: SYSTEM_PROMPT },
3628
{ role: "user", content: instruction },
3729
],
3830
});

src/providers/minimax.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import fs from "fs";
2-
import path from "path";
31
import Anthropic from "@anthropic-ai/sdk";
42
import { logger } from "../shared/logger";
53

64
const MINIMAX_BASE_URL = "https://api.minimax.chat/v1";
75

8-
function loadSystemPrompt(): string {
9-
try {
10-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
11-
return fs.readFileSync(promptPath, "utf-8");
12-
} catch {
13-
return "You are a helpful coding assistant.";
14-
}
15-
}
6+
const SYSTEM_PROMPT =
7+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
168

179
export async function processWithMiniMax(
1810
instruction: string,
@@ -31,7 +23,7 @@ export async function processWithMiniMax(
3123
const response = await client.messages.create({
3224
model,
3325
max_tokens: 4096,
34-
system: loadSystemPrompt(),
26+
system: SYSTEM_PROMPT,
3527
messages: [{ role: "user", content: instruction }],
3628
});
3729

src/providers/mistral.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import OpenAI from "openai";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithMistral(
168
instruction: string,
@@ -30,7 +22,7 @@ export async function processWithMistral(
3022
model,
3123
max_tokens: 4096,
3224
messages: [
33-
{ role: "system", content: loadSystemPrompt() },
25+
{ role: "system", content: SYSTEM_PROMPT },
3426
{ role: "user", content: instruction },
3527
],
3628
});

src/providers/moonshot.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import OpenAI from "openai";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithMoonshot(
168
instruction: string,
@@ -30,7 +22,7 @@ export async function processWithMoonshot(
3022
model,
3123
max_tokens: 4096,
3224
messages: [
33-
{ role: "system", content: loadSystemPrompt() },
25+
{ role: "system", content: SYSTEM_PROMPT },
3426
{ role: "user", content: instruction },
3527
],
3628
});

src/providers/openai.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import OpenAI from "openai";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithOpenAI(
168
instruction: string,
@@ -27,7 +19,7 @@ export async function processWithOpenAI(
2719
model,
2820
max_tokens: 4096,
2921
messages: [
30-
{ role: "system", content: loadSystemPrompt() },
22+
{ role: "system", content: SYSTEM_PROMPT },
3123
{ role: "user", content: instruction },
3224
],
3325
});

src/providers/openrouter.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import OpenAI from "openai";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithOpenRouter(
168
instruction: string,
@@ -34,7 +26,7 @@ export async function processWithOpenRouter(
3426
model,
3527
max_tokens: 4096,
3628
messages: [
37-
{ role: "system", content: loadSystemPrompt() },
29+
{ role: "system", content: SYSTEM_PROMPT },
3830
{ role: "user", content: instruction },
3931
],
4032
});

src/providers/xai.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import fs from "fs";
2-
import path from "path";
31
import OpenAI from "openai";
42
import { logger } from "../shared/logger";
53

6-
function loadSystemPrompt(): string {
7-
try {
8-
const promptPath = path.join(__dirname, "..", "data", "primary_llm_system_prompt.txt");
9-
return fs.readFileSync(promptPath, "utf-8");
10-
} catch {
11-
return "You are a helpful coding assistant.";
12-
}
13-
}
4+
const SYSTEM_PROMPT =
5+
"You are TxtCode AI — a helpful, knowledgeable coding assistant accessible via messaging. Be concise, use markdown for clarity, and suggest /code mode for deep coding work.";
146

157
export async function processWithXAI(
168
instruction: string,
@@ -30,7 +22,7 @@ export async function processWithXAI(
3022
model,
3123
max_tokens: 4096,
3224
messages: [
33-
{ role: "system", content: loadSystemPrompt() },
25+
{ role: "system", content: SYSTEM_PROMPT },
3426
{ role: "user", content: instruction },
3527
],
3628
});

0 commit comments

Comments
 (0)