Lots of AI related tweaks/fixes

This commit is contained in:
2026-01-22 11:06:05 -05:00
parent 3d1e8862f9
commit 1866cbae7e
18 changed files with 385 additions and 284 deletions

View File

@@ -80,7 +80,6 @@ function buildDescriptionUserPrompt(product, prompts) {
parts.push('CRITICAL RULES:');
parts.push('- If isValid is false, you MUST provide a suggestion with the improved description');
parts.push('- If there are ANY issues, isValid MUST be false and suggestion MUST contain the corrected text');
parts.push('- If the description is empty or very short, write a complete description based on the product name');
parts.push('- Only set isValid to true if there are ZERO issues and the description needs no changes');
parts.push('');
parts.push('RESPOND WITH JSON:');

View File

@@ -41,7 +41,6 @@ function sanitizeIssue(issue) {
* @param {string} [product.company_name] - Company name
* @param {string} [product.line_name] - Product line name
* @param {string} [product.subline_name] - Product subline name
* @param {string} [product.description] - Product description (for context)
* @param {string[]} [product.siblingNames] - Names of other products in the same line
* @param {Object} prompts - Prompts loaded from database
* @param {string} prompts.general - General naming conventions
@@ -73,10 +72,6 @@ function buildNameUserPrompt(product, prompts) {
parts.push(`SUBLINE: ${product.subline_name}`);
}
if (product.description) {
parts.push(`DESCRIPTION (for context): ${product.description.substring(0, 200)}`);
}
// Add sibling context for naming decisions
if (product.siblingNames && product.siblingNames.length > 0) {
parts.push('');
@@ -84,15 +79,6 @@ function buildNameUserPrompt(product, prompts) {
product.siblingNames.forEach(name => {
parts.push(`- ${name}`);
});
parts.push('');
parts.push('Use this context to determine:');
parts.push('- If this product needs a differentiator (multiple similar products exist)');
parts.push('- If naming is consistent with sibling products');
parts.push('- Which naming pattern is appropriate (single vs multiple products in line)');
} else if (product.line_name) {
parts.push('');
parts.push('This appears to be the ONLY product in this line (no siblings in current batch).');
parts.push('Use the single-product naming pattern: [Line Name] [Product Name] - [Company]');
}
// Add response format instructions

View File

@@ -59,7 +59,7 @@ function buildSanityCheckUserPrompt(products, prompts) {
suggestion: 'Suggested fix or verification (optional)'
}
],
summary: 'Brief overall assessment of the batch quality'
summary: '1-2 sentences summarizing the batch quality'
}, null, 2));
parts.push('');

View File

@@ -101,9 +101,9 @@ function createNameValidationTask() {
{ role: 'system', content: prompts.system },
{ role: 'user', content: userPrompt }
],
model: MODELS.SMALL, // openai/gpt-oss-20b - reasoning model
model: MODELS.LARGE, // openai/gpt-oss-120b - reasoning model
temperature: 0.2, // Low temperature for consistent results
maxTokens: 1500, // Reasoning models need extra tokens for thinking
maxTokens: 3000, // Reasoning models need extra tokens for thinking
responseFormat: { type: 'json_object' }
});