feat(google-ads): Add 'Special Instructions' support - Users can now provide custom preferences (tone, focus, etc.) for AI generation - Added 'Special Instructions' field to Google Ads Generator UI (below Target Audience) - Localized labels and placeholders in English, Russian, and Hebrew - Integrated instructions into AI prompts across Ollama, Qwen, and Z.AI providers

This commit is contained in:
Gemini AI
2025-12-28 02:51:53 +04:00
Unverified
parent 9e74fcba67
commit 2c7b233bca
6 changed files with 44 additions and 7 deletions

View File

@@ -43,6 +43,7 @@ export default function GoogleAdsGenerator() {
const [budgetMax, setBudgetMax] = useState("2000");
const [duration, setDuration] = useState("30 days");
const [industry, setIndustry] = useState("");
const [specialInstructions, setSpecialInstructions] = useState("");
const [copied, setCopied] = useState(false);
const [expandedSections, setExpandedSections] = useState<string[]>(["keywords"]);
@@ -193,7 +194,9 @@ export default function GoogleAdsGenerator() {
budgetRange: { min: parseInt(budgetMin), max: parseInt(budgetMax), currency: "USD" },
campaignDuration: duration,
industry,
language: "English"
competitors: [],
language: language === "ru" ? "Russian" : language === "he" ? "Hebrew" : "English",
specialInstructions: specialInstructions,
}, selectedProvider, selectedModel);
console.log("[GoogleAdsGenerator] Generation result:", result);
@@ -282,8 +285,9 @@ export default function GoogleAdsGenerator() {
const result = await modelAdapter.generateMagicWand(
websiteUrl,
productString,
parseInt(budgetMax),
firstProduct.url ? `${firstProduct.name} (URL: ${firstProduct.url})` : firstProduct.name,
Number(budgetMax),
specialInstructions,
selectedProvider,
selectedModel
);
@@ -896,6 +900,16 @@ export default function GoogleAdsGenerator() {
/>
</div>
<div className="space-y-2">
<label className="text-xs lg:text-sm font-medium">{t.specialInstructions}</label>
<Textarea
placeholder={t.specialInstructionsPlaceholder}
value={specialInstructions}
onChange={(e) => setSpecialInstructions(e.target.value)}
className="min-h-[80px] lg:min-h-[100px] resize-y text-sm"
/>
</div>
{error && (
<div className="rounded-md bg-destructive/10 p-2.5 lg:p-3 text-xs lg:text-sm text-destructive">
{error}

View File

@@ -47,6 +47,8 @@ export const translations = {
budget: "Budget (USD/mo)",
industry: "Industry",
targetAudience: "Target Audience",
specialInstructions: "Special Instructions",
specialInstructionsPlaceholder: "Any special preferences or instructions for AI to consider (e.g. 'Use a humorous tone', 'Focus on seasonal discounts')...",
generateAds: "Generate Ads",
magicWand: "Magic Wand",
researching: "Researching...",
@@ -169,6 +171,8 @@ export const translations = {
budget: "Бюджет (USD/мес)",
industry: "Отрасль",
targetAudience: "Целевая аудитория",
specialInstructions: "Особые инструкции",
specialInstructionsPlaceholder: "Любые особые предпочтения или инструкции для ИИ (например, 'Используйте юмористический тон', 'Сосредоточьтесь на сезонных скидках')...",
generateAds: "Создать рекламу",
magicWand: "Магический жезл",
researching: "Исследование...",
@@ -291,6 +295,8 @@ export const translations = {
budget: "תקציב (USD לחודש)",
industry: "תעשייה",
targetAudience: "קהל יעד",
specialInstructions: "הוראות מיוחדות",
specialInstructionsPlaceholder: "כל העדפה או הוראה מיוחדת עבור ה-AI (למשל: 'השתמש בטון הומוריסטי', 'התמקד בהנחות עונתיות')...",
generateAds: "חולל מודעות",
magicWand: "מטה קסמים",
researching: "חוקר...",

View File

@@ -217,6 +217,7 @@ export class ModelAdapter {
industry?: string;
competitors?: string[];
language?: string;
specialInstructions?: string;
} = { productsServices: [] },
provider?: ModelProvider,
model?: string
@@ -230,12 +231,13 @@ export class ModelAdapter {
websiteUrl: string,
product: string,
budget: number,
specialInstructions?: string,
provider?: ModelProvider,
model?: string
): Promise<APIResponse<string>> {
const fallback = this.buildFallbackProviders(this.preferredProvider, "qwen", "ollama", "zai");
const providers: ModelProvider[] = provider ? [provider] : fallback;
return this.callWithFallback((service) => service.generateMagicWand(websiteUrl, product, budget, model), providers);
return this.callWithFallback((service) => service.generateMagicWand(websiteUrl, product, budget, specialInstructions, model), providers);
}

View File

@@ -445,6 +445,7 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
industry?: string;
competitors?: string[];
language?: string;
specialInstructions?: string;
} = { productsServices: [] },
model?: string
): Promise<APIResponse<string>> {
@@ -455,7 +456,8 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
campaignDuration,
industry = "General",
competitors = [],
language = "English"
language = "English",
specialInstructions = ""
} = options;
const systemMessage: ChatMessage = {
@@ -520,6 +522,7 @@ LANGUAGE: ${language}
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
Generate complete Google Ads package with keywords, ad copy, campaigns, and implementation guidance.`,
};
@@ -531,6 +534,7 @@ Generate complete Google Ads package with keywords, ad copy, campaigns, and impl
websiteUrl: string,
product: string,
budget: number,
specialInstructions?: string,
model?: string
): Promise<APIResponse<string>> {
const systemMessage: ChatMessage = {
@@ -595,6 +599,7 @@ CRITICAL REQUIREMENTS:
WEBSITE: ${websiteUrl}
PRODUCT/SERVICE: ${product}
MONTHLY BUDGET: $${budget}
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions.`,
};

View File

@@ -772,6 +772,7 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
industry?: string;
competitors?: string[];
language?: string;
specialInstructions?: string;
} = { productsServices: [] },
model?: string
): Promise<APIResponse<string>> {
@@ -782,7 +783,8 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
campaignDuration,
industry = "General",
competitors = [],
language = "English"
language = "English",
specialInstructions = ""
} = options;
const systemMessage: ChatMessage = {
@@ -847,6 +849,7 @@ LANGUAGE: ${language}
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
Generate complete Google Ads package with keywords, ad copy, campaigns, and implementation guidance.`,
};
@@ -858,6 +861,7 @@ Generate complete Google Ads package with keywords, ad copy, campaigns, and impl
websiteUrl: string,
product: string,
budget: number,
specialInstructions?: string,
model?: string
): Promise<APIResponse<string>> {
const systemMessage: ChatMessage = {
@@ -922,6 +926,7 @@ CRITICAL REQUIREMENTS:
WEBSITE: ${websiteUrl}
PRODUCT/SERVICE: ${product}
MONTHLY BUDGET: $${budget}
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions.`,
};

View File

@@ -418,6 +418,7 @@ Return the complete JSON with full htmlContent for each slide. Make each slide V
industry?: string;
competitors?: string[];
language?: string;
specialInstructions?: string;
} = { productsServices: [] },
model?: string
): Promise<APIResponse<string>> {
@@ -428,7 +429,8 @@ Return the complete JSON with full htmlContent for each slide. Make each slide V
campaignDuration,
industry = "General",
competitors = [],
language = "English"
language = "English",
specialInstructions = ""
} = options;
const systemMessage: ChatMessage = {
@@ -592,6 +594,7 @@ LANGUAGE: ${language}
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
Generate a COMPLETE Google Ads package including:
🔍 Comprehensive keyword research (primary, long-tail, negative)
@@ -610,6 +613,7 @@ Make this campaign READY TO LAUNCH with copy-paste ready content!`,
websiteUrl: string,
product: string,
budget: number,
specialInstructions?: string,
model?: string
): Promise<APIResponse<string>> {
const systemMessage: ChatMessage = {
@@ -676,6 +680,7 @@ CRITICAL REQUIREMENTS:
WEBSITE: ${websiteUrl}
PRODUCT/SERVICE: ${product}
MONTHLY BUDGET: $${budget}
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
MISSION: Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions that will DOMINATE this market.`,
};