Skip to content

Commit f9863e7

Browse files
authored
Merge pull request #117 from Integration-Automation/dev
Add docs
2 parents f4323fd + 1605940 commit f9863e7

28 files changed

+2383
-303
lines changed

docs/source/Eng/ai_tools.rst

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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.).

docs/source/Eng/eng_index.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
UI
2-
----
1+
PyBreeze UI Guide
2+
==================
3+
34
.. toctree::
4-
:maxdepth: 4
5+
:maxdepth: 4
56

6-
ui.rst
7-
how_to_extend_ui.rst
7+
getting_started.rst
8+
ui_overview.rst
9+
menu_file_run_text.rst
10+
menu_automation.rst
11+
menu_install.rst
12+
menu_tools.rst
13+
menu_plugins.rst
14+
ssh_client.rst
15+
ai_tools.rst
16+
jupyter_lab.rst
17+
how_to_extend_ui.rst
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Getting Started
2+
===============
3+
4+
Requirements
5+
------------
6+
7+
- Python 3.10 or higher
8+
- pip (Python package manager)
9+
10+
Installation
11+
------------
12+
13+
Install PyBreeze from PyPI:
14+
15+
.. code-block:: bash
16+
17+
pip install pybreeze
18+
19+
Launching PyBreeze
20+
------------------
21+
22+
**Method 1: Command Line**
23+
24+
.. code-block:: bash
25+
26+
python -m pybreeze
27+
28+
**Method 2: Python Script**
29+
30+
.. code-block:: python
31+
32+
from pybreeze import start_editor
33+
34+
start_editor()
35+
36+
**Method 3: With Options**
37+
38+
.. code-block:: python
39+
40+
from pybreeze import start_editor
41+
42+
# Available themes: dark_amber.xml (default), dark_teal.xml,
43+
# dark_blue.xml, light_blue.xml, etc.
44+
start_editor(theme="dark_teal.xml")
45+
46+
Parameters
47+
^^^^^^^^^^
48+
49+
.. list-table::
50+
:header-rows: 1
51+
:widths: 20 15 20 45
52+
53+
* - Parameter
54+
- Type
55+
- Default
56+
- Description
57+
* - ``debug_mode``
58+
- bool
59+
- ``False``
60+
- Auto-close after 10 seconds (for CI testing)
61+
* - ``theme``
62+
- str
63+
- ``"dark_amber.xml"``
64+
- Qt Material theme name
65+
66+
First Launch
67+
------------
68+
69+
When PyBreeze starts, the main window opens maximized with:
70+
71+
1. **Menu Bar** at the top with all available menus
72+
2. **File Tree** on the left side for project navigation
73+
3. **Code Editor** (tabbed) in the center for editing files
74+
4. **Output Panel** at the bottom for execution results
75+
76+
PyBreeze inherits its core editor functionality from **JEditor** and extends it
77+
with automation-specific menus, tools, and integrations.
Lines changed: 67 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,78 @@
1-
How to extend Automation Editor UI
2-
----
1+
How to Extend the UI
2+
====================
33

4-
.. image:: images/ui.png
4+
PyBreeze supports extending the UI with custom tabs using the ``EDITOR_EXTEND_TAB``
5+
dictionary. You can add any PySide6 ``QWidget`` as a new tab in the editor.
56

6-
.. code-block::
7+
Basic Example
8+
-------------
79

8-
from PySide6.QtWidgets import QWidget, QGridLayout, QLineEdit, QPushButton, QLabel
10+
.. code-block:: python
911
10-
from automation_editor import start_editor, EDITOR_EXTEND_TAB
12+
from PySide6.QtWidgets import QWidget, QGridLayout, QLineEdit, QPushButton, QLabel
13+
from pybreeze import start_editor, EDITOR_EXTEND_TAB
1114
1215
13-
# You can use you own QWidget
14-
class TestUI(QWidget):
16+
class TestUI(QWidget):
17+
"""A simple custom tab widget."""
1518
16-
def __init__(self):
17-
super().__init__()
18-
self.grid_layout = QGridLayout(self)
19-
self.grid_layout.setContentsMargins(0, 0, 0, 0)
20-
self.grid_layout.setContentsMargins(0, 0, 0, 0)
21-
self.label = QLabel("")
22-
self.line_edit = QLineEdit()
23-
self.submit_button = QPushButton("Submit")
24-
self.submit_button.clicked.connect(self.show_input_text)
25-
self.grid_layout.addWidget(self.label, 0, 0)
26-
self.grid_layout.addWidget(self.line_edit, 1, 0)
27-
self.grid_layout.addWidget(self.submit_button, 2, 0)
19+
def __init__(self):
20+
super().__init__()
21+
self.grid_layout = QGridLayout(self)
22+
self.grid_layout.setContentsMargins(0, 0, 0, 0)
23+
self.label = QLabel("")
24+
self.line_edit = QLineEdit()
25+
self.submit_button = QPushButton("Submit")
26+
self.submit_button.clicked.connect(self.show_input_text)
27+
self.grid_layout.addWidget(self.label, 0, 0)
28+
self.grid_layout.addWidget(self.line_edit, 1, 0)
29+
self.grid_layout.addWidget(self.submit_button, 2, 0)
2830
29-
def show_input_text(self):
30-
self.label.setText(self.line_edit.text())
31+
def show_input_text(self):
32+
self.label.setText(self.line_edit.text())
3133
3234
33-
EDITOR_EXTEND_TAB.update({"test": TestUI})
35+
# Register the custom tab
36+
EDITOR_EXTEND_TAB.update({"My Custom Tab": TestUI})
3437
35-
start_editor(debug_mode=True)
38+
# Start the editor with the custom tab
39+
start_editor()
40+
41+
How It Works
42+
------------
43+
44+
1. Import ``EDITOR_EXTEND_TAB`` from ``pybreeze``.
45+
2. Create a class that extends ``QWidget`` (or any QWidget subclass).
46+
3. Add your widget class to the ``EDITOR_EXTEND_TAB`` dictionary with a display name as the key.
47+
4. Call ``start_editor()`` -- your tab will appear alongside the default tabs.
48+
49+
.. note::
50+
51+
You must register your custom tabs in ``EDITOR_EXTEND_TAB`` **before** calling
52+
``start_editor()``, as the tabs are loaded during window initialization.
53+
54+
Advanced: Plugin-Based Tabs
55+
----------------------------
56+
57+
You can also add custom tabs via the plugin system by placing a plugin file
58+
in the ``jeditor_plugins/`` directory:
59+
60+
.. code-block:: python
61+
62+
# jeditor_plugins/my_custom_tab.py
63+
from PySide6.QtWidgets import QWidget, QVBoxLayout, QTextEdit
64+
from pybreeze import EDITOR_EXTEND_TAB
65+
66+
67+
class MyToolWidget(QWidget):
68+
def __init__(self):
69+
super().__init__()
70+
layout = QVBoxLayout(self)
71+
self.text_edit = QTextEdit()
72+
self.text_edit.setPlaceholderText("My custom tool...")
73+
layout.addWidget(self.text_edit)
74+
75+
76+
EDITOR_EXTEND_TAB.update({"My Tool": MyToolWidget})
77+
78+
This plugin will be auto-discovered and loaded when PyBreeze starts.

0 commit comments

Comments
 (0)