From 22efd423bc53113116b29e0fa11e15dff3c71230 Mon Sep 17 00:00:00 2001 From: Vitaly Tsaplin Date: Mon, 11 Mar 2024 13:53:04 +0100 Subject: [PATCH] fix: target mode visible when disabled (#224) --- .gitignore | 3 +- .husky/pre-commit | 9 +- data/bundled-prompt-templates.json | 43 --------- examples/target-audiences.xlsx | Bin 12060 -> 0 bytes package.json | 9 +- scripts/zip-examples.js | 98 --------------------- web-src/src/components/AudienceSelector.js | 2 +- 7 files changed, 9 insertions(+), 155 deletions(-) delete mode 100644 data/bundled-prompt-templates.json delete mode 100644 examples/target-audiences.xlsx delete mode 100644 scripts/zip-examples.js diff --git a/.gitignore b/.gitignore index d8e76e8b..52330c48 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,5 @@ coverage # logs folder for aio-run-detached logs - +# bundled prompt templates +/data/bundled-prompt-templates.json diff --git a/.husky/pre-commit b/.husky/pre-commit index 3c6cd645..75fac8e1 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,11 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -# 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 - echo "No excel or csv files changed. Skipping 'npm run examples'" -fi - -npm test && npm run lint +npm run lint diff --git a/data/bundled-prompt-templates.json b/data/bundled-prompt-templates.json deleted file mode 100644 index d8258300..00000000 --- a/data/bundled-prompt-templates.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "total": 7, - "offset": 0, - "limit": 7, - "data": [ - { - "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/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/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", - "Description": "Breathe life into a FAQ section, carefully curated with a fixed number of question-answer pairs.", - "Template": "{{# --------------------- }}\n{{# CONTEXT }}\n{{# --------------------- }}\nOn our webpage, users encounter an FAQ section that serves as a key resource for information on {{product}}. This section is designed to answer the most common questions. Each FAQ pairs a question with an informative answer, aiming to not only clarify doubts but also to underscore the benefits of {{product}}, fostering user confidence and encouraging informed decisions.\n\n{{# --------------------- }}\n{{# INTENT }}\n{{# --------------------- }}\nOur objective is to provide clear, concise, and useful content that addresses our customers' most pressing concerns and showcases the advantages of {{product}}.\n\n{{# --------------------- }}\n{{# TASK }}\n{{# --------------------- }}\nYou are tasked to formulate a list of {{number_of_questions}} FAQ entries for {{product}} that are engaging, informative, and tailored to our user base, utilizing any available content provided within double-brackets ([[]]). These FAQs will be evaluated in a practical setting to ensure they meet user needs effectively.\n\n{{# --------------------- }}\n{{# REQUIREMENTS }}\n{{# --------------------- }}\nEach FAQ must meet the following criteria to ensure clarity and conciseness:\n- The text must consist of three parts, a Question, an Answer 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- Questions should be direct and not exceed 15 words.\n- Answers must be informative yet brief, limited to 100 words.\n- The overall tone should be helpful and knowledgeable, instilling confidence in the user.\n- Format the response as an array of valid, iterable RFC8259 compliant JSON. Always list the \"AI Rationale\" attribute last.\n\nAdditional context for the {{product}} and user inquiries can be found here: [[{{additional_context}}]]\"\n\n{{# --------------------- }}\n{{# METADATA. }}\n{{# --------------------- }}\n{{@product,\n label=\"Product\", \n default=\"Best selling headphones\",\n description=\"Identify the specific product for which the FAQ is being created.\",\n type=text\n}}\n\n{{@number_of_questions,\n label=\"Number of Questions\",\n description=\"Enter the number of FAQ entries to be generated.\",\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": "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/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/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/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/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" -} \ No newline at end of file diff --git a/examples/target-audiences.xlsx b/examples/target-audiences.xlsx deleted file mode 100644 index 9d454065cca01ae6ad25296401d7259da0bfc180..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12060 zcmeHtg;yNe_I2Yf!QBb&?hrhUBzSOw6WrY$8utLf-Q67;2?Tcu7J|DI_%WGzZ)Wo5 z`~HFVs@JMowQiri>Q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p~rA0m6+G*b50Am^PEkN)$v(41s0 z!-ofd+-<*&LQ$@Ye9?K0HJW?-k^vAGp87Xb7;6`|*B&`eO>;BPEA>B6`Xsj|>)@Hv zwa=9Pqgd)_@cvm4XZd;gxp7L52S$Hn#R|Gkyd#adM%B-Z3Xa6U$ScZy=UA}f5sIKz z4YD+S`F7@M6*#z+ZCP@3(tX{!vy6lm?Xlo?ysVL}>enOdD_CLC{=z~li?kAZEY_4* znQ+#;AIb46j?h?#x0~%j`6h`9gI3mTv-jS8gLSi!bB;&FSNU9!5o(ml{?e*#Lp9Tm zg0nD!|8%k(Ehk1n%_DB8(YLt@aD9@H!-l+L4{;RZ){uM4D!mn~I?N)WjZKc?&FXS@ zei5jl#SYW=w#8gx^jI*s+UBMePs%||@@eSx7seB6ZWxL#&Z(7?8-eJlNFz=#+dE_4 z0$}(KRkUqQS&eaG66ZS!pP0gwK-)@jsiIZ*C6|K}PfCJSEHe@XT=HczgRN!HInw-9 zI(0IQim50koV;W;pRNHh{x!{`k6cZ%fKeiWjQ5;`E;@VGG>Mmcv69x8hIzK3SQ+ez zrS$T$_#1*~6hz5L;pVK-Z1Sa?5xs$v+k5G|gd)p?5H{*k6kBV&&B&*WVSn!L{~s+|zvBGbx$`H|kLO;V zU;21{HU71i;7{Ws(OK{-!mkylKN0#cen%Rx# vzgk1m{KfiTA^BJHUl+VT0cPlafBIjSzc)abXTkvh$j?8_XU?88{C4+$FA+y? diff --git a/package.json b/package.json index 24a72f85..751de5f6 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,14 @@ "preview": "REACT_APP_VERSION=$npm_package_version aio app run", "grammar": "nearleyc web-src/src/helpers/expressions.ne -o web-src/src/helpers/Parser.generated.js", "prompts": "node scripts/prompt-generator.js", - "examples": "node scripts/zip-examples.js", + "prebuild": "npm run prompts && npm run grammar", "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 && npm run prompts && REACT_APP_VERSION=$npm_package_version aio app deploy", + "deploy:app": "npm run build && REACT_APP_VERSION=$npm_package_version aio app deploy --no-actions --no-build", + "deploy:actions": "npm run build && aio app deploy --no-web-assets --no-build", + "deploy": "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'", + "pretest": "npm run prompts && npm run grammar", "test": "jest --collectCoverageFrom='[\"web-src/src/**/*.js\",\"actions/**/*.js\"]' --coverage --passWithNoTests ./actions ./web-src/src ./e2e" }, "dependencies": { diff --git a/scripts/zip-examples.js b/scripts/zip-examples.js deleted file mode 100644 index 53383650..00000000 --- a/scripts/zip-examples.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 Adobe. All rights reserved. - * This file is licensed to you under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. You may obtain a copy - * of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under - * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS - * OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. - */ - -const fs = require('fs'); -const path = require('path'); -const Excel = require('exceljs'); - -const EXAMPLES_DIR = path.join(__dirname, '../examples'); -const PROMPT_TEMPLATES_EXAMPLE_FILE_NAME = 'prompt-templates'; -const PROMPT_TEMPLATES_EXCEL_FILE = path.join(EXAMPLES_DIR, `${PROMPT_TEMPLATES_EXAMPLE_FILE_NAME}.xlsx`); - -const startProgram = async () => { - console.log('- Zipping Examples Starting...'); - try { - // Create the prompt templates target files if they don't exist - if (!fs.existsSync(PROMPT_TEMPLATES_EXCEL_FILE)) { - console.log(`\t* Creating Excel File @ ${PROMPT_TEMPLATES_EXCEL_FILE}`); - createExcelFile(); - convertExcelToCsv(); - } else { - console.log(`\t* Excel File Exists @ ${PROMPT_TEMPLATES_EXCEL_FILE}`); - } - - // TODO: Create the target audiences file - - // Zip the example directory - await zipExampleDirectory(); - } catch (error) { - console.error("Unexpected error encountered:", error); - } - console.log('- Zipping Examples Complete!'); -}; - -const createExcelFile = () => { - console.log(`\t* Creating Excel File @ ${PROMPT_TEMPLATES_EXCEL_FILE}`); - workbook = new Excel.Workbook(); - const worksheet = workbook.addWorksheet('Prompt Templates'); - worksheet.columns = [ - { header: 'Label', key: 'label' }, - { header: 'Description', key: 'description' }, - { header: 'Template', key: 'template' }, - ]; - - // Format the header row - worksheet.getRow(1).font = { bold: true }; - - // Format all cells to wrap text - worksheet.columns.forEach((column) => { - column.width = 50; - column.alignment = { wrapText: true, vertical: 'top', horizontal: 'left' }; - }); - - console.log('\t* Writing the Excel File') - workbook.xlsx.writeFile(PROMPT_TEMPLATES_EXCEL_FILE); -}; - -const convertExcelToCsv = () => { - console.log('\t* Converting Excel File to CSV') - workbook.csv.writeFile(PROMPT_TEMPLATES_CSV_FILE); -}; - -const zipExampleDirectory = async () => { - return new Promise((resolve, reject) => { - console.log('- Zipping Examples Directory'); - const archiver = require('archiver'); - var output = fs.createWriteStream('examples/Templates.zip'); - var archive = archiver('zip'); - - output.on('close', function () { - console.log(archive.pointer() + ' total bytes'); - console.log('archiver has been finalized and the output file descriptor has closed.'); - resolve('Zipping completed!'); - }); - - archive.on('error', function (err) { - reject(err); - }); - - archive.pipe(output); - - // append files from a sub-directory, putting its contents at the root of archive but excluding .zip files - archive.glob('examples/*', { ignore: ['**/*.zip'] }); - - archive.finalize(); - }); -}; - -// Start the program -startProgram(); diff --git a/web-src/src/components/AudienceSelector.js b/web-src/src/components/AudienceSelector.js index 36b6a319..8ec2fd95 100644 --- a/web-src/src/components/AudienceSelector.js +++ b/web-src/src/components/AudienceSelector.js @@ -156,7 +156,7 @@ export function AudienceSelector({ return ( <> - { (adobeTarget && csv) + { (isTargetEnabled(adobeTarget) && csv) &&