Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions docs/source/Eng/ai_tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
AI Tools
========

PyBreeze integrates several AI-powered tools for code review, prompt engineering,
and LLM interaction. All AI tools are accessible from the **Tools** menu and can
be opened as either tabs or dock widgets.

AI Code-Review Client
---------------------

**Menu:** Tools > AI Code-Review Tab / AI Code-Review Dock

A client for sending code to an AI API endpoint for automated code review.

Interface Layout
^^^^^^^^^^^^^^^^

- **URL Input** -- Enter the API endpoint URL
- **Method Selector** -- Choose HTTP method (GET, POST, PUT, DELETE)
- **Code Input** (left panel) -- Paste or write code to be reviewed
- **Response Display** (right panel, read-only) -- Shows the AI review response
- **Send Request** button -- Sends the code to the API endpoint

Features
^^^^^^^^

- Tracks accept/reject statistics for AI responses
- Saves URL history to ``.pybreeze/urls.txt``
- Stores response statistics in ``.pybreeze/response_stats.txt``

Usage
^^^^^

1. Enter your AI API endpoint URL in the URL input field
2. Select the HTTP method (typically POST)
3. Paste the code you want reviewed in the left panel
4. Click **Send Request**
5. Review the AI's response in the right panel

CoT Code Review GUI
--------------------

**Menu:** Tools > AI Code-Review Tab / Dock

An advanced code review tool using Chain-of-Thought (CoT) prompting for
more structured and detailed reviews.

Interface Layout
^^^^^^^^^^^^^^^^

- **API URL Input** -- Enter the API endpoint URL
- **Code Area** -- Paste code for review
- **Response Selector** (ComboBox) -- Browse through multiple review responses
- **Response Viewer** (read-only) -- Displays the selected review response
- **Send Button** -- Sends code for review

Features
^^^^^^^^

- Supports reviewing multiple files at once via ``SenderThread``
- Background threading prevents UI freezing during API calls
- Multiple responses can be stored and browsed

CoT Prompt Editor
-----------------

**Menu:** Tools > CoT Prompt Editor Tab / CoT Prompt Editor Dock

A template-based editor for creating and managing Chain-of-Thought prompt templates.

Interface Layout
^^^^^^^^^^^^^^^^

- **File Selector** (ComboBox) -- Select from available prompt template files
- **Edit Panel** (QTextEdit) -- Edit the selected prompt template
- **Create** button -- Creates a new prompt template file
- **Save** button -- Saves changes to the current template
- **Reload** button -- Reloads the template from disk

Features
^^^^^^^^

- Template-based file management with ``COT_TEMPLATE_RELATION`` mapping
- File system watcher for detecting external changes
- Auto-reloads templates when modified outside the editor
- Pre-configured templates for common CoT review patterns

Usage
^^^^^

1. Select a template from the dropdown or create a new one
2. Edit the prompt template in the text area
3. Click **Save** to persist your changes
4. The template can then be used in the CoT Code Review GUI

Skill Prompt Editor
-------------------

**Menu:** Tools > Skill Prompt Editor Tab / Skill Prompt Editor Dock

Similar to the CoT Prompt Editor, but specialized for skill-based prompt templates
such as code review and code explanation prompts.

Interface Layout
^^^^^^^^^^^^^^^^

- **File Selector** (ComboBox) -- Select from available skill prompt templates
- **Edit Panel** (QTextEdit) -- Edit the selected skill prompt
- **Create** button -- Creates a new skill prompt template
- **Save** button -- Saves changes
- **Reload** button -- Reloads from disk

Pre-built Skill Templates
^^^^^^^^^^^^^^^^^^^^^^^^^^

- Code Review prompts
- Code Explanation prompts

Skills Send GUI
---------------

**Menu:** Tools > Skill Send GUI Tab / Skill Prompt Dock

An interface for sending skill-based prompts to an LLM API and viewing responses.

Interface Layout
^^^^^^^^^^^^^^^^

- **API URL Input** -- Enter the LLM API endpoint URL
- **Prompt Template Selector** (ComboBox) -- Choose a pre-defined skill prompt template
- **Prompt Text Area** -- Edit or customize the prompt before sending
- **Send Button** -- Sends the prompt to the API (runs in background thread)
- **Response Display** (read-only) -- Shows the LLM response

Features
^^^^^^^^

- Background threading via ``RequestThread`` prevents UI freezing
- Error handling with specific HTTP status code messages
- Prompt templates are loaded from the Skill Prompt Editor's template files

Usage
^^^^^

1. Enter your LLM API endpoint URL
2. Select a prompt template from the dropdown
3. Customize the prompt text if needed (e.g., paste code to review)
4. Click **Send**
5. Wait for the response to appear in the response display area

.. note::

All AI tools require a compatible API endpoint. Configure your API URL
to point to your LLM service (e.g., OpenAI-compatible API, local LLM server, etc.).
20 changes: 15 additions & 5 deletions docs/source/Eng/eng_index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
UI
----
PyBreeze UI Guide
==================

.. toctree::
:maxdepth: 4
:maxdepth: 4

ui.rst
how_to_extend_ui.rst
getting_started.rst
ui_overview.rst
menu_file_run_text.rst
menu_automation.rst
menu_install.rst
menu_tools.rst
menu_plugins.rst
ssh_client.rst
ai_tools.rst
jupyter_lab.rst
how_to_extend_ui.rst
77 changes: 77 additions & 0 deletions docs/source/Eng/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Getting Started
===============

Requirements
------------

- Python 3.10 or higher
- pip (Python package manager)

Installation
------------

Install PyBreeze from PyPI:

.. code-block:: bash

pip install pybreeze

Launching PyBreeze
------------------

**Method 1: Command Line**

.. code-block:: bash

python -m pybreeze

**Method 2: Python Script**

.. code-block:: python

from pybreeze import start_editor

start_editor()

**Method 3: With Options**

.. code-block:: python

from pybreeze import start_editor

# Available themes: dark_amber.xml (default), dark_teal.xml,
# dark_blue.xml, light_blue.xml, etc.
start_editor(theme="dark_teal.xml")

Parameters
^^^^^^^^^^

.. list-table::
:header-rows: 1
:widths: 20 15 20 45

* - Parameter
- Type
- Default
- Description
* - ``debug_mode``
- bool
- ``False``
- Auto-close after 10 seconds (for CI testing)
* - ``theme``
- str
- ``"dark_amber.xml"``
- Qt Material theme name

First Launch
------------

When PyBreeze starts, the main window opens maximized with:

1. **Menu Bar** at the top with all available menus
2. **File Tree** on the left side for project navigation
3. **Code Editor** (tabbed) in the center for editing files
4. **Output Panel** at the bottom for execution results

PyBreeze inherits its core editor functionality from **JEditor** and extends it
with automation-specific menus, tools, and integrations.
91 changes: 67 additions & 24 deletions docs/source/Eng/how_to_extend_ui.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,78 @@
How to extend Automation Editor UI
----
How to Extend the UI
====================

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

.. code-block::
Basic Example
-------------

from PySide6.QtWidgets import QWidget, QGridLayout, QLineEdit, QPushButton, QLabel
.. code-block:: python

from automation_editor import start_editor, EDITOR_EXTEND_TAB
from PySide6.QtWidgets import QWidget, QGridLayout, QLineEdit, QPushButton, QLabel
from pybreeze import start_editor, EDITOR_EXTEND_TAB


# You can use you own QWidget
class TestUI(QWidget):
class TestUI(QWidget):
"""A simple custom tab widget."""

def __init__(self):
super().__init__()
self.grid_layout = QGridLayout(self)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.label = QLabel("")
self.line_edit = QLineEdit()
self.submit_button = QPushButton("Submit")
self.submit_button.clicked.connect(self.show_input_text)
self.grid_layout.addWidget(self.label, 0, 0)
self.grid_layout.addWidget(self.line_edit, 1, 0)
self.grid_layout.addWidget(self.submit_button, 2, 0)
def __init__(self):
super().__init__()
self.grid_layout = QGridLayout(self)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.label = QLabel("")
self.line_edit = QLineEdit()
self.submit_button = QPushButton("Submit")
self.submit_button.clicked.connect(self.show_input_text)
self.grid_layout.addWidget(self.label, 0, 0)
self.grid_layout.addWidget(self.line_edit, 1, 0)
self.grid_layout.addWidget(self.submit_button, 2, 0)

def show_input_text(self):
self.label.setText(self.line_edit.text())
def show_input_text(self):
self.label.setText(self.line_edit.text())


EDITOR_EXTEND_TAB.update({"test": TestUI})
# Register the custom tab
EDITOR_EXTEND_TAB.update({"My Custom Tab": TestUI})

start_editor(debug_mode=True)
# Start the editor with the custom tab
start_editor()

How It Works
------------

1. Import ``EDITOR_EXTEND_TAB`` from ``pybreeze``.
2. Create a class that extends ``QWidget`` (or any QWidget subclass).
3. Add your widget class to the ``EDITOR_EXTEND_TAB`` dictionary with a display name as the key.
4. Call ``start_editor()`` -- your tab will appear alongside the default tabs.

.. note::

You must register your custom tabs in ``EDITOR_EXTEND_TAB`` **before** calling
``start_editor()``, as the tabs are loaded during window initialization.

Advanced: Plugin-Based Tabs
----------------------------

You can also add custom tabs via the plugin system by placing a plugin file
in the ``jeditor_plugins/`` directory:

.. code-block:: python

# jeditor_plugins/my_custom_tab.py
from PySide6.QtWidgets import QWidget, QVBoxLayout, QTextEdit
from pybreeze import EDITOR_EXTEND_TAB


class MyToolWidget(QWidget):
def __init__(self):
super().__init__()
layout = QVBoxLayout(self)
self.text_edit = QTextEdit()
self.text_edit.setPlaceholderText("My custom tool...")
layout.addWidget(self.text_edit)


EDITOR_EXTEND_TAB.update({"My Tool": MyToolWidget})

This plugin will be auto-discovered and loaded when PyBreeze starts.
Loading
Loading