Certainly! Below is a series of prompts you can use in websim.ai to build your website with KARA, an AI assistant that thinks and responds like me. Simply copy and paste each prompt into websim.ai sequentially, and it will generate the corresponding HTML, CSS, and JavaScript code for your website.
Prompt 1: Create the Basic HTML Structure
Create a simple HTML page titled "KARA - Your AI Assistant". Include the following elements:
- A header at the top with the text "KARA - Your AI Assistant".
- A main chat interface that includes:
- A scrollable conversation area where messages between the user and KARA will be displayed.
- An input area at the bottom with a text input field for the user to type their message and a "Send" button to submit it.
Ensure the page is responsive and uses semantic HTML5 elements.
Prompt 2: Style the Chat Interface with CSS
Apply CSS styles to make the chat interface user-friendly and visually appealing:
- Use a clean, modern design with a neutral color scheme.
- Style the header with a background color and center the text.
- Design the conversation area to resemble a chat app, with messages appearing in speech bubbles.
- Differentiate between user messages and KARA's responses with different background colors and alignment (e.g., user messages on the right, KARA's on the left).
- Style the input area with a clear input field and a prominent "Send" button.
Ensure the styles are responsive for both desktop and mobile devices.
Prompt 3: Implement JavaScript to Handle User Input
Add JavaScript functionality to capture and handle user input:
- When the user clicks the "Send" button or presses "Enter", capture the text from the input field.
- Prevent empty messages from being sent.
- Display the user's message in the conversation area in the appropriate style.
- Clear the input field after sending the message.
Prompt 4: Simulate KARA's Thinking Process
Enhance the JavaScript code to simulate KARA's thinking:
- After the user sends a message, display a "KARA is typing..." indicator in the conversation area.
- Implement a random delay between 1 to 3 seconds to simulate human-like thinking time before KARA responds.
- Remove the "typing..." indicator once KARA's response is displayed.
Prompt 5: Integrate Websim.ai's AI API for Responses
Modify the JavaScript code to generate KARA's responses using Websim.ai's AI API:
- Send the user's message to the API endpoint provided by Websim.ai.
- Ensure the API call is asynchronous to prevent blocking the UI.
- Receive the AI-generated response from the API.
- Display KARA's response in the conversation area using the appropriate style.
- Handle any errors in the API call gracefully, displaying an error message if needed.
Prompt 6: Configure KARA to Think Like an AI Assistant
Adjust the parameters of the AI API to make KARA think and respond like OpenAI's ChatGPT assistant:
- Ensure KARA provides informative, context-aware, and coherent responses.
- Maintain a conversational tone that is friendly and professional.
- If possible, enable the AI to remember previous messages for context in the conversation.
Prompt 7: Enhance User Experience
Improve the chat interface and user experience:
- Allow users to press "Enter" to send messages in addition to clicking the "Send" button.
- Automatically scroll the conversation area to the latest message when new messages are added.
- Add placeholder text to the input field, such as "Type your message here...".
- Include a favicon and improve the page title for a polished look.
Prompt 8: Add Initial Greeting from KARA
Upon loading the chat interface, have KARA display a welcome message:
- Example: "Hello! I'm KARA, your AI assistant. How can I assist you today?"
- Ensure this message appears in the conversation area automatically when the page loads.
Prompt 9: Ensure Code Quality and Best Practices
Review and optimize the HTML, CSS, and JavaScript code:
- Ensure the code is clean, well-commented, and follows best practices.
- Validate the HTML and CSS to fix any potential issues.
- Optimize JavaScript functions for efficiency and readability.
- Make sure all elements have descriptive IDs and classes for maintainability.
Prompt 10: Test and Debug the Application
Thoroughly test the chat application to ensure it works as intended:
- Test sending various messages to KARA and verify appropriate responses.
- Check the error handling by simulating API failures.
- Ensure the chat interface is responsive on different devices and screen sizes.
- Fix any bugs or issues that arise during testing.
Feel free to adjust any of the prompts to better suit your specific needs. By following these prompts, you'll build a website with KARA, an AI assistant that thinks and responds in a human-like manner, similar to how I would.
Let me know if you need further assistance or any modifications!