Skip to content

Commit b258cbc

Browse files
authored
Merge pull request #216 from Integration-Automation/dev
Dev
2 parents 5f2ab1a + fc504b1 commit b258cbc

43 files changed

Lines changed: 3227 additions & 225 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<a href="https://github.com/JE-Chen/je_editor/blob/main/LICENSE">
2222
<img src="https://img.shields.io/github/license/JE-Chen/je_editor" alt="License"/>
2323
</a>
24+
<a href="https://je-editor.readthedocs.io/en/latest/">
25+
<img src="https://img.shields.io/readthedocs/je-editor" alt="Read the Docs"/>
26+
</a>
2427
</p>
2528

2629
<p align="center">

README/README_zh-CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<a href="https://github.com/JE-Chen/je_editor/blob/main/LICENSE">
2222
<img src="https://img.shields.io/github/license/JE-Chen/je_editor" alt="License"/>
2323
</a>
24+
<a href="https://je-editor.readthedocs.io/en/latest/">
25+
<img src="https://img.shields.io/readthedocs/je-editor" alt="Read the Docs"/>
26+
</a>
2427
</p>
2528

2629
<p align="center">

README/README_zh-TW.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<a href="https://github.com/JE-Chen/je_editor/blob/main/LICENSE">
2222
<img src="https://img.shields.io/github/license/JE-Chen/je_editor" alt="License"/>
2323
</a>
24+
<a href="https://je-editor.readthedocs.io/en/latest/">
25+
<img src="https://img.shields.io/readthedocs/je-editor" alt="Read the Docs"/>
26+
</a>
2427
</p>
2528

2629
<p align="center">

docs/source/conf.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# Configuration file for the Sphinx documentation builder.
22
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
3+
# For the full list of built-in configuration values, see the documentation:
54
# https://www.sphinx-doc.org/en/master/usage/configuration.html
65

7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
136
import os
147
import sys
158
from pathlib import Path
@@ -20,37 +13,24 @@
2013

2114
# -- Project information -----------------------------------------------------
2215

23-
2416
project = "JEditor"
25-
copyright = "2020 ~ Now, JE-Chen"
17+
copyright = "2021 ~ Present, JE-Chen"
2618
author = "JE-Chen"
27-
28-
# The full version, including alpha/beta/rc tags
29-
release = "0.0.0.1"
19+
release = "1.0.10"
3020

3121
# -- General configuration ---------------------------------------------------
3222

33-
# Add any Sphinx extension module names here, as strings. They can be
34-
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
35-
# ones.
3623
extensions = []
3724

38-
# Add any paths that contain templates here, relative to this directory.
3925
templates_path = ["_templates"]
40-
41-
# List of patterns, relative to source directory, that match files and
42-
# directories to ignore when looking for source files.
43-
# This pattern also affects html_static_path and html_extra_path.
4426
exclude_patterns = []
4527

4628
# -- Options for HTML output -------------------------------------------------
4729

48-
# The theme to use for HTML and HTML Help pages. See the documentation for
49-
# a list of builtin themes.
50-
#
5130
html_theme = "sphinx_rtd_theme"
52-
53-
# Add any paths that contain custom static files (such as style sheets) here,
54-
# relative to this directory. They are copied after the builtin static files,
55-
# so a file named "default.css" will overwrite the builtin "default.css".
5631
html_static_path = ["_static"]
32+
33+
# -- Internationalization ----------------------------------------------------
34+
35+
locale_dirs = ["locale/"]
36+
gettext_compact = False
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
AI Assistant
2+
=============
3+
4+
JEditor integrates an AI-powered chat assistant using `LangChain <https://www.langchain.com/>`_
5+
and OpenAI-compatible APIs. The AI panel allows you to have conversations with a large language
6+
model directly within the editor.
7+
8+
Setup
9+
------
10+
11+
Before using the AI assistant, you need to configure it:
12+
13+
1. Open the AI configuration dialog from the menu
14+
2. Set the following parameters:
15+
16+
.. list-table::
17+
:header-rows: 1
18+
:widths: 25 75
19+
20+
* - Setting
21+
- Description
22+
* - **API Base URL**
23+
- The API endpoint (e.g., ``https://api.openai.com/v1``)
24+
* - **API Key**
25+
- Your OpenAI API key
26+
* - **Model**
27+
- The model to use (e.g., ``gpt-3.5-turbo``, ``gpt-4``, or any custom model)
28+
* - **System Prompt**
29+
- A template that sets the AI's behavior and context
30+
31+
Configuration is saved to ``.jeditor/ai_config.json`` and persists between sessions.
32+
33+
You can also configure the API key via environment variables.
34+
35+
Chat Interface
36+
---------------
37+
38+
The AI chat panel provides:
39+
40+
- **Message history** — Scrollable chat history with all previous messages
41+
- **Input field** — Type your prompt at the bottom of the panel
42+
- **Font size adjustment** — Customize the chat panel's font size
43+
- **Read-only message area** — Chat history is displayed in a read-only area
44+
45+
Async Communication
46+
--------------------
47+
48+
AI requests are handled asynchronously to keep the editor responsive:
49+
50+
- Messages are sent to the AI in a background thread
51+
- Responses are pulled back using a configurable timer interval
52+
- A message queue ensures orderly communication
53+
- The UI remains fully interactive while waiting for responses
54+
55+
Error Handling
56+
---------------
57+
58+
If the AI request fails (e.g., network error, invalid API key), JEditor shows a clear error
59+
dialog describing the problem. The chat session continues to work after resolving the issue.

0 commit comments

Comments
 (0)