Write a self-contained HTML file that creates expanded, refined, intuitive prompts that…
- User
Write a self-contained HTML file that creates expanded, refined, intuitive prompts that perpetually improve upon the prompt you're giving it.
Assistant
Certainly! Below is a self-contained HTML file that creates an interface for generating expanded, refined, and intuitive prompts. This interface uses JavaScript to continually improve upon the initial prompt provided by the user.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Prompt Refiner</title> <style> body { font-family: Arial, sans-serif; margin: 20px; } textarea { width: 100%; height: 100px; margin-bottom: 10px; } button { padding: 10px 20px; background-color: #4CAF50; color: white; border: none; cursor: pointer; } button:hover { background-color: #45a049; } .refined-prompt { margin-top: 20px; border: 1px solid #ddd; padding: 10px; background-color: #f9f9f9; } </style> </head> <body> <h1>Prompt Refiner</h1> <textarea id="initialPrompt" placeholder="Enter your initial prompt here..."></textarea> <button onclick="refinePrompt()">Refine Prompt</button> <div id="refinedPrompt" class="refined-prompt"></div> <script> function refinePrompt() { const initialPrompt = document.getElementById('initialPrompt').value; let refinedPrompt = expandAndRefine(initialPrompt); document.getElementById('refinedPrompt').innerText = refinedPrompt; } function expandAndRefine(prompt) { // Simple example of refinement logic const expansions = [ "Create a detailed description of ", "Provide an in-depth analysis of ", "Generate a comprehensive report on ", "Write an elaborate essay about ", "Compose a thorough examination of " ]; const randomExpansion = expansions[Math.floor(Math.random() * expansions.length)]; return randomExpansion + prompt; } </script> </body> </html>Explanation:
-
HTML Structure:
- A
textareafor the user to input their initial prompt. - A
buttonto trigger the refinement process. - A
divto display the refined prompt.
- A
-
CSS:
- Basic styling for the textarea, button, and refined prompt display.
-
JavaScript:
refinePromptfunction: Reads the initial prompt from the textarea, refines it using theexpandAndRefinefunction, and displays the refined prompt.expandAndRefinefunction: Contains a simple logic to expand and refine the prompt by prepending a random expansion phrase.
This HTML file can be saved and opened in a web browser to interact with the prompt refinement tool.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.