pygpt-net 2.4.36.post1__py3-none-any.whl → 2.4.41__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +38 -1
- README.md +71 -114
- pygpt_net/CHANGELOG.txt +38 -1
- pygpt_net/__init__.py +3 -3
- pygpt_net/controller/__init__.py +7 -3
- pygpt_net/controller/access/control.py +1 -1
- pygpt_net/controller/access/voice.py +11 -5
- pygpt_net/controller/agent/experts.py +11 -6
- pygpt_net/controller/agent/legacy.py +8 -6
- pygpt_net/controller/agent/llama.py +4 -2
- pygpt_net/controller/assistant/__init__.py +9 -4
- pygpt_net/controller/assistant/batch.py +38 -21
- pygpt_net/controller/assistant/editor.py +7 -6
- pygpt_net/controller/assistant/files.py +23 -7
- pygpt_net/controller/assistant/store.py +20 -7
- pygpt_net/controller/assistant/threads.py +34 -8
- pygpt_net/controller/attachment.py +29 -10
- pygpt_net/controller/audio/__init__.py +25 -4
- pygpt_net/controller/calendar/__init__.py +23 -4
- pygpt_net/controller/calendar/note.py +57 -11
- pygpt_net/controller/camera.py +3 -2
- pygpt_net/controller/chat/__init__.py +5 -3
- pygpt_net/controller/chat/attachment.py +39 -44
- pygpt_net/controller/chat/command.py +4 -2
- pygpt_net/controller/chat/common.py +11 -4
- pygpt_net/controller/chat/files.py +10 -3
- pygpt_net/controller/chat/image.py +17 -5
- pygpt_net/controller/chat/input.py +10 -7
- pygpt_net/controller/chat/output.py +21 -6
- pygpt_net/controller/chat/render.py +100 -21
- pygpt_net/controller/chat/response.py +34 -7
- pygpt_net/controller/chat/stream.py +4 -2
- pygpt_net/controller/chat/text.py +6 -4
- pygpt_net/controller/command.py +11 -3
- pygpt_net/controller/config/__init__.py +34 -6
- pygpt_net/controller/config/field/checkbox.py +7 -4
- pygpt_net/controller/config/field/cmd.py +7 -5
- pygpt_net/controller/config/field/combo.py +14 -6
- pygpt_net/controller/config/field/dictionary.py +14 -11
- pygpt_net/controller/config/field/input.py +9 -6
- pygpt_net/controller/config/field/slider.py +11 -8
- pygpt_net/controller/config/field/textarea.py +8 -5
- pygpt_net/controller/config/placeholder.py +52 -21
- pygpt_net/controller/ctx/__init__.py +138 -49
- pygpt_net/controller/ctx/common.py +15 -4
- pygpt_net/controller/ctx/extra.py +11 -3
- pygpt_net/controller/ctx/summarizer.py +24 -5
- pygpt_net/controller/debug/__init__.py +27 -6
- pygpt_net/controller/dialogs/confirm.py +34 -7
- pygpt_net/controller/dialogs/debug.py +4 -2
- pygpt_net/controller/dialogs/info.py +7 -2
- pygpt_net/controller/files.py +48 -10
- pygpt_net/controller/finder.py +11 -5
- pygpt_net/controller/idx/__init__.py +10 -3
- pygpt_net/controller/idx/common.py +4 -2
- pygpt_net/controller/idx/indexer.py +25 -17
- pygpt_net/controller/idx/settings.py +9 -3
- pygpt_net/controller/kernel/__init__.py +34 -8
- pygpt_net/controller/kernel/reply.py +12 -3
- pygpt_net/controller/kernel/stack.py +5 -3
- pygpt_net/controller/lang/custom.py +2 -7
- pygpt_net/controller/lang/mapping.py +5 -3
- pygpt_net/controller/layout.py +2 -2
- pygpt_net/controller/mode.py +16 -4
- pygpt_net/controller/model/__init__.py +14 -3
- pygpt_net/controller/model/editor.py +8 -3
- pygpt_net/controller/notepad.py +26 -12
- pygpt_net/controller/painter/capture.py +23 -4
- pygpt_net/controller/painter/common.py +9 -7
- pygpt_net/controller/plugins/__init__.py +19 -5
- pygpt_net/controller/plugins/presets.py +15 -6
- pygpt_net/controller/plugins/settings.py +9 -3
- pygpt_net/controller/presets/__init__.py +55 -16
- pygpt_net/controller/presets/editor.py +26 -10
- pygpt_net/controller/settings/__init__.py +3 -2
- pygpt_net/controller/settings/editor.py +29 -7
- pygpt_net/controller/settings/profile.py +22 -5
- pygpt_net/controller/theme/__init__.py +54 -12
- pygpt_net/controller/theme/common.py +24 -2
- pygpt_net/controller/theme/markdown.py +32 -16
- pygpt_net/controller/theme/menu.py +26 -5
- pygpt_net/controller/theme/nodes.py +2 -5
- pygpt_net/controller/tools/__init__.py +40 -2
- pygpt_net/controller/ui/__init__.py +4 -6
- pygpt_net/controller/ui/tabs.py +363 -65
- pygpt_net/core/access/actions.py +6 -4
- pygpt_net/core/access/shortcuts.py +4 -3
- pygpt_net/core/access/voice.py +6 -5
- pygpt_net/core/agents/legacy.py +4 -2
- pygpt_net/core/agents/memory.py +7 -2
- pygpt_net/core/agents/observer/evaluation.py +15 -7
- pygpt_net/core/agents/provider.py +9 -4
- pygpt_net/core/agents/runner.py +61 -15
- pygpt_net/core/agents/tools.py +23 -5
- pygpt_net/core/assistants/__init__.py +6 -4
- pygpt_net/core/assistants/files.py +35 -12
- pygpt_net/core/assistants/store.py +20 -10
- pygpt_net/core/attachments/__init__.py +54 -15
- pygpt_net/core/attachments/context.py +217 -64
- pygpt_net/core/audio/__init__.py +71 -3
- pygpt_net/core/audio/context.py +7 -2
- pygpt_net/core/bridge/__init__.py +22 -6
- pygpt_net/core/bridge/context.py +5 -3
- pygpt_net/core/bridge/worker.py +16 -2
- pygpt_net/core/calendar/__init__.py +57 -11
- pygpt_net/core/chain/__init__.py +8 -2
- pygpt_net/core/chain/chat.py +10 -8
- pygpt_net/core/chain/completion.py +10 -7
- pygpt_net/core/command.py +62 -17
- pygpt_net/core/ctx/__init__.py +260 -58
- pygpt_net/core/ctx/bag.py +25 -4
- pygpt_net/core/ctx/container.py +28 -17
- pygpt_net/core/ctx/idx.py +45 -8
- pygpt_net/core/ctx/output.py +95 -74
- pygpt_net/core/ctx/reply.py +5 -2
- pygpt_net/core/db/__init__.py +8 -7
- pygpt_net/core/db/viewer.py +17 -11
- pygpt_net/core/debug/__init__.py +10 -9
- pygpt_net/core/debug/tabs.py +5 -2
- pygpt_net/core/docker/__init__.py +11 -5
- pygpt_net/core/docker/builder.py +11 -3
- pygpt_net/core/events/app.py +5 -3
- pygpt_net/core/events/base.py +11 -5
- pygpt_net/core/events/control.py +5 -3
- pygpt_net/core/events/event.py +18 -7
- pygpt_net/core/events/kernel.py +5 -3
- pygpt_net/core/events/render.py +5 -3
- pygpt_net/core/experts/__init__.py +5 -4
- pygpt_net/core/filesystem/__init__.py +52 -34
- pygpt_net/core/filesystem/actions.py +8 -5
- pygpt_net/core/filesystem/editor.py +13 -3
- pygpt_net/core/filesystem/types.py +12 -7
- pygpt_net/core/filesystem/url.py +7 -3
- pygpt_net/core/idx/__init__.py +34 -25
- pygpt_net/core/idx/chat.py +60 -38
- pygpt_net/core/idx/context.py +6 -2
- pygpt_net/core/idx/indexing.py +84 -35
- pygpt_net/core/idx/llm.py +11 -3
- pygpt_net/core/idx/metadata.py +13 -3
- pygpt_net/core/idx/types/ctx.py +32 -6
- pygpt_net/core/idx/types/external.py +41 -7
- pygpt_net/core/idx/types/files.py +31 -6
- pygpt_net/core/image.py +15 -4
- pygpt_net/core/llm/__init__.py +13 -3
- pygpt_net/core/locale.py +34 -8
- pygpt_net/core/models.py +4 -3
- pygpt_net/core/notepad.py +9 -4
- pygpt_net/core/plugins.py +7 -6
- pygpt_net/core/presets.py +19 -10
- pygpt_net/core/profile.py +12 -6
- pygpt_net/core/prompt/__init__.py +10 -3
- pygpt_net/core/prompt/custom.py +7 -6
- pygpt_net/core/prompt/template.py +9 -3
- pygpt_net/core/render/base.py +117 -22
- pygpt_net/core/render/markdown/body.py +27 -7
- pygpt_net/core/render/markdown/renderer.py +119 -22
- pygpt_net/core/render/plain/body.py +22 -5
- pygpt_net/core/render/plain/renderer.py +97 -21
- pygpt_net/core/render/web/body.py +75 -25
- pygpt_net/core/render/web/renderer.py +313 -63
- pygpt_net/core/settings.py +9 -4
- pygpt_net/core/tabs/__init__.py +290 -103
- pygpt_net/core/tabs/tab.py +17 -4
- pygpt_net/core/tokens.py +44 -11
- pygpt_net/core/updater/__init__.py +20 -7
- pygpt_net/core/vision/analyzer.py +29 -6
- pygpt_net/core/web.py +130 -2
- pygpt_net/data/config/config.json +19 -6
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/config/modes.json +3 -3
- pygpt_net/data/config/settings.json +81 -10
- pygpt_net/data/config/settings_section.json +3 -0
- pygpt_net/data/css/style.light.css +1 -0
- pygpt_net/data/css/{web.css → web-blocks.css} +162 -133
- pygpt_net/data/css/{web.light.css → web-blocks.light.css} +7 -0
- pygpt_net/data/css/web-chatgpt.css +350 -0
- pygpt_net/data/css/web-chatgpt.dark.css +64 -0
- pygpt_net/data/css/web-chatgpt.light.css +75 -0
- pygpt_net/data/css/web-chatgpt_wide.css +350 -0
- pygpt_net/data/css/web-chatgpt_wide.dark.css +64 -0
- pygpt_net/data/css/web-chatgpt_wide.light.css +75 -0
- pygpt_net/data/icons/split_screen.svg +1 -0
- pygpt_net/data/locale/locale.de.ini +19 -3
- pygpt_net/data/locale/locale.en.ini +30 -11
- pygpt_net/data/locale/locale.es.ini +19 -3
- pygpt_net/data/locale/locale.fr.ini +19 -3
- pygpt_net/data/locale/locale.it.ini +19 -3
- pygpt_net/data/locale/locale.pl.ini +20 -4
- pygpt_net/data/locale/locale.uk.ini +19 -3
- pygpt_net/data/locale/locale.zh.ini +20 -4
- pygpt_net/data/locale/plugin.cmd_web.de.ini +2 -0
- pygpt_net/data/locale/plugin.cmd_web.en.ini +20 -10
- pygpt_net/data/locale/plugin.cmd_web.es.ini +2 -0
- pygpt_net/data/locale/plugin.cmd_web.fr.ini +2 -0
- pygpt_net/data/locale/plugin.cmd_web.it.ini +2 -0
- pygpt_net/data/locale/plugin.cmd_web.pl.ini +2 -0
- pygpt_net/data/locale/plugin.cmd_web.uk.ini +2 -0
- pygpt_net/data/locale/plugin.cmd_web.zh.ini +2 -0
- pygpt_net/icons.qrc +1 -0
- pygpt_net/icons_rc.py +165 -136
- pygpt_net/item/ctx.py +46 -24
- pygpt_net/plugin/audio_input/simple.py +21 -5
- pygpt_net/plugin/audio_output/__init__.py +4 -1
- pygpt_net/plugin/base/config.py +4 -2
- pygpt_net/plugin/base/plugin.py +26 -6
- pygpt_net/plugin/base/worker.py +37 -9
- pygpt_net/plugin/cmd_code_interpreter/__init__.py +39 -37
- pygpt_net/plugin/cmd_code_interpreter/runner.py +25 -12
- pygpt_net/plugin/cmd_web/__init__.py +46 -6
- pygpt_net/plugin/cmd_web/config.py +74 -48
- pygpt_net/plugin/cmd_web/websearch.py +61 -28
- pygpt_net/plugin/cmd_web/worker.py +79 -13
- pygpt_net/plugin/idx_llama_index/__init__.py +2 -2
- pygpt_net/plugin/real_time/__init__.py +2 -2
- pygpt_net/provider/core/config/patch.py +54 -1
- pygpt_net/provider/core/ctx/base.py +4 -1
- pygpt_net/provider/core/ctx/db_sqlite/__init__.py +10 -1
- pygpt_net/provider/core/ctx/db_sqlite/storage.py +22 -1
- pygpt_net/provider/gpt/assistants.py +10 -9
- pygpt_net/provider/gpt/audio.py +3 -2
- pygpt_net/provider/gpt/chat.py +8 -7
- pygpt_net/provider/gpt/completion.py +6 -4
- pygpt_net/provider/gpt/image.py +9 -2
- pygpt_net/provider/gpt/store.py +14 -13
- pygpt_net/provider/gpt/vision.py +6 -5
- pygpt_net/tools/__init__.py +9 -1
- pygpt_net/tools/base.py +15 -1
- pygpt_net/tools/code_interpreter/__init__.py +174 -75
- pygpt_net/tools/code_interpreter/ui/dialogs.py +21 -103
- pygpt_net/tools/code_interpreter/ui/widgets.py +284 -9
- pygpt_net/tools/html_canvas/__init__.py +78 -23
- pygpt_net/tools/html_canvas/ui/dialogs.py +46 -62
- pygpt_net/tools/html_canvas/ui/widgets.py +96 -3
- pygpt_net/ui/base/context_menu.py +2 -2
- pygpt_net/ui/layout/chat/input.py +10 -18
- pygpt_net/ui/layout/chat/output.py +26 -44
- pygpt_net/ui/layout/ctx/ctx_list.py +13 -4
- pygpt_net/ui/layout/toolbox/footer.py +18 -2
- pygpt_net/ui/main.py +2 -2
- pygpt_net/ui/menu/config.py +7 -11
- pygpt_net/ui/menu/debug.py +11 -1
- pygpt_net/ui/menu/theme.py +9 -2
- pygpt_net/ui/widget/filesystem/explorer.py +2 -2
- pygpt_net/ui/widget/lists/context.py +27 -5
- pygpt_net/ui/widget/tabs/Input.py +2 -2
- pygpt_net/ui/widget/tabs/body.py +2 -1
- pygpt_net/ui/widget/tabs/layout.py +195 -0
- pygpt_net/ui/widget/tabs/output.py +218 -55
- pygpt_net/ui/widget/textarea/html.py +11 -1
- pygpt_net/ui/widget/textarea/output.py +10 -1
- pygpt_net/ui/widget/textarea/search_input.py +4 -1
- pygpt_net/ui/widget/textarea/web.py +49 -9
- {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/METADATA +72 -115
- {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/RECORD +258 -250
- /pygpt_net/data/css/{web.dark.css → web-blocks.dark.css} +0 -0
- {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/LICENSE +0 -0
- {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/WHEEL +0 -0
- {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/entry_points.txt +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,42 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.4.41 (2024-12-14)
|
4
|
+
|
5
|
+
- Improved switching between columns on a split screen.
|
6
|
+
- Added visual identification of the active column.
|
7
|
+
|
8
|
+
## 2.4.40 (2024-12-13)
|
9
|
+
|
10
|
+
- Enhanced Split Screen mode, now promoted from beta to stable.
|
11
|
+
- Python Code Interpreter tool added to the Tabs.
|
12
|
+
- HTML/JS Canvas tool added to the Tabs.
|
13
|
+
- Added attachment icon to the context list if context has attachments.
|
14
|
+
- Improved audio playback.
|
15
|
+
- Improved web search.
|
16
|
+
- Added a thumbnail image to web search results.
|
17
|
+
- Added a new commands to web search: "extract_images" and "extract_links".
|
18
|
+
- Added the option "Use raw content (without summarization)" to the web search plugin, which provides a more detailed result to the main model.
|
19
|
+
- Extended the default maximum result characters to 50,000 in the web search plugin.
|
20
|
+
|
21
|
+
## 2.4.39 (2024-12-09)
|
22
|
+
|
23
|
+
- Added "Split Screen" mode (accessible via the switch in the bottom-right corner of the screen), which allows you to work in two windows simultaneously. It is currently experimental (beta). Future updates will include Code Interpreter and Canvas running in tabs.
|
24
|
+
|
25
|
+
- Fixed: Language switch.
|
26
|
+
|
27
|
+
## 2.4.38 (2024-12-08)
|
28
|
+
|
29
|
+
- Added the ability to select a style for chat display between: Blocks, ChatGPT-like, and ChatGPT-like Wide. New option in the menu: Config -> Theme -> Style...
|
30
|
+
- Added configuration options for audio input in Settings -> Audio -> Audio Input Device, Channels, and Sampling rate.
|
31
|
+
|
32
|
+
## 2.4.37 (2024-11-30)
|
33
|
+
|
34
|
+
- The `Query only` mode in `Uploaded` tab has been renamed to `RAG`.
|
35
|
+
- New options have been added under `Settings -> Files and Attachments`:
|
36
|
+
- `Use history in RAG query`: When enabled, the content of the entire conversation will be used when preparing a query if the mode is set to RAG or Summary.
|
37
|
+
- `RAG limit`: This option is applicable only if 'Use history in RAG query' is enabled. It specifies the limit on how many recent entries in the conversation will be used when generating a query for RAG. A value of 0 indicates no limit.
|
38
|
+
- Cache: dynamic parts of the system prompt (from plugins) have been moved to the very end of the prompt stack to enable the use of prompt cache mechanisms in OpenAI.
|
39
|
+
|
3
40
|
## 2.4.36 (2024-11-28)
|
4
41
|
|
5
42
|
- Added a new command-line argument: --workdir="/path/to/workdir" to explicitly set the current working directory.
|
@@ -33,7 +70,7 @@
|
|
33
70
|
|
34
71
|
- Added an option checkbox `Auto-index on upload` in the `Attachments` tab:
|
35
72
|
|
36
|
-
**Tip:** To use the `
|
73
|
+
**Tip:** To use the `RAG` mode, the file must be indexed in the vector database. This occurs automatically at the time of upload if the `Auto-index on upload` option in the `Attachments` tab is enabled. When uploading large files, such indexing might take a while - therefore, if you are using the `Full context` option, which does not use the index, you can disable the `Auto-index` option to speed up the upload of the attachment. In this case, it will only be indexed when the `RAG` option is called for the first time, and until then, attachment will be available in the form of `Full context` and `Summary`.
|
37
74
|
|
38
75
|
- Added context menu options in `Uploaded attachments` tab: `Open`, `Open Source directory` and `Open Storage directory`.
|
39
76
|
|
README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://snapcraft.io/pygpt)
|
4
4
|
|
5
|
-
Release: **2.4.
|
5
|
+
Release: **2.4.41** | build: **2024.12.14** | Python: **>=3.10, <3.12**
|
6
6
|
|
7
7
|
> Official website: https://pygpt.net | Documentation: https://pygpt.readthedocs.io
|
8
8
|
>
|
@@ -603,11 +603,11 @@ Built-in file loaders:
|
|
603
603
|
- Webpages (crawling any webpage content)
|
604
604
|
- YouTube (transcriptions)
|
605
605
|
|
606
|
-
You can configure data loaders in `Settings / LlamaIndex / Data Loaders` by providing list of keyword arguments for specified loaders.
|
606
|
+
You can configure data loaders in `Settings / Indexes (LlamaIndex) / Data Loaders` by providing list of keyword arguments for specified loaders.
|
607
607
|
You can also develop and provide your own custom loader and register it within the application.
|
608
608
|
|
609
609
|
LlamaIndex is also integrated with context database - you can use data from database (your context history) as additional context in discussion.
|
610
|
-
Options for indexing existing context history or enabling real-time indexing new ones (from database) are available in `Settings / LlamaIndex` section.
|
610
|
+
Options for indexing existing context history or enabling real-time indexing new ones (from database) are available in `Settings / Indexes (LlamaIndex)` section.
|
611
611
|
|
612
612
|
**WARNING:** remember that when indexing content, API calls to the embedding model are used. Each indexing consumes additional tokens. Always control the number of tokens used on the OpenAI page.
|
613
613
|
|
@@ -669,7 +669,7 @@ You can set the limit of steps in such a loop by going to `Settings -> Agents an
|
|
669
669
|
|
670
670
|
You can change the prompt used for evaluating the response in `Settings -> Prompts -> Agent: evaluation prompt in loop`. Here, you can adjust it to suit your needs, for example, by defining more or less critical feedback for the responses received.
|
671
671
|
|
672
|
-
## Agent (
|
672
|
+
## Agent (Autonomous)
|
673
673
|
|
674
674
|
This is an older version of the Agent mode, still available as legacy. However, it is recommended to use the newer mode: `Agent (LlamaIndex)`.
|
675
675
|
|
@@ -817,11 +817,13 @@ The content from the uploaded attachments will be used in the current conversati
|
|
817
817
|
|
818
818
|
- `Full context`: Provides best results. This mode attaches the entire content of the read file to the user's prompt. This process happens in the background and may require a large number of tokens if you uploaded extensive content.
|
819
819
|
|
820
|
-
- `
|
820
|
+
- `RAG`: The indexed attachment will only be queried in real-time using LlamaIndex. This operation does not require any additional tokens, but it may not provide access to the full content of the file 1:1.
|
821
821
|
|
822
822
|
- `Summary`: When queried, an additional query will be generated in the background and executed by a separate model to summarize the content of the attachment and return the required information to the main model. You can change the model used for summarization in the settings under the `Files and attachments` section.
|
823
823
|
|
824
|
-
|
824
|
+
In the `RAG` and `Summary` mode, you can enable an additional setting by going to `Settings -> Files and attachments -> Use history in RAG query`. This allows for better preparation of queries for RAG. When this option is turned on, the entire conversation context is considered, rather than just the user's last query. This allows for better searching of the index for additional context. In the `RAG limit` option, you can set a limit on how many recent entries in a discussion should be considered (`0 = no limit, default: 3`).
|
825
|
+
|
826
|
+
**Important**: When using `Full context` mode, the entire content of the file is included in the prompt, which can result in high token usage each time. If you want to reduce the number of tokens used, instead use the `RAG` option, which will only query the indexed attachment in the vector database to provide additional context.
|
825
827
|
|
826
828
|
**Images as Additional Context**
|
827
829
|
|
@@ -829,7 +831,7 @@ Files such as jpg, png, and similar images are a special case. By default, image
|
|
829
831
|
|
830
832
|
**Uploading larger files and auto-index**
|
831
833
|
|
832
|
-
To use the `
|
834
|
+
To use the `RAG` mode, the file must be indexed in the vector database. This occurs automatically at the time of upload if the `Auto-index on upload` option in the `Attachments` tab is enabled. When uploading large files, such indexing might take a while - therefore, if you are using the `Full context` option, which does not use the index, you can disable the `Auto-index` option to speed up the upload of the attachment. In this case, it will only be indexed when the `RAG` option is called for the first time, and until then, attachment will be available in the form of `Full context` and `Summary`.
|
833
835
|
|
834
836
|
## Downloading files
|
835
837
|
|
@@ -1982,6 +1984,10 @@ Per-page content chunk size (max characters per chunk). *Default:* `20000`
|
|
1982
1984
|
|
1983
1985
|
Disables SSL verification when crawling web pages. *Default:* `False`
|
1984
1986
|
|
1987
|
+
- `Use raw content (without summarization)` *raw*
|
1988
|
+
|
1989
|
+
Return raw content from web search instead of summarized content. Provides more data but consumes more tokens. *Default:* `True`
|
1990
|
+
|
1985
1991
|
- `Timeout` *timeout*
|
1986
1992
|
|
1987
1993
|
Connection timeout (seconds). *Default:* `5`
|
@@ -1992,7 +1998,7 @@ User agent to use when making requests. *Default:* `Mozilla/5.0`.
|
|
1992
1998
|
|
1993
1999
|
- `Max result length` *max_result_length*
|
1994
2000
|
|
1995
|
-
Max length of summarized result (characters). *Default:* `
|
2001
|
+
Max length of the summarized or raw result (characters). *Default:* `50000`
|
1996
2002
|
|
1997
2003
|
- `Max summary tokens` *summary_max_tokens*
|
1998
2004
|
|
@@ -2678,6 +2684,8 @@ Config -> Settings...
|
|
2678
2684
|
|
2679
2685
|
- `Zoom`: Adjusts the zoom in chat window (web render view). `WebEngine / Chromium` render mode only.
|
2680
2686
|
|
2687
|
+
- `Style (chat)`: Chat style (Blocks, or ChatGPT-like, or ChatGPT-like Wide. `WebEngine / Chromium` render mode only.
|
2688
|
+
|
2681
2689
|
- `Code syntax highlight`: Syntax highlight theme in code blocks. `WebEngine / Chromium` render mode only.
|
2682
2690
|
|
2683
2691
|
- `Font Size (chat window)`: Adjusts the font size in the chat window (plain-text) and notepads.
|
@@ -2700,8 +2708,6 @@ Config -> Settings...
|
|
2700
2708
|
|
2701
2709
|
- `Use theme colors in chat window`: Use color theme in chat window, Default: True.
|
2702
2710
|
|
2703
|
-
- `Disable markdown formatting in output`: Enables plain-text display in output window, Default: False.
|
2704
|
-
|
2705
2711
|
**Files and attachments**
|
2706
2712
|
|
2707
2713
|
- `Store attachments in the workdir upload directory`: Enable to store a local copy of uploaded attachments for future use. Default: True
|
@@ -2710,6 +2716,16 @@ Config -> Settings...
|
|
2710
2716
|
|
2711
2717
|
- `Directory for file downloads`: Subdirectory for downloaded files, e.g. in Assistants mode, inside "data". Default: "download"
|
2712
2718
|
|
2719
|
+
- `Verbose mode`: Enabled verbose mode when using attachment as additional context.
|
2720
|
+
|
2721
|
+
- `Model for querying index`: Model to use for preparing query and querying the index when the RAG option is selected.
|
2722
|
+
|
2723
|
+
- `Model for attachment content summary`: Model to use when generating a summary for the content of a file when the Summary option is selected.
|
2724
|
+
|
2725
|
+
- `Use history in RAG query`: When enabled, the content of the entire conversation will be used when preparing a query if mode is RAG or Summary.
|
2726
|
+
|
2727
|
+
- `RAG limit`: Only if the option `Use history in RAG query` is enabled. Specify the limit of how many recent entries in the conversation will be used when generating a query for RAG. 0 = no limit.
|
2728
|
+
|
2713
2729
|
**Context**
|
2714
2730
|
|
2715
2731
|
- `Context Threshold`: Sets the number of tokens reserved for the model to respond to the next prompt.
|
@@ -2802,14 +2818,22 @@ Config -> Settings...
|
|
2802
2818
|
|
2803
2819
|
**Vision**
|
2804
2820
|
|
2821
|
+
- `Vision: Camera Input Device`: Video capture camera index (index of the camera, default: 0).
|
2822
|
+
|
2805
2823
|
- `Vision: Camera capture width (px)`: Video capture resolution (width).
|
2806
2824
|
|
2807
2825
|
- `Vision: Camera capture height (px)`: Video capture resolution (height).
|
2808
2826
|
|
2809
|
-
- `Vision: Camera IDX (number)`: Video capture camera index (number of camera).
|
2810
|
-
|
2811
2827
|
- `Vision: Image capture quality`: Video capture image JPEG quality (%).
|
2812
2828
|
|
2829
|
+
**Audio**
|
2830
|
+
|
2831
|
+
- `Audio Input Device`: Selects the audio device for Microphone input.
|
2832
|
+
|
2833
|
+
- `Channels`: Input channels, default: 1
|
2834
|
+
|
2835
|
+
- `Sampling Rate`: Sampling rate, default: 44100
|
2836
|
+
|
2813
2837
|
**Indexes (LlamaIndex)**
|
2814
2838
|
|
2815
2839
|
- `Indexes`: List of created indexes.
|
@@ -3247,7 +3271,7 @@ If you want to only query index (without chat) you can enable `Query index only
|
|
3247
3271
|
|
3248
3272
|
You can create a custom vector store provider or data loader for your data and develop a custom launcher for the application.
|
3249
3273
|
|
3250
|
-
See the section `Extending PyGPT / Adding custom Vector Store provider` for more details.
|
3274
|
+
See the section `Extending PyGPT / Adding a custom Vector Store provider` for more details.
|
3251
3275
|
|
3252
3276
|
# Updates
|
3253
3277
|
|
@@ -3545,6 +3569,8 @@ Syntax: `event name` - triggered on, `event data` *(data type)*:
|
|
3545
3569
|
|
3546
3570
|
- `AI_NAME` - when preparing an AI name, `data['value']` *(string, name of the AI assistant)*
|
3547
3571
|
|
3572
|
+
- `AGENT_PROMPT` - on agent prompt in eval mode, `data['value']` *(string, prompt)*
|
3573
|
+
|
3548
3574
|
- `AUDIO_INPUT_RECORD_START` - start audio input recording
|
3549
3575
|
|
3550
3576
|
- `AUDIO_INPUT_RECORD_STOP` - stop audio input recording
|
@@ -3603,10 +3629,16 @@ Syntax: `event name` - triggered on, `event data` *(data type)*:
|
|
3603
3629
|
|
3604
3630
|
- `POST_PROMPT` - after preparing a system prompt, `data['value']` *(string, system prompt)*
|
3605
3631
|
|
3632
|
+
- `POST_PROMPT_ASYNC` - after preparing a system prompt, just before request in async thread, `data['value']` *(string, system prompt)*
|
3633
|
+
|
3634
|
+
- `POST_PROMPT_END` - after preparing a system prompt, just before request in async thread, at the very end `data['value']` *(string, system prompt)*
|
3635
|
+
|
3606
3636
|
- `PRE_PROMPT` - before preparing a system prompt, `data['value']` *(string, system prompt)*
|
3607
3637
|
|
3608
3638
|
- `SYSTEM_PROMPT` - when preparing a system prompt, `data['value']` *(string, system prompt)*
|
3609
3639
|
|
3640
|
+
- `TOOL_OUTPUT_RENDER` - when rendering extra content from tools from plugins, `data['content']` *(string, content)*
|
3641
|
+
|
3610
3642
|
- `UI_ATTACHMENTS` - when the attachment upload elements are rendered, `data['value']` *(bool, show True/False)*
|
3611
3643
|
|
3612
3644
|
- `UI_VISION` - when the vision elements are rendered, `data['value']` *(bool, show True/False)*
|
@@ -3845,117 +3877,42 @@ may consume additional tokens that are not displayed in the main window.
|
|
3845
3877
|
|
3846
3878
|
## Recent changes:
|
3847
3879
|
|
3848
|
-
**2.4.
|
3849
|
-
|
3850
|
-
- Added a new command-line argument: --workdir="/path/to/workdir" to explicitly set the current working directory.
|
3851
|
-
- Fix: start image generation in Image mode.
|
3852
|
-
|
3853
|
-
**2.4.35 (2024-11-28)**
|
3854
|
-
|
3855
|
-
- Docker removed from dependencies in Snap version #82
|
3856
|
-
- Refactored documentation.
|
3857
|
-
- Fix: toggles real-time update hook.
|
3858
|
-
- Fix: missing edit icons.
|
3859
|
-
- Added tokens from attachments to counters if mode == Full context.
|
3860
|
-
|
3861
|
-
**2.4.34 (2024-11-26)**
|
3862
|
-
|
3863
|
-
- Added a new mode: `Chat with Audio`, with built-in multimodal support for audio input/output. Currently in `beta`, the execution of commands and tools in this mode is temporarily unavailable.
|
3864
|
-
- Added new models: `gpt-4o-audio-preview`, `gpt-4o-2024-11-20`, `chatgpt-4o-latest`.
|
3865
|
-
- Force disabled integration with the native system menu.
|
3866
|
-
|
3867
|
-
**2.4.33 (2024-11-26)**
|
3868
|
-
|
3869
|
-
- Improved CSS and rendering of file and image lists.
|
3870
|
-
- Added displaying of used attachments in the chat window.
|
3871
|
-
|
3872
|
-
**2.4.32 (2024-11-26)**
|
3873
|
-
|
3874
|
-
- The "Add URL" option added to the "Attachments" tab allows users to include content from a given website as additional context. Currently, it only supports standard web pages and video transcription for YouTube links. More "web" options will be added in the future.
|
3875
|
-
- Added UTF-8 as default in attachments content text read/write.
|
3876
|
-
|
3877
|
-
**2.4.31 (2024-11-25)**
|
3878
|
-
|
3879
|
-
- Added an option checkbox `Auto-index on upload` in the `Attachments` tab:
|
3880
|
-
|
3881
|
-
**Tip:** To use the `Query only` mode, the file must be indexed in the vector database. This occurs automatically at the time of upload if the `Auto-index on upload` option in the `Attachments` tab is enabled. When uploading large files, such indexing might take a while - therefore, if you are using the `Full context` option, which does not use the index, you can disable the `Auto-index` option to speed up the upload of the attachment. In this case, it will only be indexed when the `Query only` option is called for the first time, and until then, attachment will be available in the form of `Full context` and `Summary`.
|
3882
|
-
|
3883
|
-
- Added context menu options in `Uploaded attachments` tab: `Open`, `Open Source directory` and `Open Storage directory`.
|
3884
|
-
|
3885
|
-
**2.4.30 (2024-11-25)**
|
3886
|
-
|
3887
|
-
- Added instruction to model about mapped data directory in both legacy and IPython code interepreter.
|
3888
|
-
- Updated locales for plugins.
|
3889
|
-
|
3890
|
-
**2.4.29 (2024-11-25)**
|
3891
|
-
|
3892
|
-
- Added a local IPython interpreter - you can now choose between local and sandbox (Docker) in the plugin settings.
|
3893
|
-
- Added the ability to configure mapped volumes and ports for Docker containers in the plugin settings.
|
3894
|
-
- Optimized and speed-up the LlamaIndex plugin (inline).
|
3895
|
-
- Checkboxes replaced with Toggle buttons.
|
3896
|
-
- Improved settings dialogs.
|
3897
|
-
- Slight modification of the layout.
|
3898
|
-
- Fix: Dockerfile formatting in Code Interpreter config.
|
3899
|
-
- Fix: experts inline plugin execution.
|
3900
|
-
|
3901
|
-
**2.4.28 (2024-11-24)**
|
3902
|
-
|
3903
|
-
- Fix: issue #78
|
3904
|
-
|
3905
|
-
**2.4.27 (2024-11-24)**
|
3906
|
-
|
3907
|
-
- Profile switch fix.
|
3908
|
-
|
3909
|
-
**2.4.26 (2024-11-24)**
|
3910
|
-
|
3911
|
-
- Fix: issue #77
|
3912
|
-
|
3913
|
-
**2.4.25 (2024-11-24)**
|
3914
|
-
|
3915
|
-
- Added new plugin: System (OS), with optional sandbox support.
|
3916
|
-
- Execution of system commands moved to the System plugin.
|
3917
|
-
- Improved sandbox/Docker management.
|
3918
|
-
- Enhanced plugin settings.
|
3919
|
-
- Commands renamed to Tools, simplified layout.
|
3920
|
-
- Fix: handling of the Mouse and Keyboard plugin.
|
3921
|
-
- Fix: switching to a new context from a non-chat tab.
|
3922
|
-
- Fix: camera screenshots when the camera is not started.
|
3923
|
-
|
3924
|
-
**2.4.24 (2024-11-23)**
|
3925
|
-
|
3926
|
-
- Added the ability to use ZIP and TAR archives as attachments (they are now unpacked "on the fly").
|
3927
|
-
- Added the ability to index ZIP and TAR archives (it may be necessary to remove .zip and .tar from the blacklist in the settings).
|
3928
|
-
- Fix: error when uploading to the /data directory using the Upload files button.
|
3929
|
-
|
3930
|
-
**2.4.23 (2024-11-23)**
|
3880
|
+
**2.4.41 (2024-12-14)**
|
3931
3881
|
|
3932
|
-
-
|
3933
|
-
- Added
|
3934
|
-
- Fixed auto-clear in attachments in Assistants mode.
|
3882
|
+
- Improved switching between columns on a split screen.
|
3883
|
+
- Added visual identification of the active column.
|
3935
3884
|
|
3936
|
-
**2.4.
|
3885
|
+
**2.4.40 (2024-12-13)**
|
3937
3886
|
|
3938
|
-
-
|
3939
|
-
-
|
3887
|
+
- Enhanced Split Screen mode, now promoted from beta to stable.
|
3888
|
+
- Python Code Interpreter tool added to the Tabs.
|
3889
|
+
- HTML/JS Canvas tool added to the Tabs.
|
3890
|
+
- Added attachment icon to the context list if context has attachments.
|
3891
|
+
- Improved audio playback.
|
3892
|
+
- Improved web search.
|
3893
|
+
- Added a thumbnail image to web search results.
|
3894
|
+
- Added a new commands to web search: "extract_images" and "extract_links".
|
3895
|
+
- Added the option "Use raw content (without summarization)" to the web search plugin, which provides a more detailed result to the main model.
|
3896
|
+
- Extended the default maximum result characters to 50,000 in the web search plugin.
|
3940
3897
|
|
3941
|
-
**2.4.
|
3898
|
+
**2.4.39 (2024-12-09)**
|
3942
3899
|
|
3943
|
-
- Added
|
3900
|
+
- Added "Split Screen" mode (accessible via the switch in the bottom-right corner of the screen), which allows you to work in two windows simultaneously. It is currently experimental (beta). Future updates will include Code Interpreter and Canvas running in tabs.
|
3944
3901
|
|
3945
|
-
- Fixed
|
3902
|
+
- Fixed: Language switch.
|
3946
3903
|
|
3947
|
-
**2.4.
|
3904
|
+
**2.4.38 (2024-12-08)**
|
3948
3905
|
|
3949
|
-
-
|
3950
|
-
-
|
3906
|
+
- Added the ability to select a style for chat display between: Blocks, ChatGPT-like, and ChatGPT-like Wide. New option in the menu: Config -> Theme -> Style...
|
3907
|
+
- Added configuration options for audio input in Settings -> Audio -> Audio Input Device, Channels, and Sampling rate.
|
3951
3908
|
|
3952
|
-
**2.4.
|
3909
|
+
**2.4.37 (2024-11-30)**
|
3953
3910
|
|
3954
|
-
-
|
3955
|
-
-
|
3956
|
-
-
|
3957
|
-
-
|
3958
|
-
-
|
3911
|
+
- The `Query only` mode in `Uploaded` tab has been renamed to `RAG`.
|
3912
|
+
- New options have been added under `Settings -> Files and Attachments`:
|
3913
|
+
- `Use history in RAG query`: When enabled, the content of the entire conversation will be used when preparing a query if the mode is set to RAG or Summary.
|
3914
|
+
- `RAG limit`: This option is applicable only if 'Use history in RAG query' is enabled. It specifies the limit on how many recent entries in the conversation will be used when generating a query for RAG. A value of 0 indicates no limit.
|
3915
|
+
- Cache: dynamic parts of the system prompt (from plugins) have been moved to the very end of the prompt stack to enable the use of prompt cache mechanisms in OpenAI.
|
3959
3916
|
|
3960
3917
|
|
3961
3918
|
# Credits and links
|
pygpt_net/CHANGELOG.txt
CHANGED
@@ -1,3 +1,40 @@
|
|
1
|
+
2.4.41 (2024-12-14)
|
2
|
+
|
3
|
+
- Improved switching between columns on a split screen.
|
4
|
+
- Added visual identification of the active column.
|
5
|
+
|
6
|
+
2.4.40 (2024-12-13)
|
7
|
+
|
8
|
+
- Enhanced Split Screen mode, now promoted from beta to stable.
|
9
|
+
- Python Code Interpreter tool added to the Tabs.
|
10
|
+
- HTML/JS Canvas tool added to the Tabs.
|
11
|
+
- Added attachment icon to the context list if context has attachments.
|
12
|
+
- Improved audio playback.
|
13
|
+
- Improved web search.
|
14
|
+
- Added a thumbnail image to web search results.
|
15
|
+
- Added a new commands to web search: "extract_images" and "extract_links".
|
16
|
+
- Added the option "Use raw content (without summarization)" to the web search plugin, which provides a more detailed result to the main model.
|
17
|
+
- Extended the default maximum result characters to 50,000 in the web search plugin.
|
18
|
+
|
19
|
+
2.4.39 (2024-12-09)
|
20
|
+
|
21
|
+
- Added "Split Screen" mode (accessible via the switch in the bottom-right corner of the screen), which allows you to work in two windows simultaneously. It is currently experimental (beta). Future updates will include Code Interpreter and Canvas running in tabs.
|
22
|
+
|
23
|
+
- Fixed: Language switch.
|
24
|
+
|
25
|
+
2.4.38 (2024-12-08)
|
26
|
+
|
27
|
+
- Added the ability to select a style for chat display between: Blocks, ChatGPT-like, and ChatGPT-like Wide. New option in the menu: Config -> Theme -> Style...
|
28
|
+
- Added configuration options for audio input in Settings -> Audio -> Audio Input Device, Channels, and Sampling rate.
|
29
|
+
|
30
|
+
2.4.37 (2024-11-30)
|
31
|
+
|
32
|
+
- The `Query only` mode in `Uploaded` tab has been renamed to `RAG`.
|
33
|
+
- New options have been added under `Settings -> Files and Attachments`:
|
34
|
+
- `Use history in RAG query`: When enabled, the content of the entire conversation will be used when preparing a query if the mode is set to RAG or Summary.
|
35
|
+
- `RAG limit`: This option is applicable only if 'Use history in RAG query' is enabled. It specifies the limit on how many recent entries in the conversation will be used when generating a query for RAG. A value of 0 indicates no limit.
|
36
|
+
- Cache: dynamic parts of the system prompt (from plugins) have been moved to the very end of the prompt stack to enable the use of prompt cache mechanisms in OpenAI.
|
37
|
+
|
1
38
|
2.4.36 (2024-11-28)
|
2
39
|
|
3
40
|
- Added a new command-line argument: --workdir="/path/to/workdir" to explicitly set the current working directory.
|
@@ -31,7 +68,7 @@
|
|
31
68
|
|
32
69
|
- Added an option checkbox `Auto-index on upload` in the `Attachments` tab:
|
33
70
|
|
34
|
-
Tip: To use the `
|
71
|
+
Tip: To use the `RAG` mode, the file must be indexed in the vector database. This occurs automatically at the time of upload if the `Auto-index on upload` option in the `Attachments` tab is enabled. When uploading large files, such indexing might take a while - therefore, if you are using the `Full context` option, which does not use the index, you can disable the `Auto-index` option to speed up the upload of the attachment. In this case, it will only be indexed when the `RAG` option is called for the first time, and until then, attachment will be available in the form of `Full context` and `Summary`.
|
35
72
|
|
36
73
|
- Added context menu options in `Uploaded attachments` tab: `Open`, `Open Source directory` and `Open Storage directory`.
|
37
74
|
|
pygpt_net/__init__.py
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.12.14 08:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
__author__ = "Marcin Szczygliński"
|
13
13
|
__copyright__ = "Copyright 2024, Marcin Szczygliński"
|
14
14
|
__credits__ = ["Marcin Szczygliński"]
|
15
15
|
__license__ = "MIT"
|
16
|
-
__version__ = "2.4.
|
17
|
-
__build__ = "2024.
|
16
|
+
__version__ = "2.4.41"
|
17
|
+
__build__ = "2024.12.14"
|
18
18
|
__maintainer__ = "Marcin Szczygliński"
|
19
19
|
__github__ = "https://github.com/szczyglis-dev/py-gpt"
|
20
20
|
__website__ = "https://pygpt.net"
|
pygpt_net/controller/__init__.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.12.09 23:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from pygpt_net.controller.access import Access
|
@@ -87,15 +87,16 @@ class Controller:
|
|
87
87
|
self.chat.init()
|
88
88
|
|
89
89
|
# setup layout
|
90
|
-
self.ui.pre_setup()
|
91
90
|
self.layout.setup()
|
92
91
|
self.ui.setup()
|
92
|
+
self.ui.tabs.setup()
|
93
93
|
|
94
94
|
# setup controllers
|
95
95
|
self.lang.setup()
|
96
96
|
self.assistant.setup()
|
97
97
|
self.chat.setup()
|
98
98
|
self.agent.setup()
|
99
|
+
self.tools.setup()
|
99
100
|
self.ctx.setup()
|
100
101
|
self.presets.setup()
|
101
102
|
self.idx.setup()
|
@@ -105,7 +106,8 @@ class Controller:
|
|
105
106
|
self.attachment.setup()
|
106
107
|
self.camera.setup_ui()
|
107
108
|
self.access.setup()
|
108
|
-
|
109
|
+
|
110
|
+
|
109
111
|
|
110
112
|
def post_setup(self):
|
111
113
|
"""Post-setup, after plugins are loaded"""
|
@@ -116,6 +118,7 @@ class Controller:
|
|
116
118
|
self.calendar.setup() # after everything is loaded
|
117
119
|
self.painter.setup() # load previous image if exists
|
118
120
|
self.debug.post_setup() # post setup debug after all loaded
|
121
|
+
self.ui.tabs.restore_data() # restore opened tabs data
|
119
122
|
|
120
123
|
# show license terms dialog
|
121
124
|
if not self.window.core.config.get('license.accepted'):
|
@@ -168,6 +171,7 @@ class Controller:
|
|
168
171
|
# post-reload
|
169
172
|
self.ui.tabs.reload_after()
|
170
173
|
self.ctx.reload_after()
|
174
|
+
self.ui.tabs.restore_data() # restore opened tabs data
|
171
175
|
self.kernel.restart()
|
172
176
|
|
173
177
|
self.reloading = False # unlock
|
@@ -6,9 +6,11 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.12.14 08:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
|
+
from typing import Optional, List, Dict, Any
|
13
|
+
|
12
14
|
import pyaudio
|
13
15
|
import wave
|
14
16
|
import os
|
@@ -59,7 +61,7 @@ class Voice:
|
|
59
61
|
"""Setup voice control"""
|
60
62
|
self.update()
|
61
63
|
|
62
|
-
def delayed_play(self, text: str, event: AppEvent
|
64
|
+
def delayed_play(self, text: str, event: AppEvent):
|
63
65
|
"""
|
64
66
|
Delayed play audio
|
65
67
|
|
@@ -185,7 +187,11 @@ class Voice:
|
|
185
187
|
self.enable_voice_control()
|
186
188
|
|
187
189
|
def is_voice_control_enabled(self) -> bool:
|
188
|
-
"""
|
190
|
+
"""
|
191
|
+
Check if voice control is enabled
|
192
|
+
|
193
|
+
:return: True if enabled
|
194
|
+
"""
|
189
195
|
return self.window.core.config.get("access.voice_control")
|
190
196
|
|
191
197
|
def toggle_recording(self):
|
@@ -342,7 +348,7 @@ class Voice:
|
|
342
348
|
self.window.tools.get("transcriber").on_transcribe(path, text)
|
343
349
|
|
344
350
|
@Slot(object, object)
|
345
|
-
def handle_input(self, text: str, ctx: CtxItem = None):
|
351
|
+
def handle_input(self, text: str, ctx: Optional[CtxItem] = None):
|
346
352
|
"""
|
347
353
|
Insert text to input and send
|
348
354
|
|
@@ -356,7 +362,7 @@ class Voice:
|
|
356
362
|
commands = self.window.core.access.voice.recognize_commands(text)
|
357
363
|
self.handle_commands(commands)
|
358
364
|
|
359
|
-
def handle_commands(self, commands:
|
365
|
+
def handle_commands(self, commands: List[Dict[str, Any]]):
|
360
366
|
"""
|
361
367
|
Handle commands
|
362
368
|
|
@@ -6,9 +6,11 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.12.14 08:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
|
+
from typing import Optional, Any
|
13
|
+
|
12
14
|
from pygpt_net.core.types import (
|
13
15
|
MODE_AGENT,
|
14
16
|
MODE_EXPERT,
|
@@ -44,9 +46,7 @@ class Experts:
|
|
44
46
|
return self.is_stop
|
45
47
|
|
46
48
|
def unlock(self):
|
47
|
-
"""
|
48
|
-
Unlock experts
|
49
|
-
"""
|
49
|
+
"""Unlock experts"""
|
50
50
|
self.is_stop = False
|
51
51
|
|
52
52
|
def enabled(self) -> bool:
|
@@ -61,7 +61,12 @@ class Experts:
|
|
61
61
|
return True
|
62
62
|
return False
|
63
63
|
|
64
|
-
def append_prompts(
|
64
|
+
def append_prompts(
|
65
|
+
self,
|
66
|
+
mode: str,
|
67
|
+
sys_prompt: str,
|
68
|
+
parent_id: Optional[str] = None
|
69
|
+
):
|
65
70
|
"""
|
66
71
|
Append prompt to the window
|
67
72
|
|
@@ -151,7 +156,7 @@ class Experts:
|
|
151
156
|
return num_calls # abort continue if expert call detected
|
152
157
|
return num_calls
|
153
158
|
|
154
|
-
def log(self, data:
|
159
|
+
def log(self, data: Any):
|
155
160
|
"""
|
156
161
|
Log data to debug
|
157
162
|
|
@@ -6,9 +6,11 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.12.14 08:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
|
+
from typing import Optional, List, Dict, Any
|
13
|
+
|
12
14
|
from pygpt_net.core.types import (
|
13
15
|
MODE_AGENT,
|
14
16
|
MODE_AGENT_LLAMA,
|
@@ -109,7 +111,7 @@ class Legacy:
|
|
109
111
|
self.window.ui.nodes['status.agent'].setText(status)
|
110
112
|
self.window.controller.agent.common.toggle_status()
|
111
113
|
|
112
|
-
def get_functions(self) ->
|
114
|
+
def get_functions(self) -> List[Dict[str, Any]]:
|
113
115
|
"""
|
114
116
|
Append goal commands
|
115
117
|
|
@@ -137,7 +139,7 @@ class Legacy:
|
|
137
139
|
def on_system_prompt(
|
138
140
|
self,
|
139
141
|
prompt: str,
|
140
|
-
append_prompt: str = "",
|
142
|
+
append_prompt: Optional[str] = "",
|
141
143
|
auto_stop: bool = True,
|
142
144
|
) -> str:
|
143
145
|
"""
|
@@ -286,7 +288,7 @@ class Legacy:
|
|
286
288
|
def on_cmd(
|
287
289
|
self,
|
288
290
|
ctx: CtxItem,
|
289
|
-
cmds:
|
291
|
+
cmds: List[Dict[str, Any]],
|
290
292
|
):
|
291
293
|
"""
|
292
294
|
Event: On commands
|
@@ -300,7 +302,7 @@ class Legacy:
|
|
300
302
|
def cmd(
|
301
303
|
self,
|
302
304
|
ctx: CtxItem,
|
303
|
-
cmds:
|
305
|
+
cmds: List[Dict[str, Any]],
|
304
306
|
):
|
305
307
|
"""
|
306
308
|
Event: On command
|
@@ -378,7 +380,7 @@ class Legacy:
|
|
378
380
|
mode="agent",
|
379
381
|
)
|
380
382
|
|
381
|
-
def hook_update(self, key, value, caller, *args, **kwargs):
|
383
|
+
def hook_update(self, key: str, value: Any, caller, *args, **kwargs):
|
382
384
|
"""
|
383
385
|
Hook: on option update
|
384
386
|
|