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
@@ -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
|
import datetime
|
13
|
+
from typing import Optional, List, Dict, Any
|
12
14
|
|
13
15
|
from packaging.version import Version
|
14
16
|
|
@@ -50,7 +52,7 @@ class Store:
|
|
50
52
|
if id in self.items:
|
51
53
|
return self.items[id]
|
52
54
|
|
53
|
-
def get_ids(self) ->
|
55
|
+
def get_ids(self) -> List[str]:
|
54
56
|
"""
|
55
57
|
Return all loaded store IDs
|
56
58
|
|
@@ -59,7 +61,7 @@ class Store:
|
|
59
61
|
return list(self.items.keys())
|
60
62
|
|
61
63
|
|
62
|
-
def get_all(self) ->
|
64
|
+
def get_all(self) -> Dict[str, AssistantStoreItem]:
|
63
65
|
"""
|
64
66
|
Return all stores
|
65
67
|
|
@@ -97,7 +99,7 @@ class Store:
|
|
97
99
|
"""
|
98
100
|
return id in self.items
|
99
101
|
|
100
|
-
def create(self) -> AssistantStoreItem
|
102
|
+
def create(self) -> Optional[AssistantStoreItem]:
|
101
103
|
"""
|
102
104
|
Create new store
|
103
105
|
|
@@ -115,7 +117,7 @@ class Store:
|
|
115
117
|
self.items[store.id] = store
|
116
118
|
return store
|
117
119
|
|
118
|
-
def update(self, store: AssistantStoreItem) -> AssistantStoreItem
|
120
|
+
def update(self, store: AssistantStoreItem) -> Optional[AssistantStoreItem]:
|
119
121
|
"""
|
120
122
|
Update store
|
121
123
|
|
@@ -142,7 +144,7 @@ class Store:
|
|
142
144
|
status = self.parse_status(data)
|
143
145
|
return status, data
|
144
146
|
|
145
|
-
def parse_status(self, store) ->
|
147
|
+
def parse_status(self, store) -> Dict[str, Any]:
|
146
148
|
"""
|
147
149
|
Parse store status
|
148
150
|
|
@@ -185,7 +187,11 @@ class Store:
|
|
185
187
|
self.append_status(store, status) # append to store
|
186
188
|
self.update(store) # save to db
|
187
189
|
|
188
|
-
def append_status(
|
190
|
+
def append_status(
|
191
|
+
self,
|
192
|
+
store: AssistantStoreItem,
|
193
|
+
status: Dict[str, Any]
|
194
|
+
):
|
189
195
|
"""
|
190
196
|
Append status to store
|
191
197
|
|
@@ -208,7 +214,7 @@ class Store:
|
|
208
214
|
if "expires_after" in status:
|
209
215
|
store.expire_days = int(status["expires_after"]["days"] or 0)
|
210
216
|
|
211
|
-
def get_names(self) ->
|
217
|
+
def get_names(self) -> Dict[str, str]:
|
212
218
|
"""
|
213
219
|
Get store name mapping id <> name
|
214
220
|
|
@@ -235,7 +241,7 @@ class Store:
|
|
235
241
|
return True
|
236
242
|
return False
|
237
243
|
|
238
|
-
def import_items(self, items:
|
244
|
+
def import_items(self, items: Dict[str, AssistantStoreItem]):
|
239
245
|
"""
|
240
246
|
Insert items
|
241
247
|
|
@@ -286,5 +292,9 @@ class Store:
|
|
286
292
|
self.provider.save_all(self.items)
|
287
293
|
|
288
294
|
def get_version(self) -> str:
|
289
|
-
"""
|
295
|
+
"""
|
296
|
+
Get config version
|
297
|
+
|
298
|
+
:return: version
|
299
|
+
"""
|
290
300
|
return self.provider.get_version()
|
@@ -6,10 +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
12
|
import copy
|
13
|
+
from typing import Optional, List, Dict
|
13
14
|
|
14
15
|
from packaging.version import Version
|
15
16
|
|
@@ -83,7 +84,7 @@ class Attachments:
|
|
83
84
|
|
84
85
|
return list(self.items[mode].keys())
|
85
86
|
|
86
|
-
def get_id_by_idx(self, mode: str, idx: int) -> str
|
87
|
+
def get_id_by_idx(self, mode: str, idx: int) -> Optional[str]:
|
87
88
|
"""
|
88
89
|
Get ID by index in mode
|
89
90
|
|
@@ -97,7 +98,7 @@ class Attachments:
|
|
97
98
|
return id
|
98
99
|
i += 1
|
99
100
|
|
100
|
-
def get_by_id(self, mode: str, id: str) -> AttachmentItem
|
101
|
+
def get_by_id(self, mode: str, id: str) -> Optional[AttachmentItem]:
|
101
102
|
"""
|
102
103
|
Return attachment by ID in mode
|
103
104
|
|
@@ -111,7 +112,7 @@ class Attachments:
|
|
111
112
|
if id in self.items[mode]:
|
112
113
|
return self.items[mode][id]
|
113
114
|
|
114
|
-
def get_by_idx(self, mode: str, idx: int) -> AttachmentItem
|
115
|
+
def get_by_idx(self, mode: str, idx: int) -> Optional[AttachmentItem]:
|
115
116
|
"""
|
116
117
|
Return item by index in mode
|
117
118
|
|
@@ -123,7 +124,11 @@ class Attachments:
|
|
123
124
|
if id is not None:
|
124
125
|
return self.items[mode][id]
|
125
126
|
|
126
|
-
def get_all(
|
127
|
+
def get_all(
|
128
|
+
self,
|
129
|
+
mode: str,
|
130
|
+
only_files: bool = True
|
131
|
+
) -> dict:
|
127
132
|
"""
|
128
133
|
Return all items in mode
|
129
134
|
|
@@ -141,7 +146,11 @@ class Attachments:
|
|
141
146
|
current[attachment.id] = attachment
|
142
147
|
return current
|
143
148
|
|
144
|
-
def get_from_meta_ctx(
|
149
|
+
def get_from_meta_ctx(
|
150
|
+
self,
|
151
|
+
mode: str,
|
152
|
+
meta: CtxMeta
|
153
|
+
) -> List[AttachmentItem]:
|
145
154
|
"""
|
146
155
|
Get attachments from meta context
|
147
156
|
|
@@ -174,8 +183,8 @@ class Attachments:
|
|
174
183
|
def new(
|
175
184
|
self,
|
176
185
|
mode: str,
|
177
|
-
name: str = None,
|
178
|
-
path: str = None,
|
186
|
+
name: Optional[str] = None,
|
187
|
+
path: Optional[str] = None,
|
179
188
|
auto_save: bool = True,
|
180
189
|
type: str = AttachmentItem.TYPE_FILE,
|
181
190
|
) -> AttachmentItem:
|
@@ -233,7 +242,11 @@ class Attachments:
|
|
233
242
|
attachment.id = id
|
234
243
|
return attachment
|
235
244
|
|
236
|
-
def add(
|
245
|
+
def add(
|
246
|
+
self,
|
247
|
+
mode: str,
|
248
|
+
item: AttachmentItem
|
249
|
+
):
|
237
250
|
"""
|
238
251
|
Add item to attachments
|
239
252
|
|
@@ -261,7 +274,12 @@ class Attachments:
|
|
261
274
|
|
262
275
|
return len(self.items[mode]) > 0
|
263
276
|
|
264
|
-
def delete(
|
277
|
+
def delete(
|
278
|
+
self,
|
279
|
+
mode: str,
|
280
|
+
id: str,
|
281
|
+
remove_local: bool = False
|
282
|
+
):
|
265
283
|
"""
|
266
284
|
Delete attachment by file_id
|
267
285
|
|
@@ -280,7 +298,13 @@ class Attachments:
|
|
280
298
|
del self.items[mode][id]
|
281
299
|
self.save()
|
282
300
|
|
283
|
-
def delete_all(
|
301
|
+
def delete_all(
|
302
|
+
self,
|
303
|
+
mode: str,
|
304
|
+
remove_local: bool = False,
|
305
|
+
auto: bool = False,
|
306
|
+
force: bool = False
|
307
|
+
):
|
284
308
|
"""
|
285
309
|
Delete all attachments
|
286
310
|
|
@@ -302,7 +326,11 @@ class Attachments:
|
|
302
326
|
del self.items[mode][id]
|
303
327
|
self.save()
|
304
328
|
|
305
|
-
def clear(
|
329
|
+
def clear(
|
330
|
+
self,
|
331
|
+
mode: str,
|
332
|
+
remove_local: bool = False
|
333
|
+
):
|
306
334
|
"""
|
307
335
|
Clear all attachments in mode
|
308
336
|
|
@@ -355,7 +383,10 @@ class Attachments:
|
|
355
383
|
data.name = name
|
356
384
|
self.save()
|
357
385
|
|
358
|
-
def make_json_list(
|
386
|
+
def make_json_list(
|
387
|
+
self,
|
388
|
+
attachments: Dict[str, AttachmentItem]
|
389
|
+
) -> Dict[str, dict]:
|
359
390
|
"""
|
360
391
|
Make json list
|
361
392
|
|
@@ -371,7 +402,11 @@ class Attachments:
|
|
371
402
|
}
|
372
403
|
return result
|
373
404
|
|
374
|
-
def from_files(
|
405
|
+
def from_files(
|
406
|
+
self,
|
407
|
+
mode: str,
|
408
|
+
files: Dict[str, dict]
|
409
|
+
):
|
375
410
|
"""
|
376
411
|
Load current from assistant files
|
377
412
|
|
@@ -396,7 +431,11 @@ class Attachments:
|
|
396
431
|
item.send = True
|
397
432
|
self.add(mode, item)
|
398
433
|
|
399
|
-
def from_attachments(
|
434
|
+
def from_attachments(
|
435
|
+
self,
|
436
|
+
mode: str,
|
437
|
+
attachments: Dict[str, AttachmentItem]
|
438
|
+
):
|
400
439
|
"""
|
401
440
|
Load current from attachments
|
402
441
|
|