Compare commits

...

2 Commits

Author SHA1 Message Date
sebseb7
fb6c1159fe feat: Upgrade model version to gpt-5.4 for category description generation and German to English translation 2026-03-06 10:07:56 +01:00
sebseb7
738db9b085 typo 2026-03-06 06:37:33 +01:00
3 changed files with 5 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ const DIST_DIR = './dist';
const OUTPUT_CSV = './category-descriptions.csv'; const OUTPUT_CSV = './category-descriptions.csv';
// Model configuration // Model configuration
const MODEL = 'gpt-5.1'; const MODEL = 'gpt-5.4';
// Initialize OpenAI client // Initialize OpenAI client
const openai = new OpenAI({ const openai = new OpenAI({
@@ -149,7 +149,7 @@ async function generateSEODescription(productListContent, categoryName, category
} }
const response = await openai.responses.create({ const response = await openai.responses.create({
model: "gpt-5.1", model: "gpt-5.4",
input: [ input: [
{ {
"role": "developer", "role": "developer",

View File

@@ -19,7 +19,6 @@ const run = async () => {
const inputPath = path.join(imagesDir, image.src); const inputPath = path.join(imagesDir, image.src);
const outputPath = path.join(imagesDir, image.dest); const outputPath = path.join(imagesDir, image.dest);
console.log('d');
if (!fs.existsSync(inputPath)) { if (!fs.existsSync(inputPath)) {
console.warn(`⚠️ Input file not found: ${inputPath}`); console.warn(`⚠️ Input file not found: ${inputPath}`);
continue; continue;
@@ -57,5 +56,4 @@ const run = async () => {
} }
}; };
console.log('dsfs');
run(); run();

View File

@@ -54,7 +54,7 @@ const LEGAL_FILES = [
]; ];
// Model configuration // Model configuration
const GERMAN_TO_ENGLISH_MODEL = 'gpt-5.1'; // High-quality model for German -> English (critical step) const GERMAN_TO_ENGLISH_MODEL = 'gpt-5.4'; // High-quality model for German -> English (critical step)
const ENGLISH_TO_OTHER_MODEL = 'gpt-4.1-mini'; // Faster/cheaper model for English -> Other languages const ENGLISH_TO_OTHER_MODEL = 'gpt-4.1-mini'; // Faster/cheaper model for English -> Other languages
// Supported languages for translation // Supported languages for translation
@@ -356,7 +356,7 @@ function writeTranslationFile(filePath, translationString) {
} }
// Function to translate content using OpenAI (for German to English) // Function to translate content using OpenAI (for German to English)
async function translateContent(content, systemPrompt, targetLanguage = null, model = 'gpt-5.1') { async function translateContent(content, systemPrompt, targetLanguage = null, model = 'gpt-5.4') {
try { try {
const prompt = targetLanguage const prompt = targetLanguage
? systemPrompt.replace(/{{targetLanguage}}/g, targetLanguage) ? systemPrompt.replace(/{{targetLanguage}}/g, targetLanguage)
@@ -379,7 +379,7 @@ async function translateContent(content, systemPrompt, targetLanguage = null, mo
} }
// Function to translate English to other languages (optimized for caching) // Function to translate English to other languages (optimized for caching)
async function translateToTargetLanguage(englishContent, targetLanguage, model = 'gpt-4o-mini', isLegalFile = false) { async function translateToTargetLanguage(englishContent, targetLanguage, model = 'gpt-4.1-mini', isLegalFile = false) {
try { try {
// Choose appropriate system prompt based on file type // Choose appropriate system prompt based on file type
const promptTemplate = isLegalFile const promptTemplate = isLegalFile