Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

As an expert in prompt engineering, your task is to optimize the following prompt for…

  1. User

    As an expert in prompt engineering, your task is to optimize the following prompt for clarity, effectiveness, and precision. Begin by identifying any ambiguities, redundant language, or areas for improvement. Refactor the prompt using advanced prompt engineering techniques, such as:

    • Role Assignment: Specify an appropriate role or perspective for the model to adopt.
    • Chain-of-Thought (CoT): Encourage the model to think through steps logically if necessary.
    • Self-Consistency: Ensure that the prompt is clear enough to produce reliable results across multiple outputs.
    • Contextual Prompting: Include any background context that may improve understanding.

    After making improvements, briefly explain your choices to demonstrate the optimizations. Here is the prompt to optimize:

    ---prompt-start---

    There is a file upload limit 3MB. I want you to restrict users to upload files more than 3 MB. Create a plan for this ask and apply step by step. ---prompt-end---

  2. Assistant

    Optimized Prompt


    Role Assignment: You are a software developer tasked with creating a file upload system.

    Contextual Prompting: In this project, we have a file upload limit of 3MB for users. This restriction is crucial to manage server storage efficiently and ensure optimal performance.

    Request: Develop a detailed plan outlining the steps necessary to restrict users from uploading files larger than 3MB. Include strategies for both front-end validation and back-end enforcement.

    Chain-of-Thought: Please break down the plan into logical steps, considering both user experience and technical implementation. For instance:

    1. Identify the framework or technology being used for file uploads.
    2. Implement front-end validation checks to alert users before submission.
    3. Set up server-side checks to deny uploads exceeding the limit.
    4. Establish user feedback mechanisms for failed uploads.
    5. Consider edge cases and how to handle them (e.g., corrupted files, browser quirks).

    Explanation of Choices

    1. Role Assignment: By specifying the role of a software developer, the model is guided to approach the problem from a technical standpoint, ensuring the response is relevant and actionable.

    2. Contextual Prompting: Providing context about why the 3MB limit is important helps the model focus on solutions that are not only functional but also aligned with project goals.

    3. Request Structure: The refined prompt explicitly asks for both a plan and step-by-step execution, improving clarity regarding the expected output.

    4. Chain-of-Thought: Encouraging the model to break down the implementation into logical steps fosters thoroughness and comprehensiveness in the response.

    5. Detailed Considerations: Including aspects like user experience and edge cases ensures a robust solution is discussed, which may lead to a more complete and practical response.

    These optimizations enhance clarity, precision, and the reliability of the output, allowing the model to generate pertinent and viable solutions consistently.