codeAI
Docs

prompting effectively

Prompting Effectively

This guide helps you write effective prompts for CodeAI to get the best possible results.

Principles of Effective Prompting

  • Clarity and Specificity: Be clear and specific about what you want the AI to do. Avoid ambiguity.
  • Context: Provide sufficient context for the AI to understand the task.
  • Constraints and Format: Specify any constraints (e.g., length, tone) and the desired output format (e.g., JSON, bullet points).
  • Examples: Include examples of desired input/output pairs if possible.
  • Iterative Refinement: Prompting is an iterative process. Start with a basic prompt and refine it based on the AI's responses.

Prompting Techniques

  • Role-Playing: Assign a persona to the AI (e.g., "Act as a senior software engineer").
  • Chain of Thought: Ask the AI to think step-by-step before providing the final answer.
  • Few-Shot Learning: Provide a few examples of input-output pairs to guide the AI.
  • Negative Constraints: Tell the AI what not to do.
  • Temperature and Top-P: Experiment with model parameters like temperature and top-p to control creativity and randomness.