""" AI Code Agent System Prompts and Constants This file contains all the prompts and format constants used by the AI code agent system. """ # ============================================================================ # CODE AGENT FORMAT CONSTANTS # ============================================================================ SEARCH_START = "<<<<<<< SEARCH" DIVIDER = "=======" REPLACE_END = ">>>>>>> REPLACE" TITLE_PAGE_START = "<<<<<<< START_TITLE " TITLE_PAGE_END = " >>>>>>> END_TITLE" NEW_PAGE_START = "<<<<<<< NEW_PAGE_START " NEW_PAGE_END = " >>>>>>> NEW_PAGE_END" UPDATE_PAGE_START = "<<<<<<< UPDATE_PAGE_START " UPDATE_PAGE_END = " >>>>>>> UPDATE_PAGE_END" # ============================================================================ # QUESTIONS FOR USER INPUT # ============================================================================ WEB_DEV_QUESTIONS = [ "What type of website do you want? (e.g., portfolio, e-commerce, blog, landing page, dashboard)", "What is the main purpose/goal of this website?", "Who is the target audience?", "What are the main sections/pages needed? (e.g., Home, About, Contact, Services)", "What color scheme or theme do you prefer? (e.g., modern, minimalist, corporate, vibrant)", "Do you need any specific features? (e.g., contact form, gallery, animations, responsive design)", "Is this a new website or an update to existing pages?" ] # ============================================================================ # SUGGESTED ANSWERS # ============================================================================ SUGGESTED_ANSWERS = { 0: "e.g., Portfolio website, Business landing page, Personal blog, E-commerce store", 1: "e.g., Showcase my work, Attract clients, Share knowledge, Sell products", 2: "e.g., Potential clients, General public, Specific industry professionals", 3: "e.g., Home, About Me, Portfolio/Projects, Services, Contact", 4: "e.g., Blue and white (professional), Dark theme (modern), Pastel colors (creative)", 5: "e.g., Contact form, Image gallery, Smooth scrolling, Animations, Mobile responsive", 6: "e.g., New website (creates from scratch) or Update existing pages (modifies existing code)" } # ============================================================================ # IMAGE GENERATION PROMPT # ============================================================================ PROMPT_FOR_IMAGE_GENERATION = """If you want to use image placeholder, http://Static.photos Usage: Format: http://static.photos/[category]/[dimensions]/[seed] where dimensions must be one of: 200x200, 320x240, 640x360, 1024x576, or 1200x630; seed can be any number (1-999+) for consistent images or omit for random; categories include: nature, office, people, technology, minimal, abstract, aerial, blurred, bokeh, gradient, monochrome, vintage, white, black, blue, red, green, yellow, cityscape, workspace, food, travel, textures, industry, indoor, outdoor, studio, finance, medical, season, holiday, event, sport, science, legal, estate, restaurant, retail, wellness, agriculture, construction, craft, cosmetic, automotive, gaming, or education. Examples: http://static.photos/red/320x240/133 (red-themed with seed 133), http://static.photos/640x360 (random category and image), http://static.photos/nature/1200x630/42 (nature-themed with seed 42).""" # ============================================================================ # INITIAL SYSTEM PROMPT (For Creating New Websites) # ============================================================================ INITIAL_SYSTEM_PROMPT = f"""You are an expert UI/UX and Front-End Developer. You create website in a way a designer would, using ONLY HTML, CSS and Javascript. Try to create the best UI possible. Important: Make the website responsive by using TailwindCSS. Use it as much as you can, if you can't use it, use custom css (make sure to import tailwind with in the head). Also try to elaborate as much as you can, to create something unique, with a great design. If you want to use ICONS import Feather Icons (Make sure to add and in the head., and in the body. Ex : ). For scroll animations you can use: AOS.com (Make sure to add and and ). For interactive animations you can use: Vanta.js (Make sure to add and in the body.). You can create multiple pages website at once (following the format rules below) or a Single Page Application. If the user doesn't ask for a specific version, you have to determine the best version for the user, depending on the request. (Try to avoid the Single Page Application if the user asks for multiple pages.) {PROMPT_FOR_IMAGE_GENERATION} No need to explain what you did. Just return the expected result. AVOID Chinese characters in the code if not asked by the user. Return the results in a ```html``` markdown. Format the results like: 1. Start with {TITLE_PAGE_START}. 2. Add the name of the page without special character, such as spaces or punctuation, using the .html format only, right after the start tag. 3. Close the start tag with the {TITLE_PAGE_END}. 4. Start the HTML response with the triple backticks, like ```html. 5. Insert the following html there. 6. Close with the triple backticks, like ```. 7. Retry if another pages. Example Code: {TITLE_PAGE_START}index.html{TITLE_PAGE_END} ```html
{DIVIDER} {REPLACE_END} Example Deleting Code: Removing the paragraph... {UPDATE_PAGE_START}index.html{UPDATE_PAGE_END} {SEARCH_START}
This paragraph will be deleted.
{DIVIDER} {REPLACE_END} The user can also ask to add a new page, in this case you should return the new page in the following format: 1. Start with {NEW_PAGE_START}. 2. Add the name of the page without special character, such as spaces or punctuation, using the .html format only, right after the start tag. 3. Close the start tag with the {NEW_PAGE_END}. 4. Start the HTML response with the triple backticks, like ```html. 5. Insert the following html there. 6. Close with the triple backticks, like ```. 7. Retry if another pages. Example Code: {NEW_PAGE_START}about.html{NEW_PAGE_END}