pygpt-net 2.6.1__py3-none-any.whl → 2.6.6__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.
- pygpt_net/CHANGELOG.txt +23 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +20 -1
- pygpt_net/config.py +55 -65
- pygpt_net/controller/__init__.py +5 -2
- pygpt_net/controller/calendar/note.py +101 -126
- pygpt_net/controller/chat/chat.py +38 -35
- pygpt_net/controller/chat/render.py +154 -214
- pygpt_net/controller/chat/response.py +5 -3
- pygpt_net/controller/chat/stream.py +92 -27
- pygpt_net/controller/config/config.py +39 -42
- pygpt_net/controller/config/field/checkbox.py +16 -12
- pygpt_net/controller/config/field/checkbox_list.py +36 -31
- pygpt_net/controller/config/field/cmd.py +51 -57
- pygpt_net/controller/config/field/combo.py +33 -16
- pygpt_net/controller/config/field/dictionary.py +48 -55
- pygpt_net/controller/config/field/input.py +50 -32
- pygpt_net/controller/config/field/slider.py +40 -45
- pygpt_net/controller/config/field/textarea.py +20 -6
- pygpt_net/controller/config/placeholder.py +110 -231
- pygpt_net/controller/ctx/common.py +48 -48
- pygpt_net/controller/ctx/ctx.py +91 -132
- pygpt_net/controller/lang/mapping.py +57 -95
- pygpt_net/controller/lang/plugins.py +64 -55
- pygpt_net/controller/lang/settings.py +39 -38
- pygpt_net/controller/layout/layout.py +176 -109
- pygpt_net/controller/mode/mode.py +88 -85
- pygpt_net/controller/model/model.py +73 -73
- pygpt_net/controller/plugins/plugins.py +209 -223
- pygpt_net/controller/plugins/presets.py +54 -55
- pygpt_net/controller/plugins/settings.py +54 -69
- pygpt_net/controller/presets/editor.py +33 -88
- pygpt_net/controller/presets/experts.py +20 -1
- pygpt_net/controller/presets/presets.py +293 -298
- pygpt_net/controller/settings/profile.py +16 -4
- pygpt_net/controller/theme/theme.py +72 -81
- pygpt_net/controller/ui/mode.py +118 -186
- pygpt_net/controller/ui/tabs.py +69 -90
- pygpt_net/controller/ui/ui.py +47 -56
- pygpt_net/controller/ui/vision.py +24 -23
- pygpt_net/core/agents/runner.py +15 -7
- pygpt_net/core/bridge/bridge.py +5 -5
- pygpt_net/core/command/command.py +149 -219
- pygpt_net/core/ctx/ctx.py +94 -146
- pygpt_net/core/debug/debug.py +48 -58
- pygpt_net/core/experts/experts.py +3 -3
- pygpt_net/core/models/models.py +74 -112
- pygpt_net/core/modes/modes.py +13 -21
- pygpt_net/core/plugins/plugins.py +154 -177
- pygpt_net/core/presets/presets.py +103 -176
- pygpt_net/core/render/web/body.py +217 -215
- pygpt_net/core/render/web/renderer.py +330 -474
- pygpt_net/core/text/utils.py +28 -44
- pygpt_net/core/tokens/tokens.py +104 -203
- pygpt_net/data/config/config.json +3 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/locale/locale.de.ini +2 -0
- pygpt_net/data/locale/locale.en.ini +2 -0
- pygpt_net/data/locale/locale.es.ini +2 -0
- pygpt_net/data/locale/locale.fr.ini +2 -0
- pygpt_net/data/locale/locale.it.ini +2 -0
- pygpt_net/data/locale/locale.pl.ini +3 -1
- pygpt_net/data/locale/locale.uk.ini +2 -0
- pygpt_net/data/locale/locale.zh.ini +2 -0
- pygpt_net/item/ctx.py +141 -139
- pygpt_net/plugin/agent/plugin.py +2 -1
- pygpt_net/plugin/audio_output/plugin.py +5 -2
- pygpt_net/plugin/base/plugin.py +101 -85
- pygpt_net/plugin/bitbucket/__init__.py +12 -0
- pygpt_net/plugin/bitbucket/config.py +267 -0
- pygpt_net/plugin/bitbucket/plugin.py +126 -0
- pygpt_net/plugin/bitbucket/worker.py +569 -0
- pygpt_net/plugin/cmd_code_interpreter/plugin.py +3 -2
- pygpt_net/plugin/cmd_custom/plugin.py +3 -2
- pygpt_net/plugin/cmd_files/plugin.py +3 -2
- pygpt_net/plugin/cmd_history/plugin.py +3 -2
- pygpt_net/plugin/cmd_mouse_control/plugin.py +5 -2
- pygpt_net/plugin/cmd_serial/plugin.py +3 -2
- pygpt_net/plugin/cmd_system/plugin.py +3 -6
- pygpt_net/plugin/cmd_web/plugin.py +3 -2
- pygpt_net/plugin/experts/plugin.py +2 -2
- pygpt_net/plugin/facebook/__init__.py +12 -0
- pygpt_net/plugin/facebook/config.py +359 -0
- pygpt_net/plugin/facebook/plugin.py +113 -0
- pygpt_net/plugin/facebook/worker.py +698 -0
- pygpt_net/plugin/github/__init__.py +12 -0
- pygpt_net/plugin/github/config.py +441 -0
- pygpt_net/plugin/github/plugin.py +126 -0
- pygpt_net/plugin/github/worker.py +674 -0
- pygpt_net/plugin/google/__init__.py +12 -0
- pygpt_net/plugin/google/config.py +367 -0
- pygpt_net/plugin/google/plugin.py +126 -0
- pygpt_net/plugin/google/worker.py +826 -0
- pygpt_net/plugin/idx_llama_index/plugin.py +3 -2
- pygpt_net/plugin/mailer/plugin.py +3 -5
- pygpt_net/plugin/openai_vision/plugin.py +3 -2
- pygpt_net/plugin/real_time/plugin.py +52 -60
- pygpt_net/plugin/slack/__init__.py +12 -0
- pygpt_net/plugin/slack/config.py +349 -0
- pygpt_net/plugin/slack/plugin.py +115 -0
- pygpt_net/plugin/slack/worker.py +639 -0
- pygpt_net/plugin/telegram/__init__.py +12 -0
- pygpt_net/plugin/telegram/config.py +308 -0
- pygpt_net/plugin/telegram/plugin.py +117 -0
- pygpt_net/plugin/telegram/worker.py +563 -0
- pygpt_net/plugin/twitter/__init__.py +12 -0
- pygpt_net/plugin/twitter/config.py +491 -0
- pygpt_net/plugin/twitter/plugin.py +125 -0
- pygpt_net/plugin/twitter/worker.py +837 -0
- pygpt_net/provider/agents/llama_index/legacy/openai_assistant.py +35 -3
- pygpt_net/tools/code_interpreter/tool.py +0 -1
- pygpt_net/tools/translator/tool.py +1 -1
- pygpt_net/ui/base/config_dialog.py +86 -100
- pygpt_net/ui/base/context_menu.py +48 -46
- pygpt_net/ui/dialog/preset.py +34 -77
- pygpt_net/ui/layout/ctx/ctx_list.py +10 -6
- pygpt_net/ui/layout/toolbox/presets.py +41 -41
- pygpt_net/ui/main.py +49 -31
- pygpt_net/ui/tray.py +61 -60
- pygpt_net/ui/widget/calendar/select.py +86 -70
- pygpt_net/ui/widget/lists/attachment.py +86 -44
- pygpt_net/ui/widget/lists/base_list_combo.py +85 -33
- pygpt_net/ui/widget/lists/context.py +135 -188
- pygpt_net/ui/widget/lists/preset.py +59 -61
- pygpt_net/ui/widget/textarea/web.py +161 -48
- pygpt_net/utils.py +8 -1
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/METADATA +164 -2
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/RECORD +131 -103
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/entry_points.txt +0 -0
pygpt_net/controller/ui/mode.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# ================================================== #
|
|
4
4
|
# This file is a part of PYGPT package #
|
|
@@ -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: 2025.08.
|
|
9
|
+
# Updated Date: 2025.08.15 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from pygpt_net.core.types import (
|
|
@@ -40,204 +40,139 @@ class Mode:
|
|
|
40
40
|
|
|
41
41
|
mode = self.window.core.config.data['mode']
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
else:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
elif
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
self.window.ui.nodes['preset.editor.modes'].setVisible(False)
|
|
125
|
-
self.window.ui.nodes['preset.editor.experts'].setVisible(True)
|
|
126
|
-
self.window.ui.tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt.agent_llama"))
|
|
127
|
-
# self.window.ui.nodes["preset.prompt.label"].setText(trans("preset.prompt.agent_llama"))
|
|
128
|
-
self.window.ui.nodes['preset.tool.function.label.all'].setVisible(False)
|
|
129
|
-
self.window.ui.nodes['preset.tool.function.label.assistant'].setVisible(False)
|
|
130
|
-
self.window.ui.nodes['preset.tool.function.label.agent_llama'].setVisible(False)
|
|
131
|
-
else:
|
|
132
|
-
self.window.ui.nodes['preset.editor.temperature'].setVisible(True)
|
|
133
|
-
self.window.ui.nodes['preset.editor.agent_llama'].setVisible(False)
|
|
134
|
-
self.window.ui.nodes['preset.editor.agent_provider'].setVisible(False)
|
|
135
|
-
self.window.ui.nodes['preset.editor.functions'].setVisible(False)
|
|
136
|
-
self.window.ui.nodes['preset.editor.modes'].setVisible(True)
|
|
137
|
-
self.window.ui.nodes['preset.editor.experts'].setVisible(False)
|
|
138
|
-
self.window.ui.tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt"))
|
|
139
|
-
# self.window.ui.nodes["preset.prompt.label"].setText(trans("preset.prompt"))
|
|
140
|
-
self.window.ui.nodes['preset.tool.function.label.assistant'].setVisible(False)
|
|
141
|
-
self.window.ui.nodes['preset.tool.function.label.agent_llama'].setVisible(False)
|
|
142
|
-
|
|
143
|
-
if mode == MODE_ASSISTANT:
|
|
144
|
-
self.window.ui.nodes['preset.tool.function.label.assistant'].setVisible(True)
|
|
145
|
-
self.window.ui.nodes['preset.tool.function.label.all'].setVisible(False)
|
|
43
|
+
ui_nodes = self.window.ui.nodes
|
|
44
|
+
ui_tabs = self.window.ui.tabs
|
|
45
|
+
ui_menu = self.window.ui.menu
|
|
46
|
+
ctrl = self.window.controller
|
|
47
|
+
presets_editor = ctrl.presets.editor
|
|
48
|
+
|
|
49
|
+
is_assistant = mode == MODE_ASSISTANT
|
|
50
|
+
is_computer = mode == MODE_COMPUTER
|
|
51
|
+
is_agent = mode == MODE_AGENT
|
|
52
|
+
is_agent_llama = mode == MODE_AGENT_LLAMA
|
|
53
|
+
is_agent_openai = mode == MODE_AGENT_OPENAI
|
|
54
|
+
is_expert = mode == MODE_EXPERT
|
|
55
|
+
is_image = mode == MODE_IMAGE
|
|
56
|
+
is_llama_index = mode == MODE_LLAMA_INDEX
|
|
57
|
+
is_completion = mode == MODE_COMPLETION
|
|
58
|
+
|
|
59
|
+
if not is_assistant:
|
|
60
|
+
ui_nodes['presets.widget'].setVisible(True)
|
|
61
|
+
else:
|
|
62
|
+
ui_nodes['presets.widget'].setVisible(False)
|
|
63
|
+
|
|
64
|
+
if not is_computer:
|
|
65
|
+
ui_nodes['env.widget'].setVisible(False)
|
|
66
|
+
else:
|
|
67
|
+
ui_nodes['env.widget'].setVisible(True)
|
|
68
|
+
|
|
69
|
+
show_agents_label = is_agent or is_agent_llama or is_agent_openai
|
|
70
|
+
if show_agents_label:
|
|
71
|
+
ui_nodes['preset.agents.label'].setVisible(True)
|
|
72
|
+
ui_nodes['preset.experts.label'].setVisible(False)
|
|
73
|
+
ui_nodes['preset.presets.label'].setVisible(False)
|
|
74
|
+
elif is_expert:
|
|
75
|
+
ui_nodes['preset.agents.label'].setVisible(False)
|
|
76
|
+
ui_nodes['preset.experts.label'].setVisible(True)
|
|
77
|
+
ui_nodes['preset.presets.label'].setVisible(False)
|
|
78
|
+
else:
|
|
79
|
+
ui_nodes['preset.agents.label'].setVisible(False)
|
|
80
|
+
ui_nodes['preset.experts.label'].setVisible(False)
|
|
81
|
+
ui_nodes['preset.presets.label'].setVisible(True)
|
|
82
|
+
|
|
83
|
+
if is_expert:
|
|
84
|
+
ui_nodes['preset.editor.description'].setVisible(True)
|
|
85
|
+
presets_editor.toggle_tab("remote_tools", True)
|
|
86
|
+
else:
|
|
87
|
+
presets_editor.toggle_tab("remote_tools", False)
|
|
88
|
+
ui_nodes['preset.editor.description'].setVisible(False)
|
|
89
|
+
|
|
90
|
+
if is_completion:
|
|
91
|
+
ui_nodes['preset.editor.user_name'].setVisible(True)
|
|
92
|
+
else:
|
|
93
|
+
ui_nodes['preset.editor.user_name'].setVisible(False)
|
|
94
|
+
|
|
95
|
+
if is_agent_openai:
|
|
96
|
+
ui_nodes['preset.editor.agent_provider_openai'].setVisible(True)
|
|
97
|
+
else:
|
|
98
|
+
ui_nodes['preset.editor.agent_provider_openai'].setVisible(False)
|
|
99
|
+
|
|
100
|
+
if is_agent:
|
|
101
|
+
presets_editor.toggle_tab("experts", True)
|
|
102
|
+
ui_nodes['preset.editor.temperature'].setVisible(True)
|
|
103
|
+
ui_nodes['preset.editor.idx'].setVisible(False)
|
|
104
|
+
ui_nodes['preset.editor.agent_provider'].setVisible(False)
|
|
105
|
+
ui_nodes['preset.editor.modes'].setVisible(False)
|
|
106
|
+
ui_tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt.agent"))
|
|
107
|
+
elif is_agent_llama:
|
|
108
|
+
presets_editor.toggle_tab("experts", False)
|
|
109
|
+
ui_nodes['preset.editor.temperature'].setVisible(False)
|
|
110
|
+
ui_nodes['preset.editor.idx'].setVisible(True)
|
|
111
|
+
ui_nodes['preset.editor.agent_provider'].setVisible(True)
|
|
112
|
+
ui_nodes['preset.editor.modes'].setVisible(False)
|
|
113
|
+
ui_tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt.agent_llama"))
|
|
114
|
+
elif is_agent_openai:
|
|
115
|
+
presets_editor.toggle_tab("experts", True)
|
|
116
|
+
ui_nodes['preset.editor.temperature'].setVisible(False)
|
|
117
|
+
ui_nodes['preset.editor.idx'].setVisible(True)
|
|
118
|
+
ui_nodes['preset.editor.agent_provider'].setVisible(False)
|
|
119
|
+
ui_nodes['preset.editor.modes'].setVisible(False)
|
|
120
|
+
ui_tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt.agent_llama"))
|
|
121
|
+
else:
|
|
122
|
+
if is_expert:
|
|
123
|
+
ui_nodes['preset.editor.idx'].setVisible(True)
|
|
146
124
|
else:
|
|
147
|
-
|
|
148
|
-
self.window.ui.nodes['preset.tool.function.label.all'].setVisible(False)
|
|
125
|
+
ui_nodes['preset.editor.idx'].setVisible(False)
|
|
149
126
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
else:
|
|
156
|
-
self.window.ui.nodes['preset.clear'].setVisible(True)
|
|
157
|
-
"""
|
|
127
|
+
presets_editor.toggle_tab("experts", False)
|
|
128
|
+
ui_nodes['preset.editor.temperature'].setVisible(True)
|
|
129
|
+
ui_nodes['preset.editor.agent_provider'].setVisible(False)
|
|
130
|
+
ui_nodes['preset.editor.modes'].setVisible(True)
|
|
131
|
+
ui_tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt"))
|
|
158
132
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if mode == MODE_IMAGE:
|
|
162
|
-
self.window.ui.nodes['preset.use'].setVisible(True)
|
|
163
|
-
else:
|
|
164
|
-
self.window.ui.nodes['preset.use'].setVisible(False)
|
|
165
|
-
"""
|
|
166
|
-
|
|
167
|
-
# img options
|
|
168
|
-
if mode == MODE_IMAGE:
|
|
169
|
-
self.window.ui.nodes['dalle.options'].setVisible(True)
|
|
170
|
-
else:
|
|
171
|
-
self.window.ui.nodes['dalle.options'].setVisible(False)
|
|
172
|
-
|
|
173
|
-
# agent options
|
|
174
|
-
if mode in [MODE_AGENT]:
|
|
175
|
-
self.window.ui.nodes['agent.options'].setVisible(True)
|
|
133
|
+
if is_image:
|
|
134
|
+
ui_nodes['dalle.options'].setVisible(True)
|
|
176
135
|
else:
|
|
177
|
-
|
|
136
|
+
ui_nodes['dalle.options'].setVisible(False)
|
|
178
137
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
self.window.ui.nodes['agent_llama.options'].setVisible(True)
|
|
138
|
+
if is_agent:
|
|
139
|
+
ui_nodes['agent.options'].setVisible(True)
|
|
182
140
|
else:
|
|
183
|
-
|
|
141
|
+
ui_nodes['agent.options'].setVisible(False)
|
|
184
142
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if mode in [MODE_AGENT_LLAMA]:
|
|
188
|
-
self.window.ui.nodes['preset.prompt'].setVisible(False)
|
|
143
|
+
if is_agent_llama or is_agent_openai:
|
|
144
|
+
ui_nodes['agent_llama.options'].setVisible(True)
|
|
189
145
|
else:
|
|
190
|
-
|
|
191
|
-
"""
|
|
146
|
+
ui_nodes['agent_llama.options'].setVisible(False)
|
|
192
147
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
self.window.ui.nodes['assistants.widget'].setVisible(True)
|
|
148
|
+
if is_assistant:
|
|
149
|
+
ui_nodes['assistants.widget'].setVisible(True)
|
|
196
150
|
else:
|
|
197
|
-
|
|
151
|
+
ui_nodes['assistants.widget'].setVisible(False)
|
|
198
152
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
# self.window.ui.nodes['indexes.widget'].setVisible(True)
|
|
202
|
-
self.window.ui.nodes['idx.options'].setVisible(True)
|
|
153
|
+
if is_llama_index:
|
|
154
|
+
ui_nodes['idx.options'].setVisible(True)
|
|
203
155
|
else:
|
|
204
|
-
|
|
205
|
-
self.window.ui.nodes['idx.options'].setVisible(False)
|
|
206
|
-
|
|
207
|
-
# stream mode
|
|
208
|
-
if mode in [MODE_IMAGE]:
|
|
156
|
+
ui_nodes['idx.options'].setVisible(False)
|
|
209
157
|
|
|
210
|
-
|
|
158
|
+
if is_image:
|
|
159
|
+
ui_nodes['input.stream'].setVisible(False)
|
|
211
160
|
else:
|
|
212
|
-
|
|
161
|
+
ui_nodes['input.stream'].setVisible(True)
|
|
213
162
|
|
|
214
|
-
# vision
|
|
215
163
|
show = self.is_vision(mode)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
self.window.ui.nodes['attachments.capture_clear'].setVisible(show)
|
|
164
|
+
ui_menu['menu.video'].menuAction().setVisible(show)
|
|
165
|
+
ui_nodes['icon.video.capture'].setVisible(show)
|
|
166
|
+
ui_nodes['attachments.capture_clear'].setVisible(show)
|
|
220
167
|
|
|
221
|
-
# attachments
|
|
222
168
|
show = self.are_attachments(mode)
|
|
223
|
-
|
|
169
|
+
ui_tabs['input'].setTabVisible(1, show)
|
|
224
170
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
self.window.ui.tabs['input'].setTabVisible(2, True)
|
|
228
|
-
self.window.ui.tabs['input'].setTabVisible(3, False)
|
|
229
|
-
else:
|
|
230
|
-
if mode != MODE_IMAGE:
|
|
231
|
-
self.window.ui.tabs['input'].setTabVisible(2, False)
|
|
232
|
-
self.window.ui.tabs['input'].setTabVisible(3, True)
|
|
233
|
-
else:
|
|
234
|
-
self.window.ui.tabs['input'].setTabVisible(2, False)
|
|
235
|
-
self.window.ui.tabs['input'].setTabVisible(3, False)
|
|
171
|
+
ui_tabs['input'].setTabVisible(2, is_assistant)
|
|
172
|
+
ui_tabs['input'].setTabVisible(3, (not is_assistant) and (not is_image))
|
|
236
173
|
|
|
237
|
-
|
|
238
|
-
self.window.controller.presets.editor.toggle_extra_options()
|
|
174
|
+
presets_editor.toggle_extra_options()
|
|
239
175
|
|
|
240
|
-
# chat footer
|
|
241
176
|
self.toggle_chat_footer()
|
|
242
177
|
|
|
243
178
|
def toggle_chat_footer(self):
|
|
@@ -254,13 +189,13 @@ class Mode:
|
|
|
254
189
|
:param mode: current mode
|
|
255
190
|
:return: True if vision is allowed
|
|
256
191
|
"""
|
|
257
|
-
|
|
192
|
+
ctrl = self.window.controller
|
|
193
|
+
if ctrl.ui.vision.has_vision():
|
|
258
194
|
return True
|
|
259
195
|
|
|
260
|
-
if
|
|
196
|
+
if ctrl.painter.is_active():
|
|
261
197
|
return True
|
|
262
198
|
|
|
263
|
-
# event: UI: vision
|
|
264
199
|
value = False
|
|
265
200
|
event = Event(Event.UI_VISION, {
|
|
266
201
|
'mode': mode,
|
|
@@ -276,8 +211,6 @@ class Mode:
|
|
|
276
211
|
:param mode: current mode
|
|
277
212
|
:return: True if attachments are allowed
|
|
278
213
|
"""
|
|
279
|
-
# event: UI: attachments
|
|
280
|
-
# value = False
|
|
281
214
|
event = Event(Event.UI_ATTACHMENTS, {
|
|
282
215
|
'mode': mode,
|
|
283
216
|
'value': True,
|
|
@@ -291,5 +224,4 @@ class Mode:
|
|
|
291
224
|
|
|
292
225
|
def hide_chat_footer(self):
|
|
293
226
|
"""Hide chat footer"""
|
|
294
|
-
self.window.ui.nodes['chat.footer'].setVisible(False)
|
|
295
|
-
|
|
227
|
+
self.window.ui.nodes['chat.footer'].setVisible(False)
|