|
| 1 | +AI Tools |
| 2 | +======== |
| 3 | + |
| 4 | +PyBreeze integrates several AI-powered tools for code review, prompt engineering, |
| 5 | +and LLM interaction. All AI tools are accessible from the **Tools** menu and can |
| 6 | +be opened as either tabs or dock widgets. |
| 7 | + |
| 8 | +AI Code-Review Client |
| 9 | +--------------------- |
| 10 | + |
| 11 | +**Menu:** Tools > AI Code-Review Tab / AI Code-Review Dock |
| 12 | + |
| 13 | +A client for sending code to an AI API endpoint for automated code review. |
| 14 | + |
| 15 | +Interface Layout |
| 16 | +^^^^^^^^^^^^^^^^ |
| 17 | + |
| 18 | +- **URL Input** -- Enter the API endpoint URL |
| 19 | +- **Method Selector** -- Choose HTTP method (GET, POST, PUT, DELETE) |
| 20 | +- **Code Input** (left panel) -- Paste or write code to be reviewed |
| 21 | +- **Response Display** (right panel, read-only) -- Shows the AI review response |
| 22 | +- **Send Request** button -- Sends the code to the API endpoint |
| 23 | + |
| 24 | +Features |
| 25 | +^^^^^^^^ |
| 26 | + |
| 27 | +- Tracks accept/reject statistics for AI responses |
| 28 | +- Saves URL history to ``.pybreeze/urls.txt`` |
| 29 | +- Stores response statistics in ``.pybreeze/response_stats.txt`` |
| 30 | + |
| 31 | +Usage |
| 32 | +^^^^^ |
| 33 | + |
| 34 | +1. Enter your AI API endpoint URL in the URL input field |
| 35 | +2. Select the HTTP method (typically POST) |
| 36 | +3. Paste the code you want reviewed in the left panel |
| 37 | +4. Click **Send Request** |
| 38 | +5. Review the AI's response in the right panel |
| 39 | + |
| 40 | +CoT Code Review GUI |
| 41 | +-------------------- |
| 42 | + |
| 43 | +**Menu:** Tools > AI Code-Review Tab / Dock |
| 44 | + |
| 45 | +An advanced code review tool using Chain-of-Thought (CoT) prompting for |
| 46 | +more structured and detailed reviews. |
| 47 | + |
| 48 | +Interface Layout |
| 49 | +^^^^^^^^^^^^^^^^ |
| 50 | + |
| 51 | +- **API URL Input** -- Enter the API endpoint URL |
| 52 | +- **Code Area** -- Paste code for review |
| 53 | +- **Response Selector** (ComboBox) -- Browse through multiple review responses |
| 54 | +- **Response Viewer** (read-only) -- Displays the selected review response |
| 55 | +- **Send Button** -- Sends code for review |
| 56 | + |
| 57 | +Features |
| 58 | +^^^^^^^^ |
| 59 | + |
| 60 | +- Supports reviewing multiple files at once via ``SenderThread`` |
| 61 | +- Background threading prevents UI freezing during API calls |
| 62 | +- Multiple responses can be stored and browsed |
| 63 | + |
| 64 | +CoT Prompt Editor |
| 65 | +----------------- |
| 66 | + |
| 67 | +**Menu:** Tools > CoT Prompt Editor Tab / CoT Prompt Editor Dock |
| 68 | + |
| 69 | +A template-based editor for creating and managing Chain-of-Thought prompt templates. |
| 70 | + |
| 71 | +Interface Layout |
| 72 | +^^^^^^^^^^^^^^^^ |
| 73 | + |
| 74 | +- **File Selector** (ComboBox) -- Select from available prompt template files |
| 75 | +- **Edit Panel** (QTextEdit) -- Edit the selected prompt template |
| 76 | +- **Create** button -- Creates a new prompt template file |
| 77 | +- **Save** button -- Saves changes to the current template |
| 78 | +- **Reload** button -- Reloads the template from disk |
| 79 | + |
| 80 | +Features |
| 81 | +^^^^^^^^ |
| 82 | + |
| 83 | +- Template-based file management with ``COT_TEMPLATE_RELATION`` mapping |
| 84 | +- File system watcher for detecting external changes |
| 85 | +- Auto-reloads templates when modified outside the editor |
| 86 | +- Pre-configured templates for common CoT review patterns |
| 87 | + |
| 88 | +Usage |
| 89 | +^^^^^ |
| 90 | + |
| 91 | +1. Select a template from the dropdown or create a new one |
| 92 | +2. Edit the prompt template in the text area |
| 93 | +3. Click **Save** to persist your changes |
| 94 | +4. The template can then be used in the CoT Code Review GUI |
| 95 | + |
| 96 | +Skill Prompt Editor |
| 97 | +------------------- |
| 98 | + |
| 99 | +**Menu:** Tools > Skill Prompt Editor Tab / Skill Prompt Editor Dock |
| 100 | + |
| 101 | +Similar to the CoT Prompt Editor, but specialized for skill-based prompt templates |
| 102 | +such as code review and code explanation prompts. |
| 103 | + |
| 104 | +Interface Layout |
| 105 | +^^^^^^^^^^^^^^^^ |
| 106 | + |
| 107 | +- **File Selector** (ComboBox) -- Select from available skill prompt templates |
| 108 | +- **Edit Panel** (QTextEdit) -- Edit the selected skill prompt |
| 109 | +- **Create** button -- Creates a new skill prompt template |
| 110 | +- **Save** button -- Saves changes |
| 111 | +- **Reload** button -- Reloads from disk |
| 112 | + |
| 113 | +Pre-built Skill Templates |
| 114 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 115 | + |
| 116 | +- Code Review prompts |
| 117 | +- Code Explanation prompts |
| 118 | + |
| 119 | +Skills Send GUI |
| 120 | +--------------- |
| 121 | + |
| 122 | +**Menu:** Tools > Skill Send GUI Tab / Skill Prompt Dock |
| 123 | + |
| 124 | +An interface for sending skill-based prompts to an LLM API and viewing responses. |
| 125 | + |
| 126 | +Interface Layout |
| 127 | +^^^^^^^^^^^^^^^^ |
| 128 | + |
| 129 | +- **API URL Input** -- Enter the LLM API endpoint URL |
| 130 | +- **Prompt Template Selector** (ComboBox) -- Choose a pre-defined skill prompt template |
| 131 | +- **Prompt Text Area** -- Edit or customize the prompt before sending |
| 132 | +- **Send Button** -- Sends the prompt to the API (runs in background thread) |
| 133 | +- **Response Display** (read-only) -- Shows the LLM response |
| 134 | + |
| 135 | +Features |
| 136 | +^^^^^^^^ |
| 137 | + |
| 138 | +- Background threading via ``RequestThread`` prevents UI freezing |
| 139 | +- Error handling with specific HTTP status code messages |
| 140 | +- Prompt templates are loaded from the Skill Prompt Editor's template files |
| 141 | + |
| 142 | +Usage |
| 143 | +^^^^^ |
| 144 | + |
| 145 | +1. Enter your LLM API endpoint URL |
| 146 | +2. Select a prompt template from the dropdown |
| 147 | +3. Customize the prompt text if needed (e.g., paste code to review) |
| 148 | +4. Click **Send** |
| 149 | +5. Wait for the response to appear in the response display area |
| 150 | + |
| 151 | +.. note:: |
| 152 | + |
| 153 | + All AI tools require a compatible API endpoint. Configure your API URL |
| 154 | + to point to your LLM service (e.g., OpenAI-compatible API, local LLM server, etc.). |
0 commit comments