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:
@@ -43,6 +43,7 @@ export default function GoogleAdsGenerator() {
|
|||||||
const [budgetMax, setBudgetMax] = useState("2000");
|
const [budgetMax, setBudgetMax] = useState("2000");
|
||||||
const [duration, setDuration] = useState("30 days");
|
const [duration, setDuration] = useState("30 days");
|
||||||
const [industry, setIndustry] = useState("");
|
const [industry, setIndustry] = useState("");
|
||||||
|
const [specialInstructions, setSpecialInstructions] = useState("");
|
||||||
|
|
||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
const [expandedSections, setExpandedSections] = useState<string[]>(["keywords"]);
|
const [expandedSections, setExpandedSections] = useState<string[]>(["keywords"]);
|
||||||
@@ -193,7 +194,9 @@ export default function GoogleAdsGenerator() {
|
|||||||
budgetRange: { min: parseInt(budgetMin), max: parseInt(budgetMax), currency: "USD" },
|
budgetRange: { min: parseInt(budgetMin), max: parseInt(budgetMax), currency: "USD" },
|
||||||
campaignDuration: duration,
|
campaignDuration: duration,
|
||||||
industry,
|
industry,
|
||||||
language: "English"
|
competitors: [],
|
||||||
|
language: language === "ru" ? "Russian" : language === "he" ? "Hebrew" : "English",
|
||||||
|
specialInstructions: specialInstructions,
|
||||||
}, selectedProvider, selectedModel);
|
}, selectedProvider, selectedModel);
|
||||||
|
|
||||||
console.log("[GoogleAdsGenerator] Generation result:", result);
|
console.log("[GoogleAdsGenerator] Generation result:", result);
|
||||||
@@ -282,8 +285,9 @@ export default function GoogleAdsGenerator() {
|
|||||||
|
|
||||||
const result = await modelAdapter.generateMagicWand(
|
const result = await modelAdapter.generateMagicWand(
|
||||||
websiteUrl,
|
websiteUrl,
|
||||||
productString,
|
firstProduct.url ? `${firstProduct.name} (URL: ${firstProduct.url})` : firstProduct.name,
|
||||||
parseInt(budgetMax),
|
Number(budgetMax),
|
||||||
|
specialInstructions,
|
||||||
selectedProvider,
|
selectedProvider,
|
||||||
selectedModel
|
selectedModel
|
||||||
);
|
);
|
||||||
@@ -896,6 +900,16 @@ export default function GoogleAdsGenerator() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</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 && (
|
{error && (
|
||||||
<div className="rounded-md bg-destructive/10 p-2.5 lg:p-3 text-xs lg:text-sm text-destructive">
|
<div className="rounded-md bg-destructive/10 p-2.5 lg:p-3 text-xs lg:text-sm text-destructive">
|
||||||
{error}
|
{error}
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ export const translations = {
|
|||||||
budget: "Budget (USD/mo)",
|
budget: "Budget (USD/mo)",
|
||||||
industry: "Industry",
|
industry: "Industry",
|
||||||
targetAudience: "Target Audience",
|
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",
|
generateAds: "Generate Ads",
|
||||||
magicWand: "Magic Wand",
|
magicWand: "Magic Wand",
|
||||||
researching: "Researching...",
|
researching: "Researching...",
|
||||||
@@ -169,6 +171,8 @@ export const translations = {
|
|||||||
budget: "Бюджет (USD/мес)",
|
budget: "Бюджет (USD/мес)",
|
||||||
industry: "Отрасль",
|
industry: "Отрасль",
|
||||||
targetAudience: "Целевая аудитория",
|
targetAudience: "Целевая аудитория",
|
||||||
|
specialInstructions: "Особые инструкции",
|
||||||
|
specialInstructionsPlaceholder: "Любые особые предпочтения или инструкции для ИИ (например, 'Используйте юмористический тон', 'Сосредоточьтесь на сезонных скидках')...",
|
||||||
generateAds: "Создать рекламу",
|
generateAds: "Создать рекламу",
|
||||||
magicWand: "Магический жезл",
|
magicWand: "Магический жезл",
|
||||||
researching: "Исследование...",
|
researching: "Исследование...",
|
||||||
@@ -291,6 +295,8 @@ export const translations = {
|
|||||||
budget: "תקציב (USD לחודש)",
|
budget: "תקציב (USD לחודש)",
|
||||||
industry: "תעשייה",
|
industry: "תעשייה",
|
||||||
targetAudience: "קהל יעד",
|
targetAudience: "קהל יעד",
|
||||||
|
specialInstructions: "הוראות מיוחדות",
|
||||||
|
specialInstructionsPlaceholder: "כל העדפה או הוראה מיוחדת עבור ה-AI (למשל: 'השתמש בטון הומוריסטי', 'התמקד בהנחות עונתיות')...",
|
||||||
generateAds: "חולל מודעות",
|
generateAds: "חולל מודעות",
|
||||||
magicWand: "מטה קסמים",
|
magicWand: "מטה קסמים",
|
||||||
researching: "חוקר...",
|
researching: "חוקר...",
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ export class ModelAdapter {
|
|||||||
industry?: string;
|
industry?: string;
|
||||||
competitors?: string[];
|
competitors?: string[];
|
||||||
language?: string;
|
language?: string;
|
||||||
|
specialInstructions?: string;
|
||||||
} = { productsServices: [] },
|
} = { productsServices: [] },
|
||||||
provider?: ModelProvider,
|
provider?: ModelProvider,
|
||||||
model?: string
|
model?: string
|
||||||
@@ -230,12 +231,13 @@ export class ModelAdapter {
|
|||||||
websiteUrl: string,
|
websiteUrl: string,
|
||||||
product: string,
|
product: string,
|
||||||
budget: number,
|
budget: number,
|
||||||
|
specialInstructions?: string,
|
||||||
provider?: ModelProvider,
|
provider?: ModelProvider,
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
const fallback = this.buildFallbackProviders(this.preferredProvider, "qwen", "ollama", "zai");
|
const fallback = this.buildFallbackProviders(this.preferredProvider, "qwen", "ollama", "zai");
|
||||||
const providers: ModelProvider[] = provider ? [provider] : fallback;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -445,6 +445,7 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
|
|||||||
industry?: string;
|
industry?: string;
|
||||||
competitors?: string[];
|
competitors?: string[];
|
||||||
language?: string;
|
language?: string;
|
||||||
|
specialInstructions?: string;
|
||||||
} = { productsServices: [] },
|
} = { productsServices: [] },
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
@@ -455,7 +456,8 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
|
|||||||
campaignDuration,
|
campaignDuration,
|
||||||
industry = "General",
|
industry = "General",
|
||||||
competitors = [],
|
competitors = [],
|
||||||
language = "English"
|
language = "English",
|
||||||
|
specialInstructions = ""
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
const systemMessage: ChatMessage = {
|
const systemMessage: ChatMessage = {
|
||||||
@@ -520,6 +522,7 @@ LANGUAGE: ${language}
|
|||||||
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
|
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
|
||||||
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
|
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
|
||||||
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
|
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
|
||||||
|
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
|
||||||
|
|
||||||
Generate complete Google Ads package with keywords, ad copy, campaigns, and implementation guidance.`,
|
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,
|
websiteUrl: string,
|
||||||
product: string,
|
product: string,
|
||||||
budget: number,
|
budget: number,
|
||||||
|
specialInstructions?: string,
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
const systemMessage: ChatMessage = {
|
const systemMessage: ChatMessage = {
|
||||||
@@ -595,6 +599,7 @@ CRITICAL REQUIREMENTS:
|
|||||||
WEBSITE: ${websiteUrl}
|
WEBSITE: ${websiteUrl}
|
||||||
PRODUCT/SERVICE: ${product}
|
PRODUCT/SERVICE: ${product}
|
||||||
MONTHLY BUDGET: $${budget}
|
MONTHLY BUDGET: $${budget}
|
||||||
|
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
|
||||||
|
|
||||||
Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions.`,
|
Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions.`,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -772,6 +772,7 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
|
|||||||
industry?: string;
|
industry?: string;
|
||||||
competitors?: string[];
|
competitors?: string[];
|
||||||
language?: string;
|
language?: string;
|
||||||
|
specialInstructions?: string;
|
||||||
} = { productsServices: [] },
|
} = { productsServices: [] },
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
@@ -782,7 +783,8 @@ Generate SPECTACULAR slides with CSS3 animations, SVG charts, modern gradients,
|
|||||||
campaignDuration,
|
campaignDuration,
|
||||||
industry = "General",
|
industry = "General",
|
||||||
competitors = [],
|
competitors = [],
|
||||||
language = "English"
|
language = "English",
|
||||||
|
specialInstructions = ""
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
const systemMessage: ChatMessage = {
|
const systemMessage: ChatMessage = {
|
||||||
@@ -847,6 +849,7 @@ LANGUAGE: ${language}
|
|||||||
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
|
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
|
||||||
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
|
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
|
||||||
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
|
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
|
||||||
|
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
|
||||||
|
|
||||||
Generate complete Google Ads package with keywords, ad copy, campaigns, and implementation guidance.`,
|
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,
|
websiteUrl: string,
|
||||||
product: string,
|
product: string,
|
||||||
budget: number,
|
budget: number,
|
||||||
|
specialInstructions?: string,
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
const systemMessage: ChatMessage = {
|
const systemMessage: ChatMessage = {
|
||||||
@@ -922,6 +926,7 @@ CRITICAL REQUIREMENTS:
|
|||||||
WEBSITE: ${websiteUrl}
|
WEBSITE: ${websiteUrl}
|
||||||
PRODUCT/SERVICE: ${product}
|
PRODUCT/SERVICE: ${product}
|
||||||
MONTHLY BUDGET: $${budget}
|
MONTHLY BUDGET: $${budget}
|
||||||
|
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
|
||||||
|
|
||||||
Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions.`,
|
Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions.`,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -418,6 +418,7 @@ Return the complete JSON with full htmlContent for each slide. Make each slide V
|
|||||||
industry?: string;
|
industry?: string;
|
||||||
competitors?: string[];
|
competitors?: string[];
|
||||||
language?: string;
|
language?: string;
|
||||||
|
specialInstructions?: string;
|
||||||
} = { productsServices: [] },
|
} = { productsServices: [] },
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
@@ -428,7 +429,8 @@ Return the complete JSON with full htmlContent for each slide. Make each slide V
|
|||||||
campaignDuration,
|
campaignDuration,
|
||||||
industry = "General",
|
industry = "General",
|
||||||
competitors = [],
|
competitors = [],
|
||||||
language = "English"
|
language = "English",
|
||||||
|
specialInstructions = ""
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
const systemMessage: ChatMessage = {
|
const systemMessage: ChatMessage = {
|
||||||
@@ -592,6 +594,7 @@ LANGUAGE: ${language}
|
|||||||
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
|
${budgetRange ? `BUDGET: ${budgetRange.min}-${budgetRange.max} ${budgetRange.currency}/month` : ""}
|
||||||
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
|
${campaignDuration ? `DURATION: ${campaignDuration}` : ""}
|
||||||
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
|
${competitors.length > 0 ? `COMPETITORS: ${competitors.join(", ")}` : ""}
|
||||||
|
${specialInstructions ? `SPECIAL INSTRUCTIONS: ${specialInstructions}` : ""}
|
||||||
|
|
||||||
Generate a COMPLETE Google Ads package including:
|
Generate a COMPLETE Google Ads package including:
|
||||||
🔍 Comprehensive keyword research (primary, long-tail, negative)
|
🔍 Comprehensive keyword research (primary, long-tail, negative)
|
||||||
@@ -610,6 +613,7 @@ Make this campaign READY TO LAUNCH with copy-paste ready content!`,
|
|||||||
websiteUrl: string,
|
websiteUrl: string,
|
||||||
product: string,
|
product: string,
|
||||||
budget: number,
|
budget: number,
|
||||||
|
specialInstructions?: string,
|
||||||
model?: string
|
model?: string
|
||||||
): Promise<APIResponse<string>> {
|
): Promise<APIResponse<string>> {
|
||||||
const systemMessage: ChatMessage = {
|
const systemMessage: ChatMessage = {
|
||||||
@@ -676,6 +680,7 @@ CRITICAL REQUIREMENTS:
|
|||||||
WEBSITE: ${websiteUrl}
|
WEBSITE: ${websiteUrl}
|
||||||
PRODUCT/SERVICE: ${product}
|
PRODUCT/SERVICE: ${product}
|
||||||
MONTHLY BUDGET: $${budget}
|
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.`,
|
MISSION: Perform a DEEP 360° competitive intelligence analysis and generate 5-7 strategic campaign directions that will DOMINATE this market.`,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user