> ## Documentation Index
> Fetch the complete documentation index at: https://reedai-07fa30f1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit & Regenerate

> Refine your prompts and regenerate AI responses for better results

## Message Editing Overview

ZeroTwo allows you to edit your messages and regenerate AI responses, giving you full control over the conversation flow and helping you get the best possible answers.

<Note>
  Editing a message creates a new conversation branch, preserving the original path while exploring alternatives.
</Note>

## Editing Your Messages

Modify your prompts to clarify questions, fix typos, or try different approaches.

### How to Edit Messages

<Steps>
  <Step title="Hover over your message">
    Move your cursor over any message you've sent to reveal the message actions.
  </Step>

  <Step title="Click the Edit button">
    Click the **✏️ Edit** icon that appears on hover.

    **Keyboard shortcut**: Press `E` while hovering
  </Step>

  <Step title="Modify the message">
    The message text becomes editable in the input field:

    * Make your changes
    * Fix typos or unclear phrasing
    * Add more context or details
    * Completely rewrite if needed
  </Step>

  <Step title="Save and regenerate">
    Click **Save & Regenerate** or press `Enter` to:

    * Save your edited message
    * Generate a new response based on the changes
    * Create a new conversation branch

    <Info>
      The original message and response are preserved in the conversation history - you can always go back.
    </Info>
  </Step>
</Steps>

### When to Edit Messages

<Tabs>
  <Tab title="Clarify Questions">
    **Make your intent clearer**:

    **Original message**:

    ```
    How do I make this faster?
    ```

    **Edited message**:

    ```
    How can I optimize this Python function to run faster? 
    It currently takes 2 seconds to process 10,000 items.
    ```

    <Tip>
      Adding specific details helps AI provide more targeted solutions.
    </Tip>
  </Tab>

  <Tab title="Fix Typos">
    **Correct mistakes**:

    **Original message**:

    ```
    Create a functoin that sorts an aray
    ```

    **Edited message**:

    ```
    Create a function that sorts an array
    ```

    <Info>
      AI usually understands typos, but fixing them improves conversation clarity.
    </Info>
  </Tab>

  <Tab title="Add Context">
    **Provide more information**:

    **Original message**:

    ```
    Debug this code
    ```

    **Edited message**:

    ```
    Debug this React code. The component won't re-render when state 
    changes, and I'm seeing a "Cannot read property" error in the console.
    ```
  </Tab>

  <Tab title="Change Direction">
    **Take a different approach**:

    **Original message**:

    ```
    Write a function to calculate totals
    ```

    **Edited message**:

    ```
    Write a class-based approach with methods to calculate totals, 
    averages, and generate reports
    ```
  </Tab>
</Tabs>

## Regenerating Responses

Get a new AI response without changing your original message.

### Basic Regeneration

<Steps>
  <Step title="Find the regenerate button">
    Hover over any AI response to reveal action buttons.
  </Step>

  <Step title="Click Regenerate">
    Click the **🔄 Regenerate** button.

    **Keyboard shortcut**: Press `R` while hovering over the response

    <Info>
      This generates a new response using the same prompt and context.
    </Info>
  </Step>

  <Step title="View new response">
    AI generates a fresh response:

    * May offer different approaches
    * Could provide additional details
    * Might catch things missed in the first response
  </Step>

  <Step title="Compare responses">
    Use the navigation arrows to switch between response variations:

    * ◀️ Previous response
    * ▶️ Next response
    * Shows "Response 1 of 3" counter
  </Step>
</Steps>

### Why Regenerate?

<AccordionGroup>
  <Accordion title="Incomplete or vague answers">
    **When the response lacks detail**:

    Sometimes AI responses are too brief or miss important aspects. Regenerating can provide:

    * More comprehensive explanations
    * Additional examples
    * Different perspectives
    * Better code solutions

    <Tip>
      Try regenerating 2-3 times to see different approaches, then pick the best one.
    </Tip>
  </Accordion>

  <Accordion title="Technical errors">
    **When code or solutions don't work**:

    * Syntax errors in generated code
    * Logic mistakes
    * Incorrect assumptions
    * Outdated information

    Regenerating often produces a working solution.
  </Accordion>

  <Accordion title="Different approach needed">
    **Explore alternative solutions**:

    * Try different algorithms
    * See various implementation styles
    * Get creative alternatives
    * Compare multiple solutions

    **Example**: Ask for a sorting algorithm and regenerate to see bubble sort, quick sort, and merge sort implementations.
  </Accordion>

  <Accordion title="Model confusion">
    **When AI misunderstands**:

    Sometimes AI interprets your question differently than intended. Regenerating might:

    * Catch the intended meaning
    * Provide a better interpretation
    * Ask clarifying questions

    If regeneration doesn't help, edit your original message for clarity.
  </Accordion>
</AccordionGroup>

### Regenerate with Changes

Modify settings before regenerating for different results.

**Options to change**:

<CardGroup cols={2}>
  <Card title="Switch Models" icon="brain">
    Change the AI model before regenerating:

    * Try a more powerful model
    * Use a faster model
    * Switch to a specialized model

    **Example**: Switch from GPT-4 to Claude 3.5 for different coding style
  </Card>

  <Card title="Adjust Temperature" icon="temperature-half">
    Control response creativity:

    * **Lower** (0.3-0.5): More focused, deterministic
    * **Medium** (0.7): Balanced
    * **Higher** (0.9-1.0): More creative, varied

    Access in model settings
  </Card>

  <Card title="Enable Tools" icon="wrench">
    Add tools before regenerating:

    * Enable web search for current info
    * Activate code interpreter
    * Turn on image generation

    See active tools in chat header
  </Card>

  <Card title="Add Context" icon="file">
    Include additional context:

    * Upload relevant files
    * Reference previous messages
    * Add custom instructions

    Helps AI understand better
  </Card>
</CardGroup>

## Response Variations

Navigate between multiple response variations for the same prompt.

### Managing Variations

**Response counter**: Shows "Response 2 of 4" above each AI message

**Navigation**:

* **◀️ Previous**: View earlier response
* **▶️ Next**: View next response
* Each variation is saved and accessible

<Tip>
  Generate multiple variations, then pick the best one. You can always switch back to any previous variation.
</Tip>

### Comparing Variations

<Steps>
  <Step title="Generate multiple responses">
    Click regenerate several times to create variations
  </Step>

  <Step title="Navigate between them">
    Use arrow buttons to switch between responses
  </Step>

  <Step title="Evaluate each one">
    Compare based on:

    * Accuracy and correctness
    * Completeness of explanation
    * Code quality (if applicable)
    * Clarity and readability
    * Helpfulness for your specific need
  </Step>

  <Step title="Continue from best">
    Continue the conversation from your preferred variation
  </Step>
</Steps>

<Info>
  All variations are preserved until you delete the message or clear the conversation.
</Info>

## Conversation Branches

Editing creates branches in your conversation tree, allowing you to explore different paths.

### Understanding Branches

**How branching works**:

```
Original path:
User: "Create a sorting function"
AI: [Response about bubble sort]

Edit and branch:
User: "Create a sorting function with O(n log n) complexity"
AI: [Response about merge sort]
```

Both paths exist in the conversation history.

### Branch Navigation

**Visual indicators**:

* 🔀 Branch icon shows when multiple paths exist
* Breadcrumb trail shows current branch
* Click branch points to switch paths

<Tabs>
  <Tab title="Branch Forward">
    Create new branches:

    1. Edit any message
    2. New response creates a branch
    3. Continue from that point
    4. Original path preserved
  </Tab>

  <Tab title="Switch Branches">
    Navigate between branches:

    1. Click branch indicator
    2. Select which path to view
    3. Continue from any branch
    4. All branches remain available
  </Tab>

  <Tab title="Merge Insights">
    Combine information:

    * Review multiple branches
    * Copy useful parts from each
    * Ask AI to combine approaches
    * Create new message synthesizing insights
  </Tab>
</Tabs>

<Check>
  Branches let you explore different approaches without losing your work!
</Check>

## Advanced Editing Techniques

### Iterative Refinement

Progressively improve responses through editing:

<Steps>
  <Step title="Start broad">
    ```
    Explain how React hooks work
    ```
  </Step>

  <Step title="Refine with edit">
    ```
    Explain how React hooks work, focusing on useState and useEffect 
    with practical examples
    ```
  </Step>

  <Step title="Further refine">
    ```
    Explain how React hooks work, focusing on useState and useEffect. 
    Show examples of common pitfalls and how to avoid them, especially 
    with dependency arrays in useEffect
    ```
  </Step>

  <Step title="Perfect the response">
    Continue editing and regenerating until you get exactly what you need
  </Step>
</Steps>

### A/B Testing Prompts

Test different phrasings to find what works best:

**Test variations**:

1. Ask the same question different ways
2. Edit to try alternative phrasings
3. Compare the quality of responses
4. Learn which prompt styles work best

**Example A**:

```
Make this code better
```

**Example B**:

```
Refactor this code for better performance, readability, and maintainability. 
Add comments explaining key sections.
```

<Info>
  Example B typically produces better results due to specific, clear instructions.
</Info>

### Chaining Edits

Build on previous edits for complex tasks:

```
Original: "Create a todo app"
Edit 1: "Create a todo app with React"
Edit 2: "Create a todo app with React and TypeScript"
Edit 3: "Create a todo app with React, TypeScript, and local storage persistence"
```

Each edit adds requirements while maintaining context.

## Best Practices

<AccordionGroup>
  <Accordion title="Edit for clarity, not just errors">
    **Beyond fixing typos**:

    * Add specific requirements
    * Include constraints or limitations
    * Mention your skill level
    * Specify desired output format

    **Good edit**:

    ```
    Create a Python function to sort a list of dictionaries by a specific key, 
    handling missing keys gracefully. Include error handling and type hints.
    ```
  </Accordion>

  <Accordion title="Regenerate strategically">
    **When to regenerate**:

    * ✅ Response is close but needs improvement
    * ✅ Want to see alternative approaches
    * ✅ Technical error in the response
    * ✅ Need more detail

    **When to edit instead**:

    * ❌ Your question was unclear
    * ❌ You forgot important context
    * ❌ You need something different
    * ❌ Requirements changed
  </Accordion>

  <Accordion title="Use branches effectively">
    **Branch management tips**:

    * Create branches for major direction changes
    * Keep branches focused on specific approaches
    * Review all branches before finalizing
    * Delete unsuccessful branches to reduce clutter
    * Document why you chose a particular branch

    <Tip>
      Name your mental branches: "Performance approach" vs "Readability approach"
    </Tip>
  </Accordion>

  <Accordion title="Combine edit + regenerate">
    **Powerful workflow**:

    1. Edit message to improve clarity
    2. Regenerate to get fresh response
    3. If not satisfied, regenerate again
    4. Switch models for different perspective
    5. Pick the best variation

    This combination often yields the best results.
  </Accordion>
</AccordionGroup>

## Keyboard Shortcuts

Speed up your workflow with shortcuts:

| Action             | Shortcut           | Description                         |
| ------------------ | ------------------ | ----------------------------------- |
| Edit message       | `E` (hover)        | Edit the message under cursor       |
| Regenerate         | `R` (hover)        | Regenerate response under cursor    |
| Previous variation | `Alt + ←`          | View previous response variation    |
| Next variation     | `Alt + →`          | View next response variation        |
| Cancel edit        | `Esc`              | Cancel editing and restore original |
| Save edit          | `Cmd/Ctrl + Enter` | Save edit and regenerate            |

<Info>
  Enable keyboard shortcuts in Settings > General > Keyboard Shortcuts
</Info>

## Examples

### Example 1: Refining a Code Request

**Original message**:

```
Write a function to validate emails
```

**After seeing a basic response, edit to**:

```
Write a function to validate emails according to RFC 5322 standard. 
Include support for international domains. Return detailed error messages 
for different validation failures. Write in TypeScript with full type safety.
```

Result: Much more comprehensive and production-ready solution.

### Example 2: Getting Multiple Perspectives

**Your message**:

```
Should I use REST or GraphQL for my API?
```

**After first response, regenerate 2-3 times to see**:

* Response 1: Strong REST recommendation with practical reasons
* Response 2: Balanced comparison with use cases for each
* Response 3: GraphQL recommendation with modern app context

Compare all three to make an informed decision.

### Example 3: Debugging Through Iteration

**Start**:

```
This code doesn't work [paste code]
```

**Edit after seeing the fix attempt**:

```
This React code doesn't work. I get "Cannot read property 'map' of undefined" 
on line 15. The data comes from an API call. Here's the full component: [code]
```

**Regenerate if fix doesn't work, or edit again**:

```
The fix didn't work. Here's the API response structure: [paste response]. 
The error still happens on initial render before data loads.
```

Progressive detail leads to the solution.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Can't see edit button">
    **Check these items**:

    * Hover directly over your message
    * Ensure you're hovering over YOUR messages (not AI responses)
    * Check if conversation is locked/archived
    * Refresh the page if buttons don't appear
  </Accordion>

  <Accordion title="Edit not saving">
    **Possible issues**:

    * Network connection problems
    * Message too long (exceeds token limit)
    * Browser blocking save

    **Solutions**:

    * Check internet connection
    * Shorten the edited message
    * Try in a different browser
    * Clear browser cache
  </Accordion>

  <Accordion title="Regeneration produces same response">
    **Why this happens**:

    * Temperature setting too low
    * Highly deterministic query
    * Model cached the response

    **Solutions**:

    * Increase temperature in model settings
    * Edit message slightly before regenerating
    * Switch to a different model
    * Add randomness to the prompt ("Suggest 3 different approaches...")
  </Accordion>

  <Accordion title="Lost in conversation branches">
    **Navigation help**:

    * Look for branch indicator icons
    * Use breadcrumbs to track path
    * Click on earlier messages to see branches
    * Consider starting a new chat if too complex

    <Tip>
      If branches become confusing, copy the best responses into a new chat for a clean start.
    </Tip>
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Custom Instructions" icon="sliders" href="/chat/custom-instructions">
    Set default preferences for all responses
  </Card>

  <Card title="Conversation Branches" icon="code-branch" href="/chat/continue-and-branches">
    Deep dive into branch management
  </Card>

  <Card title="Switch Models" icon="brain" href="/getting-started/switch-models">
    Learn which models work best for different tasks
  </Card>

  <Card title="Canvas" icon="pen-to-square" href="/tools/canvas">
    Iteratively refine content in Canvas
  </Card>
</CardGroup>

<Check>
  Master editing and regeneration to get the perfect response every time!
</Check>
