Back to Learning

Coding

814 prompts available

AI Chat Versioning Plan

Implement an enhanced messaging system for an AI chat interface that supports retry and edit functionalities with versioned messages stored in MongoDB, a Node.js/Express backend, and a React frontend. Follow a step-by-step plan to break down the large specification into manageable development tasks: # Step 1: Database Schema Update - Use the existing updated Chat.js schema with a `messages` array where each element is a message thread identified by `messageId`. - Each message thread contains a `versions` array tracking multiple versions of the message: - Retrying appends a new version (version number increments). - Editing modifies a specific existing version's content and timestamp. # Step 2: Backend API Modifications - **Retry Endpoint:** - Locate the AI message in `chat.messages` by `messageId`. - Use `processAIRequest` with the relevant user message to generate new AI content. - Append a new version to the existing message's `versions` array with incremented version number. - Update `currentVersion` to the new version. - Save and return the updated version data. - **Edit Endpoint:** - Verify the message to edit is a user message. - Remove that user message and all subsequent AI responses (branch cutting). - Insert the edited user message as a new message thread with version 1. - Generate and add a new AI response message with version 1 using `processAIRequest`. - Save and return the updated chat messages. Include error handling, validation, encryption/decryption compatibility, and maintain backward compatibility if needed. # Step 3: Frontend User Interface Updates - In `MessageArea.jsx`: - For AI messages, provide version navigation buttons (e.g., < and >) to cycle through versions. - Display the current version number and total versions. - For user messages, add an Edit button that toggles an editable text area. - Show Save and Discard buttons in edit mode. - In `AquaChat.jsx`: - Manage state variables for edit mode (`editMode`), the currently editing message (`editingMessageId`), and edited content (`currentMessage`). - Handle retry button interaction to call the retry endpoint and update message versions. - Handle save action to call the edit endpoint and update frontend state accordingly. # Step 4: Testing and Verification - Test retry functionality: - Confirm that retrying appends a new version to AI messages. - Verify version navigation works correctly and content updates accordingly. - Test edit functionality: - Edit user messages, save changes, and confirm branch cutting (removal of subsequent messages). - Ensure new user and AI messages are added correctly. - Confirm encryption/decryption supports the new versioned message structure. - Verify UI updates occur seamlessly without full page reloads. - Test edge cases and error handling thoroughly. # Notes - Preserve all existing security measures like encryption for stored content. - Provide clear error messages in case of API failures. - Focus initial implementation on frontend editing features to break down complexity. # Output Format Provide the implementation plan as a clear, ordered list with headings and bullet points summarizing each step, suitable to guide development efficiently.

AI Crypto.com Trading Bot

Create a detailed and comprehensive AI trading bot designed specifically for the Crypto.com platform. The bot should be capable of analyzing real-time market data, executing trades automatically based on predefined strategies, managing risk effectively, and optimizing for profitability. Key Requirements: - Integrate seamlessly with Crypto.com's API for secure data retrieval and order placement. - Incorporate technical analysis indicators such as moving averages, RSI, MACD, and others relevant to crypto trading. - Allow customizable trading strategies including but not limited to trend following, mean reversion, and momentum trading. - Implement risk management features like stop-loss, take-profit, and position sizing. - Provide real-time monitoring, logging of trades, and performance reporting. - Ensure the bot is robust against common issues such as API rate limits, connectivity problems, and unexpected market volatility. # Steps 1. Authenticate and connect with Crypto.com's API to fetch live market data and account information. 2. Analyze market conditions using selected technical indicators. 3. Generate trade signals based on the configured strategy. 4. Execute trades automatically, adhering to risk management rules. 5. Log every trade with timestamps, execution details, and outcome. 6. Provide a user-friendly summary of performance and alerts for notable events. # Output Format The output should be a well-documented codebase or detailed design document outlining the AI trading bot's architecture, algorithms, integration methods, and usage instructions. # Notes - Security best practices must be followed for API key management. - Adaptability for future strategy enhancements is important. - The system should handle asynchronous data streams effectively. # Examples - [Example code snippet demonstrating API authentication] - [Sample strategy pseudocode implementing RSI-based entry and exit] - [Log file format illustrating trade entries and exits]

AI Chatbot Creation Guide

Design a step-by-step guide for creating an AI chatbot that can be trained on a specific movie script. The chatbot should be capable of understanding dialogue and character interactions within the script to engage in realistic conversations about the movie's plot, characters, and themes. Include instructions for selecting a suitable AI platform, preparing and formatting the movie script, and training the chatbot using relevant tools.

AI Cybersecurity Python Code

Generate a Python script that utilizes AI techniques to enhance cybersecurity measures. The script should demonstrate practical applications such as detecting anomalies, identifying potential threats, or automating security tasks using AI models or algorithms. # Steps - Begin by defining the specific cybersecurity problem you aim to solve with AI (e.g., intrusion detection, malware classification, phishing detection). - Choose appropriate AI techniques or models suitable for the problem (e.g., machine learning classifiers, neural networks, anomaly detection algorithms). - Implement the Python code integrating data preprocessing, model training or inference, and results evaluation. - Include comments and documentation within the code to clarify the purpose and function of each section. # Output Format Provide a complete, runnable Python script with well-structured code and comments. The script should be self-contained or include instructions for required dependencies. # Notes Ensure that the code is clear and maintainable, and uses standard Python libraries where possible. Include sample data or instructions on how to feed data into the system if applicable.

AI Data Migration Java

You are tasked with implementing a data migration process using AI assistance in Java. The goal is to receive data from multiple different source formats, convert them into a single standard schema, retrieve the necessary field mappings based on the destination master data, and then perform the migration of transformed data into the production database. - Analyze the input data formats and design converters to map them into a predefined standard schema. - Access or request the mapping definitions relative to the destination master data to align source fields accordingly. - Develop a Java-based migration system that applies these mappings to transform data and perform secure and efficient database insertions or updates. - Ensure validation, error handling, and logging throughout the migration process to maintain data integrity and traceability. # Steps 1. Parse and identify the source data format. 2. Convert source data into the standard schema. 3. Request or retrieve the destination master data mappings. 4. Use mappings to transform the standardized data fields accordingly. 5. Insert or update the transformed data into the production database using Java. 6. Handle exceptions, validate data, and log migration status. # Output Format Provide detailed Java code snippets or modules that demonstrate: - Data format detection and conversion logic. - Mapping retrieval and application methods. - Database connection and migration execution code. - Error handling and logging mechanisms. Include comments and explanations for clarity and maintainability.

AI Chatbot Creator

Create an AI chatbot capable of understanding and responding to user inputs in a natural, engaging, and context-aware manner. The chatbot should be designed to handle a wide range of conversational topics, provide helpful and accurate information, and adapt its responses based on the conversation flow. It must ensure clarity, politeness, and relevance in all interactions. # Steps 1. Define the chatbot's purpose and scope (e.g., general conversation, customer support, information retrieval). 2. Train or fine-tune the model on appropriate dialogue data relevant to the defined purpose. 3. Implement natural language understanding to parse user inputs correctly. 4. Generate context-aware, coherent, and polite responses. 5. Handle ambiguous or unclear inputs by requesting clarification. 6. Maintain conversation context for multi-turn dialogue. 7. Ensure safe and appropriate responses, avoiding harmful or biased content. # Output Format Provide the chatbot's code or detailed design specification, including any example interactions to demonstrate functionality. Responses from the chatbot should be shown as sample dialogues illustrating expected behavior. # Examples User: "Hello! How can you assist me today?" Chatbot: "Hi there! I'm here to answer your questions and help with any information you need. What can I do for you?" User: "Can you tell me the weather forecast for New York?" Chatbot: "Sure! The weather forecast for New York is sunny with a high of 75°F today.", User: "Thanks!" Chatbot: "You're welcome! If you have any more questions, feel free to ask.", # Notes - Emphasize maintaining conversational context. - Prioritize user-friendly and empathetic communication. - Consider scalability and adaptability for various applications.

AI Chatbot Design Query

Engage in a conversation with the user to gather detailed information necessary for developing an AI agent/chatbot. Use the structured approach provided: Task, Context, Exemplars, Persona, Format, and Tone. Ask questions one by one to obtain the user's preferences and requirements for each part of the structure. # Steps 1. **Task**: Ask about the specific task the AI agent is expected to accomplish. Examples of questions: - What is the primary function of this AI agent? - Are there specific tasks you want the agent to perform? 2. **Context**: Inquire about the context in which the AI agent will operate. Example questions: - What kind of environment or platform will the chatbot be used in? - Is there a particular audience or user base for this AI? 3. **Exemplars**: Discover examples or models that the user might want to emulate. Questions could include: - Are there existing chatbots or AI agents that you admire or want to model this AI after? - Can you provide examples of interactions you consider successful? 4. **Persona**: Understand the desired persona or character traits of the AI. Suggested questions: - What personality traits should the AI exhibit? - How do you want the AI to make users feel? 5. **Format**: Clarify the format for interactions or output. Ask questions such as: - What kind of responses do you envision from the AI – text, voice, other formats? - How structured or expressive should the AI responses be? 6. **Tone**: Determine the tone the AI should use in communications. Potential questions: - Should the tone be formal, casual, friendly, or professional? - Are there any tones you specifically want to avoid? # Output Format For each question, note the user's response, aiming to get a complete picture of their vision for the AI agent. Structure the final consolidated information using the headings: Task, Context, Exemplars, Persona, Format, and Tone.

AI Data Service Setup

Create a complete AI data service application with the following specifications: - **Backend:** Use FastAPI to implement the server-side logic. - **Database:** Utilize DuckDB as the backend database for efficient data management. - **Frontend:** Develop the user interface using Nuxt.js. Requirements: 1. Design and set up the FastAPI backend to connect with DuckDB, providing appropriate APIs for data operations and AI-related services. 2. Implement data models, CRUD operations, and any necessary AI data processing within the backend. 3. Develop the Nuxt.js frontend to interact smoothly with the FastAPI APIs, offering a user-friendly interface for users to query, visualize, or manage AI data. 4. Ensure clear documentation and proper error handling throughout the stack. # Steps 1. Initialize and configure the DuckDB database. 2. Set up FastAPI framework and create RESTful endpoints to interact with DuckDB. 3. Implement AI data processing logic within FastAPI. 4. Create the Nuxt.js frontend, integrating API calls to the FastAPI backend. 5. Style the frontend and ensure responsive design for usability. 6. Test the full stack for functionality and performance. # Output Format Provide the full source code for: - FastAPI backend (Python files, configuration, database schema) - Nuxt.js frontend (Vue components, pages, and configurations) Include clear setup instructions and example usage scenarios. # Notes Focus on a modular, maintainable code structure suitable for real-world AI data services. Use placeholder names and provide explanations where appropriate.

AI Day Trading Agent Creator

Create a comprehensive scraper and learning system designed to develop the world's best AI day trading agent. The agent must: - Scrape and extract detailed information from the complete works of Richard Wyckoff and Marcus Minervini, focusing on their trading philosophies, strategies, and principles. - Study and learn all key candlestick patterns thoroughly, understanding their significance in identifying market trends and buy/sell signals. - Integrate the acquired knowledge to formulate highly accurate buy and sell indications suitable for day trading. The solution should emphasize accurate data extraction, in-depth comprehension of trading concepts, and the ability to generate actionable trading signals based on learned knowledge. # Steps 1. Develop a web scraper to locate and extract content from books and materials authored by Richard Wyckoff and Marcus Minervini. 2. Collect datasets or visual references for all critical candlestick patterns from reliable sources. 3. Implement NLP and pattern recognition models to process and internalize the trading strategies and candlestick patterns. 4. Synthesize this information to create a predictive model that generates precise buy and sell indications aligned with day trading best practices. # Output Format Provide: - Source code or pseudocode for the scraper and learning system. - Summary of key insights extracted from Wyckoff and Minervini's works. - Detailed explanation of all studied candlestick patterns. - Description of the algorithm or model used to produce buy and sell signals. - Example outputs of buy/sell indications on sample market data. # Notes - Ensure the scraper respects copyright laws and site terms. - Prioritize accuracy and robustness in both scraping and learning components. - Emphasize clarity and thoroughness in explanations to demonstrate deep understanding.

Vibe Coding Documentation

You are a senior prompt engineer and technical documentation expert. Your mission is to take a given business idea and generate a fully-detailed technical blueprint for its implementation. The blueprint must cover nine sections: 1. Product Design Requirements (PDR): Describe the overall project vision, define target users and core features, list functional and non-functional requirements, and explain how the product solves a specific problem or meets a need. 2. Tech Stack: Specify the frontend, backend, and any supporting technologies. Include details on frameworks, libraries, and tools (e.g., React, Next.js, Node.js, etc.). Explain why each technology is chosen and how it fits into the overall architecture. 3. App Flowchart: Provide a high-level flowchart illustrating the user journey and system architecture. Include key components, data flows, and interactions (e.g., user input → API processing → data storage). 4. Project Rules: Outline development best practices and coding standards. Define version-control and branching strategies. Detail rules for testing, documentation, and code reviews. Include guidelines for performance optimisation and accessibility. 5. Implementation Plan: Break the project into phases or milestones. Provide step-by-step tasks for initial setup, feature integration, testing, and deployment. Assign estimated timelines and note key dependencies. 6. Frontend Guidelines: Specify design principles (e.g., responsive design, accessibility, and UI/UX best practices). List component-architecture patterns (e.g., modular design, state management, hooks usage). Include styling standards and performance practices. 7. Backend Guidelines: Describe the server architecture and API design. Detail data-storage solutions, databases, and caching strategies. Include security, scalability, and performance measures. 8. Optimised React Code Guidelines: Provide best practices for writing performant React code. Cover common pitfalls such as inline objects/functions causing unnecessary rerenders. Suggest using techniques such as React.memo, useCallback, and useMemo. Include example code snippets showing both problematic patterns and their optimised solutions. 9. Security Checklist (MUST be enforced across the stack): Use a battle-tested auth library, lock down protected endpoints, never expose secrets on the frontend, git-ignore sensitive files, sanitise error messages, use middleware auth checks, add role-based access control (RBAC), use secure DB libraries or platforms, host on a secure platform, enable HTTPS everywhere, limit file-upload risks. Use clear, direct language and break down complex concepts into bullet points or numbered steps. Format the entire response in Markdown with headings, sub-headings, code blocks, and bullet lists for maximum readability. Think like an experienced technical architect: explain not only what to do but why it matters.

Page 68 of 68

    Coding Prompts - Learning AI Prompts | Elevato