diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index 6f28d980..aea91cbe 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -22,6 +22,7 @@ jobs: AIO_RUNTIME_APIHOST: 'https://adobeioruntime.net' FIREFALL_ENDPOINT: 'https://firefall.adobe.io' FIREFALL_API_KEY: aem-sidekick-genai-assistant + TARGET_API_KEY: 1a6d085515114ef9a6937de9ab7d61fe IMS_ENDPOINT: 'https://ims-na1.adobelogin.com' IMS_CLIENT_ID: aem-genai-assistant IMS_SERVICE_CLIENT_ID: aem-sidekick-genai-assistant @@ -35,7 +36,8 @@ jobs: run: | npm install npm run grammar + npm run prompts npm run build npm run lint npm run test - npm run deploy \ No newline at end of file + npm run deploy diff --git a/.github/workflows/deploy_qa.yml b/.github/workflows/deploy_qa.yml index ce2400a2..600d01df 100644 --- a/.github/workflows/deploy_qa.yml +++ b/.github/workflows/deploy_qa.yml @@ -2,7 +2,7 @@ name: Deploy to QA on: pull_request: - branches: + branches: - main types: [closed] @@ -24,6 +24,7 @@ jobs: AIO_RUNTIME_APIHOST: 'https://adobeioruntime.net' FIREFALL_ENDPOINT: 'https://firefall.adobe.io' FIREFALL_API_KEY: aem-sidekick-genai-assistant + TARGET_API_KEY: 1a6d085515114ef9a6937de9ab7d61fe IMS_ENDPOINT: 'https://ims-na1.adobelogin.com' IMS_CLIENT_ID: aem-genai-assistant IMS_SERVICE_CLIENT_ID: aem-sidekick-genai-assistant @@ -37,7 +38,8 @@ jobs: run: | npm install npm run grammar + npm run prompts npm run build npm run lint npm run test - npm run deploy \ No newline at end of file + npm run deploy diff --git a/.github/workflows/pr_test_frontend.yml b/.github/workflows/pr_test_frontend.yml index 61b664a4..16efb120 100644 --- a/.github/workflows/pr_test_frontend.yml +++ b/.github/workflows/pr_test_frontend.yml @@ -20,6 +20,7 @@ jobs: run: | npm install npm run grammar + npm run prompts npm run build npm run lint - npm run test \ No newline at end of file + npm run test diff --git a/.gitignore b/.gitignore index 94d480bb..d8e76e8b 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ coverage # logs folder for aio-run-detached logs + diff --git a/.husky/pre-commit b/.husky/pre-commit index ebb93947..3c6cd645 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,17 +1,10 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -# If *.prompt files or prompt-index.json file have changed, run prompts -if [ -n "$(git diff --cached --name-only | grep -E 'examples/.*\.prompt$')" ] || [ -n "$(git diff --cached --name-only | grep -E 'examples/prompt-index.json$')" ]; then - npm run prompts -else - echo "No prompt files changed. Skipping 'npm run prompts'" -fi - # If excel or csv files in the examples/ directory have changed, run the zip examples script if [ -n "$(git diff --cached --name-only | grep -E 'examples/.*\.(csv|xlsx)$')" ]; then npm run examples -else +else echo "No excel or csv files changed. Skipping 'npm run examples'" fi diff --git a/actions/csv/index.js b/actions/csv/index.js index 33ecafb8..36962e38 100644 --- a/actions/csv/index.js +++ b/actions/csv/index.js @@ -15,7 +15,7 @@ const { asGenericAction } = require('../GenericAction.js'); async function main({ url }) { const text = await wretch(url).get().text(); - const { data } = Papa.parse(text, {}); + const { data } = Papa.parse(text, { skipEmptyLines: true }); return data; } diff --git a/data/bundled-prompt-templates.json b/data/bundled-prompt-templates.json index e102a2e0..d8258300 100644 --- a/data/bundled-prompt-templates.json +++ b/data/bundled-prompt-templates.json @@ -6,12 +6,12 @@ { "Label": "Cards", "Description": "Generate crisp, audience-centric copy for your website's card elements - title and body included.", - "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a Card. block which has multiple Card elements. A Card contains summary content and actions about a single subject and linking to its details. They can be used by themselves or within a list. Cards are interactive, and the entire Card container needs to be clickable. Each Card has its own title and description text which should not be presenting detailed information or multiple concepts. Upon interacting with the Card element, {{explain_interaction}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to engage with users to click and {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for a Card targeted to our target audience that is concise, engaging and persuasive to the user by selecting any available content provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below and address the following hypotheses:\n- Users will be more likely to engage with the Card if it is personalized to their interests.\n- Users will be more likely to engage with the Card if the text is concise, persuasive and engaging.\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of three parts, a Title, a Body and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 6 words or 30 characters, including spaces.\n* The Body text must not exceed 13 words or 65 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@explain_interaction,\n label=\"Explain user interaction\",\n description=\"Elaborate on the user's interaction with the element, emphasizing the results and impacts of the interaction\",\n default=\"the user is taken to a product page displaying a detailed view of our bestselling wireless headphones. Here, they can read product specifications, customer reviews, and make a purchase if they so choose\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" + "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a Card. block which has multiple Card elements. A Card contains summary content and actions about a single subject and linking to its details. They can be used by themselves or within a list. Cards are interactive, and the entire Card container needs to be clickable. Each Card has its own title and description text which should not be presenting detailed information or multiple concepts. Upon interacting with the Card element, {{explain_interaction}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to engage with users to click and {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for a Card targeted to our target audience that is concise, engaging and persuasive to the user by selecting any available content provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below and address the following hypotheses:\n- Users will be more likely to engage with the Card if it is personalized to their interests.\n- Users will be more likely to engage with the Card if the text is concise, persuasive and engaging.\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of three parts, a Title, a Body and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 6 words or 30 characters, including spaces.\n* The Body text must not exceed 13 words or 65 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@explain_interaction,\n label=\"Explain user interaction\",\n description=\"Elaborate on the user's interaction with the element, emphasizing the results and impacts of the interaction\",\n default=\"the user is taken to a product page displaying a detailed view of our bestselling wireless headphones. Here, they can read product specifications, customer reviews, and make a purchase if they so choose\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/fix-csv-urls/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" }, { "Label": "Cart abandonment", "Description": "With a mix of charm and strategy, this prompt delivers diligent web text to prompt customers on their pending orders.", - "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a web banner reminding them that they have an on-going purchase ready in their shopping cart. Upon interacting with the web banner, the user will navigate to a page where they can complete the checkout process or, alternatively, compare and choose a different product for purchase.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is for users to complete a purchase, either by completing the purchase that is in their shopping cart or by choosing a new product.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for a web banner targeted to our target audience that is specific to the Additional Context provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements numbered in triple backticks (```) below and address the following hypotheses:\n- Customers will be more likely complete a purchase if there's a sense of urgency\n- Customers will be more likely complete a purchase if it is easy for them to complete the purchase\n- Customers will be more likely complete a purchase if the offer is relevant to their needs\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of four parts, a Title, a Body, a Call-to-Action and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 7 words or 35 characters, including spaces.\n* The Body text must not exceed 15 words or 75 characters, including spaces.\n* The Call-to-Action text must not exceed 4 words or 20 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Avoid generic phrases like \"Learn More\", \"Get Started\" in the call-to-action text.\n10. Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" + "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a web banner reminding them that they have an on-going purchase ready in their shopping cart. Upon interacting with the web banner, the user will navigate to a page where they can complete the checkout process or, alternatively, compare and choose a different product for purchase.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is for users to complete a purchase, either by completing the purchase that is in their shopping cart or by choosing a new product.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for a web banner targeted to our target audience that is specific to the Additional Context provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements numbered in triple backticks (```) below and address the following hypotheses:\n- Customers will be more likely complete a purchase if there's a sense of urgency\n- Customers will be more likely complete a purchase if it is easy for them to complete the purchase\n- Customers will be more likely complete a purchase if the offer is relevant to their needs\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of four parts, a Title, a Body, a Call-to-Action and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 7 words or 35 characters, including spaces.\n* The Body text must not exceed 15 words or 75 characters, including spaces.\n* The Call-to-Action text must not exceed 4 words or 20 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Avoid generic phrases like \"Learn More\", \"Get Started\" in the call-to-action text.\n10. Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/fix-csv-urls/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" }, { "Label": "FAQ Section", @@ -21,22 +21,22 @@ { "Label": "Headline", "Description": "Discover a distinctive headline copy for your website, attentively crafted to engage your target market.", - "Template": "{{# --------------------- }}\n{{# CONTEXT }}\n{{# --------------------- }}\nGenerate compelling headlines for our web page's hero banner, designed to immediately captivate users. The headline is the first element visitors encounter, making it crucial for establishing an immediate connection and setting the tone for their interaction with the website.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# --------------------- }}\n{{# TASK }}\n{{# --------------------- }}\nYour task is to create {{number_of_variations}} unique headline(s), targeted to our target audience, that are impactful, and aligned with the users' interests and preferences. Each headline should embody our intent to {{explain_intent}} and incorporate any relevant information provided in [[{{additional_context}}]]. Keep in mind the specific traits of our target audience.\n\n{{# --------------------- }}\n{{# REQUIREMENTS }}\n{{# --------------------- }}\nTo ensure the Headlines are effective and meet our objectives, adhere to the following guidelines:\n- The text must consist of two parts, a Headline and a \"AI Rationale\".\n- In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n- Each Headline must be concise and impactful.\n- Not exceeding 10 words or 50 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The Headlines should avoid repetition and not use the same adjective more than once.\n- The product or service name must be included in the Headline.\n- Headlines should not end with exclamation marks or points.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n\n{{# --------------------- }}\n{{# METADATA }}\n{{# --------------------- }}\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" + "Template": "{{# --------------------- }}\n{{# CONTEXT }}\n{{# --------------------- }}\nGenerate compelling headlines for our web page's hero banner, designed to immediately captivate users. The headline is the first element visitors encounter, making it crucial for establishing an immediate connection and setting the tone for their interaction with the website.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# --------------------- }}\n{{# TASK }}\n{{# --------------------- }}\nYour task is to create {{number_of_variations}} unique headline(s), targeted to our target audience, that are impactful, and aligned with the users' interests and preferences. Each headline should embody our intent to {{explain_intent}} and incorporate any relevant information provided in [[{{additional_context}}]]. Keep in mind the specific traits of our target audience.\n\n{{# --------------------- }}\n{{# REQUIREMENTS }}\n{{# --------------------- }}\nTo ensure the Headlines are effective and meet our objectives, adhere to the following guidelines:\n- The text must consist of two parts, a Headline and a \"AI Rationale\".\n- In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n- Each Headline must be concise and impactful.\n- Not exceeding 10 words or 50 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The Headlines should avoid repetition and not use the same adjective more than once.\n- The product or service name must be included in the Headline.\n- Headlines should not end with exclamation marks or points.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n\n{{# --------------------- }}\n{{# METADATA }}\n{{# --------------------- }}\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/fix-csv-urls/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" }, { "Label": "Hero Banner", "Description": "Design a compelling hero banner for your website, featuring a captivating title, body, and call-to-action button.", - "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a Hero banner. A Hero banner is an interface element which creates an immediate impact with its visually striking image on the right and compelling text on the left, including a title, body, and call-to-action button. It effectively communicates the website's core message, capturing users' attention and guiding them towards the desired action. Upon interacting with the Hero banner, {{explain_interaction}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to engage with users to click and {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for a Hero banner, targeted to our target audience, that is concise, engaging and persuasive to the user by selecting any available content provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below and address the following hypotheses:\n- Users will be more likely to engage with the Hero banner if it is personalized to their interests.\n- Users will be more likely to engage with the Hero banner if the Call-to-Action is clear, concise and relevant to the page content.\n- Users will be more likely to engage with the Hero banner if the text is concise, persuasive and engaging.\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of four parts, a Title, a Body, a Call-to-Action and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 7 words or 35 characters, including spaces.\n* The Body text must not exceed 15 words or 75 characters, including spaces.\n* The Call-to-Action text must not exceed 4 words or 20 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@explain_interaction,\n label=\"Explain user interaction\",\n description=\"Elaborate on the user's interaction with the element, emphasizing the results and impacts of the interaction\",\n default=\"the user is taken to a product page displaying a detailed view of our bestselling wireless headphones. Here, they can read product specifications, customer reviews, and make a purchase if they so choose\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" + "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a Hero banner. A Hero banner is an interface element which creates an immediate impact with its visually striking image on the right and compelling text on the left, including a title, body, and call-to-action button. It effectively communicates the website's core message, capturing users' attention and guiding them towards the desired action. Upon interacting with the Hero banner, {{explain_interaction}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to engage with users to click and {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for a Hero banner, targeted to our target audience, that is concise, engaging and persuasive to the user by selecting any available content provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below and address the following hypotheses:\n- Users will be more likely to engage with the Hero banner if it is personalized to their interests.\n- Users will be more likely to engage with the Hero banner if the Call-to-Action is clear, concise and relevant to the page content.\n- Users will be more likely to engage with the Hero banner if the text is concise, persuasive and engaging.\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of four parts, a Title, a Body, a Call-to-Action and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 7 words or 35 characters, including spaces.\n* The Body text must not exceed 15 words or 75 characters, including spaces.\n* The Call-to-Action text must not exceed 4 words or 20 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@explain_interaction,\n label=\"Explain user interaction\",\n description=\"Elaborate on the user's interaction with the element, emphasizing the results and impacts of the interaction\",\n default=\"the user is taken to a product page displaying a detailed view of our bestselling wireless headphones. Here, they can read product specifications, customer reviews, and make a purchase if they so choose\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/fix-csv-urls/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" }, { "Label": "Rewrite", "Description": "Rewrite. Reuse. Repurpose.", - "Template": "Original copy: `{{original_text}}`.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to rewrite the original text to be {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy, targeted to our target audience by rewriting the original copy, provided in single backticks (`) above, to satisfy our intent. When rewriting, you may also use any available content provided in double-brackets ([[]]) below.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below:\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of any relevant parts present in the original copy and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* Any remaining relevant parts must not exceed the original word and character counts, respectively.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@original_text,\n label=\"Text to rewrite\",\n description=\"Provide the text or copy you want to rewrite\",\n default=\"Amazing apps. Endless possibilities. Create something beautiful, boost productivity, and deliver engaging experiences with Adobe software. View all products\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Rewrite the text to be...\",\n description=\"Specify the primary intention for rewriting the content\",\n default=\"written for social media instead of a webpage\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" + "Template": "Original copy: `{{original_text}}`.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to rewrite the original text to be {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy, targeted to our target audience by rewriting the original copy, provided in single backticks (`) above, to satisfy our intent. When rewriting, you may also use any available content provided in double-brackets ([[]]) below.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below:\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of any relevant parts present in the original copy and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* Any remaining relevant parts must not exceed the original word and character counts, respectively.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@original_text,\n label=\"Text to rewrite\",\n description=\"Provide the text or copy you want to rewrite\",\n default=\"Amazing apps. Endless possibilities. Create something beautiful, boost productivity, and deliver engaging experiences with Adobe software. View all products\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Rewrite the text to be...\",\n description=\"Specify the primary intention for rewriting the content\",\n default=\"written for social media instead of a webpage\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/fix-csv-urls/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" }, { "Label": "Tile", "Description": "Craft engaging website Tile content, tailored to your target audience, with a succinct title and body.", - "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a Tile. A Tile is a rectangular or square-shaped interface element that serves as a container for specific content. Tiles are primarily used as clickable elements that lead users to other parts of the website, or to perform certain actions. They are designed to simplify user interactions and provide a visually appealing way to navigate and access information. Upon interacting with the Tile, {{explain_interaction}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to engage with users to click and {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for the Tile, targeted to our target audience, that is concise, engaging and persuasive to the user by selecting any available content provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below and address the following hypotheses:\n- Users will be more likely to engage with the Tile if it is personalized to their interests.\n- Users will be more likely to engage with the Tile if the call-to-action is clear, concise and relevant to the page content.\n- Users will be more likely to engage with the Tile if the text is concise, persuasive and engaging.\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of three parts, a Title, a Body and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 10 words or 50 characters, including spaces.\n* The Body text must not exceed 16 words or 80 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@explain_interaction,\n label=\"Explain user interaction\",\n description=\"Elaborate on the user's interaction with the element, emphasizing the results and impacts of the interaction\",\n default=\"the user is taken to a product page displaying a detailed view of our bestselling wireless headphones. Here, they can read product specifications, customer reviews, and make a purchase if they so choose\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" + "Template": "{{# -------------------------------------------------------------------------- }}\n{{# CONTEXT }}\n{{# Describe the context of where content will be displayed, detailing the }}\n{{# intented user experience or expected interaction. }}\n{{# -------------------------------------------------------------------------- }}\nOn our webpage, users are presented with a Tile. A Tile is a rectangular or square-shaped interface element that serves as a container for specific content. Tiles are primarily used as clickable elements that lead users to other parts of the website, or to perform certain actions. They are designed to simplify user interactions and provide a visually appealing way to navigate and access information. Upon interacting with the Tile, {{explain_interaction}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# INTENT }}\n{{# State the intended user experience and the rationale behind crafting such }}\n{{# an experience. }}\n{{# -------------------------------------------------------------------------- }}\nOur intent is to engage with users to click and {{explain_intent}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TARGET AUDIENCE }}\n{{# Describe the audience you're targeting by specifying all relevant traits }}\n{{# or behaviors. }}\n{{# -------------------------------------------------------------------------- }}\nYour assigned target audience is {{target_audience}}.\n\n{{# -------------------------------------------------------------------------- }}\n{{# TASK }}\n{{# Describe the content to be generated. We suggest you modify the hypotheses }}\n{{# to fit your needs. }}\n{{# -------------------------------------------------------------------------- }}\nYour task is to compose {{number_of_variations}} distinct piece(s) of copy for the Tile, targeted to our target audience, that is concise, engaging and persuasive to the user by selecting any available content provided in double-brackets ([[]]) below. The text you compose will be used to test the hypotheses below in a live experiment. Keep in mind the specific traits of our target audience, considering that users will typically only read the title.\n\nTo accomplish your task, the text you compose must strictly comply with the following requirements listed in triple backticks (```) below and address the following hypotheses:\n- Users will be more likely to engage with the Tile if it is personalized to their interests.\n- Users will be more likely to engage with the Tile if the call-to-action is clear, concise and relevant to the page content.\n- Users will be more likely to engage with the Tile if the text is concise, persuasive and engaging.\n\n{{# -------------------------------------------------------------------------- }}\n{{# REQUIREMENTS }}\n{{# Specify any and all conditions your content must comply with to meet your }}\n{{# brand writing guidelines. }}\n{{# -------------------------------------------------------------------------- }}\nRequirements: ```\n- The text must consist of three parts, a Title, a Body and a \"AI Rationale\".\n- The text must be brief, such that:\n* In 20 words (100 characters) or less, compose the \"AI Rationale\" text first and use it to explain your reasoning for composing the copy, before composing the other parts.\n* The Title text must not exceed 10 words or 50 characters, including spaces.\n* The Body text must not exceed 16 words or 80 characters, including spaces.\n- The tone of the text needs to be: {{tone_of_voice}}.\n- The product name must appear once either in the Title text or Body text.\n- Never abbreviate or shorten the name of the product in the text.\n- Compose the text without using the same adjective more than once.\n- Do not use exclamation marks or points at the end of sentences in the text.\n- Do not use exclamation marks or points in the text.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n```\n\n{{# -------------------------------------------------------------------------- }}\n{{# ADDTIONAL CONTEXT }}\n{{# Here you will Provide more background information or specific details to }}\n{{# guide the creation of the content. }}\n{{# -------------------------------------------------------------------------- }}\nAdditional context: [[\n {{additional_context}}\n]]\n\n{{# -------------------------------------------------------------------------- }}\n{{# METADATA }}\n{{# -------------------------------------------------------------------------- }}\n{{@explain_interaction,\n label=\"Explain user interaction\",\n description=\"Elaborate on the user's interaction with the element, emphasizing the results and impacts of the interaction\",\n default=\"the user is taken to a product page displaying a detailed view of our bestselling wireless headphones. Here, they can read product specifications, customer reviews, and make a purchase if they so choose\",\n type=text\n}}\n\n{{@explain_intent,\n label=\"Explain interaction intent\",\n description=\"Specify the primary objectives and purposes of the content presented within the web element\",\n default=\"interact more with our website content so they can make an informed purchase decision\",\n type=text\n}}\n\n{{@target_audience,\n label=\"Target Audience\",\n description=\"Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.\",\n csv=\"https://raw.githubusercontent.com/adobe/aem-genai-assistant/fix-csv-urls/data/target-audiences.csv\",\n adobe_target=true,\n type=audience\n}}\n\n{{@tone_of_voice,\n label=\"Tone of voice\",\n description=\"Indicate the desired tone of voice\",\n default=\"optimistic, smart, engaging, human, and creative\",\n type=text\n}}\n\n{{@number_of_variations,\n label=\"Number of Variations\",\n description=\"Enter a number to generate the desired number of variations\",\n default=4,\n type=number\n}}\n\n{{@additional_context,\n label=\"Additional Context and Trusted Source Documents\",\n description=\"Provide more background information or specific details to guide the creation of the content. For Trusted Source Documents, include specific context, which can include your branding materials, website content, data schemas for such data, templates, and other trusted documents. Include additional prompting E.g. 'use the following source document as a reference in generation to match brand voice' to ensure accurate use.\",\n default=\"No additional context provided\",\n type=text\n}}\n" } ], ":type": "sheet" diff --git a/package.json b/package.json index 08042cfb..24a72f85 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build": "REACT_APP_VERSION=$npm_package_version aio app build", "deploy:app": "npm run grammar && REACT_APP_VERSION=$npm_package_version aio app deploy --no-actions", "deploy:actions": "aio app deploy --no-web-assets", - "deploy": "npm run grammar && REACT_APP_VERSION=$npm_package_version aio app deploy", + "deploy": "npm run grammar && npm run prompts && REACT_APP_VERSION=$npm_package_version aio app deploy", "lint": "eslint --quiet 'web-src/src/**/*.js' 'actions/*.js'", "fix": "eslint --fix --quiet 'web-src/src/**/*.js' 'actions/*.js'", "test": "jest --collectCoverageFrom='[\"web-src/src/**/*.js\",\"actions/**/*.js\"]' --coverage --passWithNoTests ./actions ./web-src/src ./e2e" diff --git a/prompt-templates/card.prompt b/prompt-templates/card.prompt index a43d12f8..5408aabb 100644 --- a/prompt-templates/card.prompt +++ b/prompt-templates/card.prompt @@ -79,7 +79,7 @@ Additional context: [[ {{@target_audience, label="Target Audience", description="Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.", - csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/data/target-audiences.csv", + csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/GIT_BRANCH/data/target-audiences.csv", adobe_target=true, type=audience }} diff --git a/prompt-templates/cart-abandonment.prompt b/prompt-templates/cart-abandonment.prompt index 532a3901..41667e36 100644 --- a/prompt-templates/cart-abandonment.prompt +++ b/prompt-templates/cart-abandonment.prompt @@ -68,7 +68,7 @@ Additional context: [[ {{@target_audience, label="Target Audience", description="Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.", - csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv", + csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/GIT_BRANCH/data/target-audiences.csv", adobe_target=true, type=audience }} diff --git a/prompt-templates/headline.prompt b/prompt-templates/headline.prompt index de503a50..817777fd 100644 --- a/prompt-templates/headline.prompt +++ b/prompt-templates/headline.prompt @@ -42,7 +42,7 @@ To ensure the Headlines are effective and meet our objectives, adhere to the fol {{@target_audience, label="Target Audience", description="Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.", - csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv", + csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/GIT_BRANCH/data/target-audiences.csv", adobe_target=true, type=audience }} diff --git a/prompt-templates/hero.prompt b/prompt-templates/hero.prompt index 815a05e7..80fc2289 100644 --- a/prompt-templates/hero.prompt +++ b/prompt-templates/hero.prompt @@ -81,7 +81,7 @@ Additional context: [[ {{@target_audience, label="Target Audience", description="Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.", - csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv", + csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/GIT_BRANCH/data/target-audiences.csv", adobe_target=true, type=audience }} diff --git a/prompt-templates/rewrite.prompt b/prompt-templates/rewrite.prompt index 9d5a8c63..8a8d1492 100644 --- a/prompt-templates/rewrite.prompt +++ b/prompt-templates/rewrite.prompt @@ -66,7 +66,7 @@ Additional context: [[ {{@target_audience, label="Target Audience", description="Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.", - csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv", + csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/GIT_BRANCH/data/target-audiences.csv", adobe_target=true, type=audience }} diff --git a/prompt-templates/tile.prompt b/prompt-templates/tile.prompt index b19efbdb..7e920eb8 100644 --- a/prompt-templates/tile.prompt +++ b/prompt-templates/tile.prompt @@ -80,7 +80,7 @@ Additional context: [[ {{@target_audience, label="Target Audience", description="Choose your audience. For Target, audiences with no description will be unavailable. For CSV, Adobe provides audiences to get you started. To modify audiences publish a CSV file and update the URL in the prompt.", - csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/settings/data/target-audiences.csv", + csv="https://raw.githubusercontent.com/adobe/aem-genai-assistant/GIT_BRANCH/data/target-audiences.csv", adobe_target=true, type=audience }} diff --git a/scripts/prompt-generator.js b/scripts/prompt-generator.js index 3c4a9da1..0b600022 100644 --- a/scripts/prompt-generator.js +++ b/scripts/prompt-generator.js @@ -12,6 +12,7 @@ const fs = require('fs'); const path = require('path'); +const { exec } = require('child_process'); const DATA_DIR = path.join(__dirname, '../data'); const PROMPT_TEMPLATES_DIR = path.join(__dirname, '../prompt-templates'); @@ -64,6 +65,18 @@ const createBundledPromptTemplates = (promptIndex) => { return bundledPromptTemplates; }; +const getGitBranchName = async () => { + return new Promise((resolve) => { + exec('git branch --show-current', (err, stdout, stderr) => { + if (err) { + console.error(`Error: ${err}`); + return 'main'; + } + resolve(stdout.replace(/(\r\n|\n|\r)/gm, '')); + }); + }); +}; + const startProgram = async () => { console.log('- Prompt Generator Starting...'); try { @@ -77,13 +90,14 @@ const startProgram = async () => { const bundledPromptTemplates = createBundledPromptTemplates(sortedPromptIndex); // Add the prompt templates to the target files - promptIndex.forEach((prompt) => { + for await (const prompt of promptIndex) { console.log(`\t\t* Adding ${prompt.label}`); // Try to read the prompt template file // If it fails, log the error and continue try { const promptTemplate = fs.readFileSync(path.join(PROMPT_TEMPLATES_DIR, prompt.file), 'utf8'); - prompt.template = promptTemplate; + const branchName = await getGitBranchName(); + prompt.template = promptTemplate.replace(/GIT_BRANCH/g, branchName); delete prompt.file; // Add the prompt to the bundled prompt templates file @@ -93,7 +107,7 @@ const startProgram = async () => { console.log(`\t\t\t! Error: ${err}`); console.log(`\t\t\t! Skipping ${prompt.label}`); } - }); + } // Write the prompt templates to the target files saveBundledPromptTemplates(bundledPromptTemplates); diff --git a/web-src/src/components/AudienceSelector.js b/web-src/src/components/AudienceSelector.js index 5940670f..36b6a319 100644 --- a/web-src/src/components/AudienceSelector.js +++ b/web-src/src/components/AudienceSelector.js @@ -34,6 +34,10 @@ const styles = { `, }; +export function isTargetEnabled(adobeTarget) { + return /^(true|1|yes)$/i.test(adobeTarget?.toString().trim()); +} + export function useGetItemsFromTarget() { const { targetService } = useApplicationContext(); return useCallback(async () => { @@ -93,9 +97,9 @@ export function AudienceSelector({ useEffect(() => { setItems([]); - if (adobeTarget && !csv) { + if (isTargetEnabled(adobeTarget) && !csv) { setDataSource(DATA_SOURCES.TARGET); - } else if (csv && !adobeTarget) { + } else if (csv && !isTargetEnabled(adobeTarget)) { setDataSource(DATA_SOURCES.CSV); } if (dataSource === DATA_SOURCES.CSV) { diff --git a/web-src/src/components/AudienceSelector.test.js b/web-src/src/components/AudienceSelector.test.js index 3ae886ee..d58db3bf 100644 --- a/web-src/src/components/AudienceSelector.test.js +++ b/web-src/src/components/AudienceSelector.test.js @@ -11,10 +11,58 @@ */ import { renderHook, waitFor } from '@testing-library/react'; import { useApplicationContext } from './ApplicationProvider.js'; -import { useGetItemsFromTarget } from './AudienceSelector.js'; +import { isTargetEnabled, useGetItemsFromTarget } from './AudienceSelector.js'; jest.mock('./ApplicationProvider.js'); +describe('isTargetEnabled', () => { + test('returns true for "true" (case insensitive) with or without spaces', () => { + expect(isTargetEnabled('true')).toBe(true); + expect(isTargetEnabled(' TRUE ')).toBe(true); + }); + + test('returns true for "1" with or without spaces', () => { + expect(isTargetEnabled('1')).toBe(true); + expect(isTargetEnabled(' 1 ')).toBe(true); + }); + + test('returns true for "yes" (case insensitive) with or without spaces', () => { + expect(isTargetEnabled('yes')).toBe(true); + expect(isTargetEnabled(' YES ')).toBe(true); + }); + + test('returns false for "false"', () => { + expect(isTargetEnabled('false')).toBe(false); + }); + + test('returns false for "0"', () => { + expect(isTargetEnabled('0')).toBe(false); + }); + + test('returns false for "no"', () => { + expect(isTargetEnabled('no')).toBe(false); + }); + + test('returns false for undefined', () => { + expect(isTargetEnabled(undefined)).toBe(false); + }); + + test('returns false for null', () => { + expect(isTargetEnabled(null)).toBe(false); + }); + + test('returns false for non-string values', () => { + expect(isTargetEnabled(123)).toBe(false); + expect(isTargetEnabled({})).toBe(false); + expect(isTargetEnabled([])).toBe(false); + }); + + test('returns false for string values that do not match "true", "1", or "yes" exactly, even without spaces', () => { + expect(isTargetEnabled('_True')).toBe(false); + expect(isTargetEnabled('Yes.')).toBe(false); + }); +}); + describe('useGetItemsFromTarget', () => { it('should return audiences sorted by description and mapped correctly', async () => { const mockAudiences = [