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.
Files changed (258) hide show
  1. CHANGELOG.md +38 -1
  2. README.md +71 -114
  3. pygpt_net/CHANGELOG.txt +38 -1
  4. pygpt_net/__init__.py +3 -3
  5. pygpt_net/controller/__init__.py +7 -3
  6. pygpt_net/controller/access/control.py +1 -1
  7. pygpt_net/controller/access/voice.py +11 -5
  8. pygpt_net/controller/agent/experts.py +11 -6
  9. pygpt_net/controller/agent/legacy.py +8 -6
  10. pygpt_net/controller/agent/llama.py +4 -2
  11. pygpt_net/controller/assistant/__init__.py +9 -4
  12. pygpt_net/controller/assistant/batch.py +38 -21
  13. pygpt_net/controller/assistant/editor.py +7 -6
  14. pygpt_net/controller/assistant/files.py +23 -7
  15. pygpt_net/controller/assistant/store.py +20 -7
  16. pygpt_net/controller/assistant/threads.py +34 -8
  17. pygpt_net/controller/attachment.py +29 -10
  18. pygpt_net/controller/audio/__init__.py +25 -4
  19. pygpt_net/controller/calendar/__init__.py +23 -4
  20. pygpt_net/controller/calendar/note.py +57 -11
  21. pygpt_net/controller/camera.py +3 -2
  22. pygpt_net/controller/chat/__init__.py +5 -3
  23. pygpt_net/controller/chat/attachment.py +39 -44
  24. pygpt_net/controller/chat/command.py +4 -2
  25. pygpt_net/controller/chat/common.py +11 -4
  26. pygpt_net/controller/chat/files.py +10 -3
  27. pygpt_net/controller/chat/image.py +17 -5
  28. pygpt_net/controller/chat/input.py +10 -7
  29. pygpt_net/controller/chat/output.py +21 -6
  30. pygpt_net/controller/chat/render.py +100 -21
  31. pygpt_net/controller/chat/response.py +34 -7
  32. pygpt_net/controller/chat/stream.py +4 -2
  33. pygpt_net/controller/chat/text.py +6 -4
  34. pygpt_net/controller/command.py +11 -3
  35. pygpt_net/controller/config/__init__.py +34 -6
  36. pygpt_net/controller/config/field/checkbox.py +7 -4
  37. pygpt_net/controller/config/field/cmd.py +7 -5
  38. pygpt_net/controller/config/field/combo.py +14 -6
  39. pygpt_net/controller/config/field/dictionary.py +14 -11
  40. pygpt_net/controller/config/field/input.py +9 -6
  41. pygpt_net/controller/config/field/slider.py +11 -8
  42. pygpt_net/controller/config/field/textarea.py +8 -5
  43. pygpt_net/controller/config/placeholder.py +52 -21
  44. pygpt_net/controller/ctx/__init__.py +138 -49
  45. pygpt_net/controller/ctx/common.py +15 -4
  46. pygpt_net/controller/ctx/extra.py +11 -3
  47. pygpt_net/controller/ctx/summarizer.py +24 -5
  48. pygpt_net/controller/debug/__init__.py +27 -6
  49. pygpt_net/controller/dialogs/confirm.py +34 -7
  50. pygpt_net/controller/dialogs/debug.py +4 -2
  51. pygpt_net/controller/dialogs/info.py +7 -2
  52. pygpt_net/controller/files.py +48 -10
  53. pygpt_net/controller/finder.py +11 -5
  54. pygpt_net/controller/idx/__init__.py +10 -3
  55. pygpt_net/controller/idx/common.py +4 -2
  56. pygpt_net/controller/idx/indexer.py +25 -17
  57. pygpt_net/controller/idx/settings.py +9 -3
  58. pygpt_net/controller/kernel/__init__.py +34 -8
  59. pygpt_net/controller/kernel/reply.py +12 -3
  60. pygpt_net/controller/kernel/stack.py +5 -3
  61. pygpt_net/controller/lang/custom.py +2 -7
  62. pygpt_net/controller/lang/mapping.py +5 -3
  63. pygpt_net/controller/layout.py +2 -2
  64. pygpt_net/controller/mode.py +16 -4
  65. pygpt_net/controller/model/__init__.py +14 -3
  66. pygpt_net/controller/model/editor.py +8 -3
  67. pygpt_net/controller/notepad.py +26 -12
  68. pygpt_net/controller/painter/capture.py +23 -4
  69. pygpt_net/controller/painter/common.py +9 -7
  70. pygpt_net/controller/plugins/__init__.py +19 -5
  71. pygpt_net/controller/plugins/presets.py +15 -6
  72. pygpt_net/controller/plugins/settings.py +9 -3
  73. pygpt_net/controller/presets/__init__.py +55 -16
  74. pygpt_net/controller/presets/editor.py +26 -10
  75. pygpt_net/controller/settings/__init__.py +3 -2
  76. pygpt_net/controller/settings/editor.py +29 -7
  77. pygpt_net/controller/settings/profile.py +22 -5
  78. pygpt_net/controller/theme/__init__.py +54 -12
  79. pygpt_net/controller/theme/common.py +24 -2
  80. pygpt_net/controller/theme/markdown.py +32 -16
  81. pygpt_net/controller/theme/menu.py +26 -5
  82. pygpt_net/controller/theme/nodes.py +2 -5
  83. pygpt_net/controller/tools/__init__.py +40 -2
  84. pygpt_net/controller/ui/__init__.py +4 -6
  85. pygpt_net/controller/ui/tabs.py +363 -65
  86. pygpt_net/core/access/actions.py +6 -4
  87. pygpt_net/core/access/shortcuts.py +4 -3
  88. pygpt_net/core/access/voice.py +6 -5
  89. pygpt_net/core/agents/legacy.py +4 -2
  90. pygpt_net/core/agents/memory.py +7 -2
  91. pygpt_net/core/agents/observer/evaluation.py +15 -7
  92. pygpt_net/core/agents/provider.py +9 -4
  93. pygpt_net/core/agents/runner.py +61 -15
  94. pygpt_net/core/agents/tools.py +23 -5
  95. pygpt_net/core/assistants/__init__.py +6 -4
  96. pygpt_net/core/assistants/files.py +35 -12
  97. pygpt_net/core/assistants/store.py +20 -10
  98. pygpt_net/core/attachments/__init__.py +54 -15
  99. pygpt_net/core/attachments/context.py +217 -64
  100. pygpt_net/core/audio/__init__.py +71 -3
  101. pygpt_net/core/audio/context.py +7 -2
  102. pygpt_net/core/bridge/__init__.py +22 -6
  103. pygpt_net/core/bridge/context.py +5 -3
  104. pygpt_net/core/bridge/worker.py +16 -2
  105. pygpt_net/core/calendar/__init__.py +57 -11
  106. pygpt_net/core/chain/__init__.py +8 -2
  107. pygpt_net/core/chain/chat.py +10 -8
  108. pygpt_net/core/chain/completion.py +10 -7
  109. pygpt_net/core/command.py +62 -17
  110. pygpt_net/core/ctx/__init__.py +260 -58
  111. pygpt_net/core/ctx/bag.py +25 -4
  112. pygpt_net/core/ctx/container.py +28 -17
  113. pygpt_net/core/ctx/idx.py +45 -8
  114. pygpt_net/core/ctx/output.py +95 -74
  115. pygpt_net/core/ctx/reply.py +5 -2
  116. pygpt_net/core/db/__init__.py +8 -7
  117. pygpt_net/core/db/viewer.py +17 -11
  118. pygpt_net/core/debug/__init__.py +10 -9
  119. pygpt_net/core/debug/tabs.py +5 -2
  120. pygpt_net/core/docker/__init__.py +11 -5
  121. pygpt_net/core/docker/builder.py +11 -3
  122. pygpt_net/core/events/app.py +5 -3
  123. pygpt_net/core/events/base.py +11 -5
  124. pygpt_net/core/events/control.py +5 -3
  125. pygpt_net/core/events/event.py +18 -7
  126. pygpt_net/core/events/kernel.py +5 -3
  127. pygpt_net/core/events/render.py +5 -3
  128. pygpt_net/core/experts/__init__.py +5 -4
  129. pygpt_net/core/filesystem/__init__.py +52 -34
  130. pygpt_net/core/filesystem/actions.py +8 -5
  131. pygpt_net/core/filesystem/editor.py +13 -3
  132. pygpt_net/core/filesystem/types.py +12 -7
  133. pygpt_net/core/filesystem/url.py +7 -3
  134. pygpt_net/core/idx/__init__.py +34 -25
  135. pygpt_net/core/idx/chat.py +60 -38
  136. pygpt_net/core/idx/context.py +6 -2
  137. pygpt_net/core/idx/indexing.py +84 -35
  138. pygpt_net/core/idx/llm.py +11 -3
  139. pygpt_net/core/idx/metadata.py +13 -3
  140. pygpt_net/core/idx/types/ctx.py +32 -6
  141. pygpt_net/core/idx/types/external.py +41 -7
  142. pygpt_net/core/idx/types/files.py +31 -6
  143. pygpt_net/core/image.py +15 -4
  144. pygpt_net/core/llm/__init__.py +13 -3
  145. pygpt_net/core/locale.py +34 -8
  146. pygpt_net/core/models.py +4 -3
  147. pygpt_net/core/notepad.py +9 -4
  148. pygpt_net/core/plugins.py +7 -6
  149. pygpt_net/core/presets.py +19 -10
  150. pygpt_net/core/profile.py +12 -6
  151. pygpt_net/core/prompt/__init__.py +10 -3
  152. pygpt_net/core/prompt/custom.py +7 -6
  153. pygpt_net/core/prompt/template.py +9 -3
  154. pygpt_net/core/render/base.py +117 -22
  155. pygpt_net/core/render/markdown/body.py +27 -7
  156. pygpt_net/core/render/markdown/renderer.py +119 -22
  157. pygpt_net/core/render/plain/body.py +22 -5
  158. pygpt_net/core/render/plain/renderer.py +97 -21
  159. pygpt_net/core/render/web/body.py +75 -25
  160. pygpt_net/core/render/web/renderer.py +313 -63
  161. pygpt_net/core/settings.py +9 -4
  162. pygpt_net/core/tabs/__init__.py +290 -103
  163. pygpt_net/core/tabs/tab.py +17 -4
  164. pygpt_net/core/tokens.py +44 -11
  165. pygpt_net/core/updater/__init__.py +20 -7
  166. pygpt_net/core/vision/analyzer.py +29 -6
  167. pygpt_net/core/web.py +130 -2
  168. pygpt_net/data/config/config.json +19 -6
  169. pygpt_net/data/config/models.json +3 -3
  170. pygpt_net/data/config/modes.json +3 -3
  171. pygpt_net/data/config/settings.json +81 -10
  172. pygpt_net/data/config/settings_section.json +3 -0
  173. pygpt_net/data/css/style.light.css +1 -0
  174. pygpt_net/data/css/{web.css → web-blocks.css} +162 -133
  175. pygpt_net/data/css/{web.light.css → web-blocks.light.css} +7 -0
  176. pygpt_net/data/css/web-chatgpt.css +350 -0
  177. pygpt_net/data/css/web-chatgpt.dark.css +64 -0
  178. pygpt_net/data/css/web-chatgpt.light.css +75 -0
  179. pygpt_net/data/css/web-chatgpt_wide.css +350 -0
  180. pygpt_net/data/css/web-chatgpt_wide.dark.css +64 -0
  181. pygpt_net/data/css/web-chatgpt_wide.light.css +75 -0
  182. pygpt_net/data/icons/split_screen.svg +1 -0
  183. pygpt_net/data/locale/locale.de.ini +19 -3
  184. pygpt_net/data/locale/locale.en.ini +30 -11
  185. pygpt_net/data/locale/locale.es.ini +19 -3
  186. pygpt_net/data/locale/locale.fr.ini +19 -3
  187. pygpt_net/data/locale/locale.it.ini +19 -3
  188. pygpt_net/data/locale/locale.pl.ini +20 -4
  189. pygpt_net/data/locale/locale.uk.ini +19 -3
  190. pygpt_net/data/locale/locale.zh.ini +20 -4
  191. pygpt_net/data/locale/plugin.cmd_web.de.ini +2 -0
  192. pygpt_net/data/locale/plugin.cmd_web.en.ini +20 -10
  193. pygpt_net/data/locale/plugin.cmd_web.es.ini +2 -0
  194. pygpt_net/data/locale/plugin.cmd_web.fr.ini +2 -0
  195. pygpt_net/data/locale/plugin.cmd_web.it.ini +2 -0
  196. pygpt_net/data/locale/plugin.cmd_web.pl.ini +2 -0
  197. pygpt_net/data/locale/plugin.cmd_web.uk.ini +2 -0
  198. pygpt_net/data/locale/plugin.cmd_web.zh.ini +2 -0
  199. pygpt_net/icons.qrc +1 -0
  200. pygpt_net/icons_rc.py +165 -136
  201. pygpt_net/item/ctx.py +46 -24
  202. pygpt_net/plugin/audio_input/simple.py +21 -5
  203. pygpt_net/plugin/audio_output/__init__.py +4 -1
  204. pygpt_net/plugin/base/config.py +4 -2
  205. pygpt_net/plugin/base/plugin.py +26 -6
  206. pygpt_net/plugin/base/worker.py +37 -9
  207. pygpt_net/plugin/cmd_code_interpreter/__init__.py +39 -37
  208. pygpt_net/plugin/cmd_code_interpreter/runner.py +25 -12
  209. pygpt_net/plugin/cmd_web/__init__.py +46 -6
  210. pygpt_net/plugin/cmd_web/config.py +74 -48
  211. pygpt_net/plugin/cmd_web/websearch.py +61 -28
  212. pygpt_net/plugin/cmd_web/worker.py +79 -13
  213. pygpt_net/plugin/idx_llama_index/__init__.py +2 -2
  214. pygpt_net/plugin/real_time/__init__.py +2 -2
  215. pygpt_net/provider/core/config/patch.py +54 -1
  216. pygpt_net/provider/core/ctx/base.py +4 -1
  217. pygpt_net/provider/core/ctx/db_sqlite/__init__.py +10 -1
  218. pygpt_net/provider/core/ctx/db_sqlite/storage.py +22 -1
  219. pygpt_net/provider/gpt/assistants.py +10 -9
  220. pygpt_net/provider/gpt/audio.py +3 -2
  221. pygpt_net/provider/gpt/chat.py +8 -7
  222. pygpt_net/provider/gpt/completion.py +6 -4
  223. pygpt_net/provider/gpt/image.py +9 -2
  224. pygpt_net/provider/gpt/store.py +14 -13
  225. pygpt_net/provider/gpt/vision.py +6 -5
  226. pygpt_net/tools/__init__.py +9 -1
  227. pygpt_net/tools/base.py +15 -1
  228. pygpt_net/tools/code_interpreter/__init__.py +174 -75
  229. pygpt_net/tools/code_interpreter/ui/dialogs.py +21 -103
  230. pygpt_net/tools/code_interpreter/ui/widgets.py +284 -9
  231. pygpt_net/tools/html_canvas/__init__.py +78 -23
  232. pygpt_net/tools/html_canvas/ui/dialogs.py +46 -62
  233. pygpt_net/tools/html_canvas/ui/widgets.py +96 -3
  234. pygpt_net/ui/base/context_menu.py +2 -2
  235. pygpt_net/ui/layout/chat/input.py +10 -18
  236. pygpt_net/ui/layout/chat/output.py +26 -44
  237. pygpt_net/ui/layout/ctx/ctx_list.py +13 -4
  238. pygpt_net/ui/layout/toolbox/footer.py +18 -2
  239. pygpt_net/ui/main.py +2 -2
  240. pygpt_net/ui/menu/config.py +7 -11
  241. pygpt_net/ui/menu/debug.py +11 -1
  242. pygpt_net/ui/menu/theme.py +9 -2
  243. pygpt_net/ui/widget/filesystem/explorer.py +2 -2
  244. pygpt_net/ui/widget/lists/context.py +27 -5
  245. pygpt_net/ui/widget/tabs/Input.py +2 -2
  246. pygpt_net/ui/widget/tabs/body.py +2 -1
  247. pygpt_net/ui/widget/tabs/layout.py +195 -0
  248. pygpt_net/ui/widget/tabs/output.py +218 -55
  249. pygpt_net/ui/widget/textarea/html.py +11 -1
  250. pygpt_net/ui/widget/textarea/output.py +10 -1
  251. pygpt_net/ui/widget/textarea/search_input.py +4 -1
  252. pygpt_net/ui/widget/textarea/web.py +49 -9
  253. {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/METADATA +72 -115
  254. {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/RECORD +258 -250
  255. /pygpt_net/data/css/{web.dark.css → web-blocks.dark.css} +0 -0
  256. {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/LICENSE +0 -0
  257. {pygpt_net-2.4.36.post1.dist-info → pygpt_net-2.4.41.dist-info}/WHEEL +0 -0
  258. {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.04.30 04:00:00 #
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) -> list:
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) -> dict:
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 or None:
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 or None:
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) -> dict:
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(self, store: AssistantStoreItem, status: dict):
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) -> dict:
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: dict):
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
- """Get config version"""
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.11.26 02:00:00 #
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 or None:
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 or None:
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 or None:
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(self, mode: str, only_files: bool = True) -> dict:
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(self, mode: str, meta: CtxMeta) -> list:
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(self, mode: str, item: AttachmentItem):
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(self, mode: str, id: str, remove_local: bool = False):
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(self, mode: str, remove_local: bool = False, auto: bool = False, force: bool = False):
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(self, mode: str, remove_local: bool = False):
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(self, attachments: dict) -> dict:
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(self, mode: str, files: dict):
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(self, mode: str, attachments: dict):
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