pygpt-net 2.7.4__py3-none-any.whl → 2.7.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 +15 -0
- pygpt_net/__init__.py +4 -4
- pygpt_net/app_core.py +4 -2
- pygpt_net/controller/__init__.py +5 -1
- pygpt_net/controller/assistant/assistant.py +1 -4
- pygpt_net/controller/assistant/batch.py +5 -504
- pygpt_net/controller/assistant/editor.py +5 -5
- pygpt_net/controller/assistant/files.py +16 -16
- pygpt_net/controller/chat/handler/google_stream.py +307 -1
- pygpt_net/controller/chat/handler/worker.py +10 -25
- pygpt_net/controller/chat/handler/xai_stream.py +621 -52
- pygpt_net/controller/chat/image.py +2 -2
- pygpt_net/controller/debug/fixtures.py +3 -2
- pygpt_net/controller/dialogs/confirm.py +73 -101
- pygpt_net/controller/files/files.py +65 -4
- pygpt_net/controller/lang/mapping.py +9 -9
- pygpt_net/controller/painter/capture.py +50 -1
- pygpt_net/controller/presets/presets.py +2 -1
- pygpt_net/controller/remote_store/__init__.py +12 -0
- pygpt_net/{provider/core/assistant_file/db_sqlite → controller/remote_store/google}/__init__.py +2 -2
- pygpt_net/controller/remote_store/google/batch.py +402 -0
- pygpt_net/controller/remote_store/google/store.py +615 -0
- pygpt_net/controller/remote_store/openai/__init__.py +12 -0
- pygpt_net/controller/remote_store/openai/batch.py +524 -0
- pygpt_net/controller/{assistant → remote_store/openai}/store.py +63 -60
- pygpt_net/controller/remote_store/remote_store.py +35 -0
- pygpt_net/controller/ui/ui.py +20 -1
- pygpt_net/core/assistants/assistants.py +3 -15
- pygpt_net/core/db/database.py +5 -3
- pygpt_net/core/filesystem/url.py +4 -1
- pygpt_net/core/locale/placeholder.py +35 -0
- pygpt_net/core/remote_store/__init__.py +12 -0
- pygpt_net/core/remote_store/google/__init__.py +11 -0
- pygpt_net/core/remote_store/google/files.py +224 -0
- pygpt_net/core/remote_store/google/store.py +248 -0
- pygpt_net/core/remote_store/openai/__init__.py +11 -0
- pygpt_net/core/{assistants → remote_store/openai}/files.py +26 -19
- pygpt_net/core/{assistants → remote_store/openai}/store.py +32 -15
- pygpt_net/core/remote_store/remote_store.py +24 -0
- pygpt_net/core/render/web/body.py +3 -2
- pygpt_net/core/types/chunk.py +27 -0
- pygpt_net/data/config/config.json +8 -4
- pygpt_net/data/config/models.json +77 -3
- pygpt_net/data/config/settings.json +45 -0
- pygpt_net/data/js/app/template.js +1 -1
- pygpt_net/data/js/app.min.js +2 -2
- pygpt_net/data/locale/locale.de.ini +44 -41
- pygpt_net/data/locale/locale.en.ini +56 -43
- pygpt_net/data/locale/locale.es.ini +44 -41
- pygpt_net/data/locale/locale.fr.ini +44 -41
- pygpt_net/data/locale/locale.it.ini +44 -41
- pygpt_net/data/locale/locale.pl.ini +45 -42
- pygpt_net/data/locale/locale.uk.ini +44 -41
- pygpt_net/data/locale/locale.zh.ini +44 -41
- pygpt_net/data/locale/plugin.cmd_history.de.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.en.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.es.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.fr.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.it.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.pl.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.uk.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.zh.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_mouse_control.en.ini +14 -0
- pygpt_net/data/locale/plugin.cmd_web.de.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.en.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.es.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.fr.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.it.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.pl.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.uk.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.zh.ini +1 -1
- pygpt_net/data/locale/plugin.idx_llama_index.de.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.en.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.es.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.fr.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.it.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.pl.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.uk.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.zh.ini +2 -2
- pygpt_net/item/assistant.py +1 -211
- pygpt_net/item/ctx.py +3 -3
- pygpt_net/item/store.py +238 -0
- pygpt_net/js_rc.py +2449 -2447
- pygpt_net/migrations/Version20260102190000.py +35 -0
- pygpt_net/migrations/__init__.py +3 -1
- pygpt_net/plugin/cmd_mouse_control/config.py +471 -1
- pygpt_net/plugin/cmd_mouse_control/plugin.py +487 -22
- pygpt_net/plugin/cmd_mouse_control/worker.py +464 -87
- pygpt_net/plugin/cmd_mouse_control/worker_sandbox.py +729 -0
- pygpt_net/plugin/idx_llama_index/config.py +2 -2
- pygpt_net/provider/api/anthropic/__init__.py +10 -8
- pygpt_net/provider/api/google/__init__.py +21 -58
- pygpt_net/provider/api/google/chat.py +545 -129
- pygpt_net/provider/api/google/computer.py +190 -0
- pygpt_net/provider/api/google/realtime/realtime.py +2 -2
- pygpt_net/provider/api/google/remote_tools.py +93 -0
- pygpt_net/provider/api/google/store.py +546 -0
- pygpt_net/provider/api/google/worker/__init__.py +0 -0
- pygpt_net/provider/api/google/worker/importer.py +392 -0
- pygpt_net/provider/api/openai/__init__.py +7 -3
- pygpt_net/provider/api/openai/computer.py +10 -1
- pygpt_net/provider/api/openai/responses.py +0 -0
- pygpt_net/provider/api/openai/store.py +6 -6
- pygpt_net/provider/api/openai/worker/importer.py +24 -24
- pygpt_net/provider/api/x_ai/__init__.py +10 -9
- pygpt_net/provider/api/x_ai/chat.py +272 -102
- pygpt_net/provider/core/config/patch.py +16 -1
- pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +3 -3
- pygpt_net/provider/core/model/patch.py +17 -3
- pygpt_net/provider/core/preset/json_file.py +13 -7
- pygpt_net/provider/core/{assistant_file → remote_file}/__init__.py +1 -1
- pygpt_net/provider/core/{assistant_file → remote_file}/base.py +9 -9
- pygpt_net/provider/core/remote_file/db_sqlite/__init__.py +12 -0
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/patch.py +1 -1
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/provider.py +23 -20
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/storage.py +35 -27
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/utils.py +5 -4
- pygpt_net/provider/core/{assistant_store → remote_store}/__init__.py +1 -1
- pygpt_net/provider/core/{assistant_store → remote_store}/base.py +10 -10
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/__init__.py +1 -1
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/patch.py +1 -1
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/provider.py +16 -15
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/storage.py +30 -23
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/utils.py +5 -4
- pygpt_net/provider/core/{assistant_store → remote_store}/json_file.py +9 -9
- pygpt_net/provider/llms/google.py +2 -2
- pygpt_net/tools/image_viewer/ui/dialogs.py +298 -12
- pygpt_net/tools/text_editor/ui/widgets.py +5 -1
- pygpt_net/ui/base/config_dialog.py +3 -2
- pygpt_net/ui/base/context_menu.py +44 -1
- pygpt_net/ui/dialog/assistant.py +3 -3
- pygpt_net/ui/dialog/plugins.py +3 -1
- pygpt_net/ui/dialog/remote_store_google.py +539 -0
- pygpt_net/ui/dialog/{assistant_store.py → remote_store_openai.py} +95 -95
- pygpt_net/ui/dialogs.py +5 -3
- pygpt_net/ui/layout/chat/attachments_uploaded.py +3 -3
- pygpt_net/ui/layout/toolbox/computer_env.py +26 -8
- pygpt_net/ui/layout/toolbox/indexes.py +22 -19
- pygpt_net/ui/layout/toolbox/model.py +28 -5
- pygpt_net/ui/menu/tools.py +13 -5
- pygpt_net/ui/widget/dialog/remote_store_google.py +56 -0
- pygpt_net/ui/widget/dialog/{assistant_store.py → remote_store_openai.py} +9 -9
- pygpt_net/ui/widget/element/button.py +4 -4
- pygpt_net/ui/widget/image/display.py +25 -8
- pygpt_net/ui/widget/lists/remote_store_google.py +248 -0
- pygpt_net/ui/widget/lists/{assistant_store.py → remote_store_openai.py} +21 -21
- pygpt_net/ui/widget/option/checkbox_list.py +47 -9
- pygpt_net/ui/widget/option/combo.py +39 -3
- pygpt_net/ui/widget/tabs/output.py +9 -1
- pygpt_net/ui/widget/textarea/editor.py +14 -1
- pygpt_net/ui/widget/textarea/input.py +20 -7
- pygpt_net/ui/widget/textarea/notepad.py +24 -1
- pygpt_net/ui/widget/textarea/output.py +23 -1
- pygpt_net/ui/widget/textarea/web.py +16 -1
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/METADATA +41 -2
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/RECORD +158 -132
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/LICENSE +0 -0
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/WHEEL +0 -0
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/entry_points.txt +0 -0
|
@@ -7,9 +7,9 @@ idx.description = Indexes to use when querying for additional context. You can u
|
|
|
7
7
|
idx.label = Indexes to use
|
|
8
8
|
max_question_chars.description = Maximum characters in a question when querying LlamaIndex, 0 = no limit.
|
|
9
9
|
max_question_chars.label = Maximum characters in question
|
|
10
|
-
model_prepare_question.description = Model used to prepare a question before asking LlamaIndex, default:
|
|
10
|
+
model_prepare_question.description = Model used to prepare a question before asking LlamaIndex, default: %MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = Model for question preparation
|
|
12
|
-
model_query.description = Model used for querying LlamaIndex, default:
|
|
12
|
+
model_query.description = Model used for querying LlamaIndex, default: %MODEL_DEFAULT_MINI%.
|
|
13
13
|
model_query.label = Model
|
|
14
14
|
plugin.description = Integrates LlamaIndex (Chat with files) storage in any chat and provides additional knowledge into context (from files and from context history in the database)
|
|
15
15
|
plugin.name = Chat with files (LlamaIndex, inline)
|
|
@@ -7,9 +7,9 @@ idx.description = Índices a utilizar al consultar contexto adicional. Puedes us
|
|
|
7
7
|
idx.label = Índices a utilizar
|
|
8
8
|
max_question_chars.description = Máximo de caracteres en una pregunta al consultar LlamaIndex, 0 = sin límite.
|
|
9
9
|
max_question_chars.label = Máximo de caracteres en pregunta
|
|
10
|
-
model_prepare_question.description = Modelo utilizado para preparar una pregunta antes de consultar LlamaIndex, por defecto:
|
|
10
|
+
model_prepare_question.description = Modelo utilizado para preparar una pregunta antes de consultar LlamaIndex, por defecto: %MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = Modelo para la preparación de la pregunta
|
|
12
|
-
model_query.description = Modelo utilizado para consultar LlamaIndex, por defecto:
|
|
12
|
+
model_query.description = Modelo utilizado para consultar LlamaIndex, por defecto: %MODEL_DEFAULT_MINI%.
|
|
13
13
|
model_query.label = Modelo
|
|
14
14
|
plugin.description = Integra el almacenamiento de LlamaIndex (Chat con archivos) en cualquier chat y proporciona conocimiento adicional al contexto (de archivos y del historial de contexto en la base de datos)
|
|
15
15
|
plugin.name = Chat con archivos (LlamaIndex, en línea)
|
|
@@ -7,9 +7,9 @@ idx.description = Index à utiliser lors de la recherche de contexte supplément
|
|
|
7
7
|
idx.label = Index à utiliser
|
|
8
8
|
max_question_chars.description = Nombre maximum de caractères dans une question lors de l'interrogation de LlamaIndex, 0 = pas de limite.
|
|
9
9
|
max_question_chars.label = Nombre max de caractères dans une question
|
|
10
|
-
model_prepare_question.description = Modèle utilisé pour préparer une question avant de demander à LlamaIndex, par défaut :
|
|
10
|
+
model_prepare_question.description = Modèle utilisé pour préparer une question avant de demander à LlamaIndex, par défaut : %MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = Modèle pour la préparation des questions
|
|
12
|
-
model_query.description = Modèle utilisé pour interroger LlamaIndex, par défaut :
|
|
12
|
+
model_query.description = Modèle utilisé pour interroger LlamaIndex, par défaut : %MODEL_DEFAULT_MINI%.
|
|
13
13
|
model_query.label = Modèle
|
|
14
14
|
plugin.description = Intègre le stockage LlamaIndex (Chat avec fichiers) dans n'importe quel chat et fournit des connaissances supplémentaires dans le contexte (à partir de fichiers et de l'historique du contexte dans la base de données)
|
|
15
15
|
plugin.name = Chat avec fichiers (LlamaIndex, inline)
|
|
@@ -7,9 +7,9 @@ idx.description = Indici da utilizzare quando si interroga per ulteriore contest
|
|
|
7
7
|
idx.label = Indici da utilizzare
|
|
8
8
|
max_question_chars.description = Massimo numero di caratteri in una domanda quando si interroga LlamaIndex, 0 = nessun limite.
|
|
9
9
|
max_question_chars.label = Massimo di caratteri nella domanda
|
|
10
|
-
model_prepare_question.description = Modello usato per preparare una domanda prima di interrogare LlamaIndex, predefinito:
|
|
10
|
+
model_prepare_question.description = Modello usato per preparare una domanda prima di interrogare LlamaIndex, predefinito: %MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = Modello per la preparazione della domanda
|
|
12
|
-
model_query.description = Modello usato per interrogare LlamaIndex, predefinito:
|
|
12
|
+
model_query.description = Modello usato per interrogare LlamaIndex, predefinito: %MODEL_DEFAULT_MINI%.
|
|
13
13
|
model_query.label = Modello
|
|
14
14
|
plugin.description = Integra lo storage LlamaIndex (Chat con file) in qualsiasi chat e fornisce conoscenze aggiuntive nel contesto (da file e dalla cronologia del contesto nel database)
|
|
15
15
|
plugin.name = Chat con file (LlamaIndex, inline)
|
|
@@ -7,9 +7,9 @@ idx.description = Indeksy do użycia podczas wyszukiwania dodatkowego kontekstu.
|
|
|
7
7
|
idx.label = Używane indeksy
|
|
8
8
|
max_question_chars.description = Maksymalna liczba znaków w pytaniu podczas zapytania do LlamaIndex, 0 = bez limitu.
|
|
9
9
|
max_question_chars.label = Maksymalna liczba znaków w pytaniu
|
|
10
|
-
model_prepare_question.description = Model używany do przygotowania pytania przed zapytaniem LlamaIndex, domyślnie:
|
|
10
|
+
model_prepare_question.description = Model używany do przygotowania pytania przed zapytaniem LlamaIndex, domyślnie: %MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = Model do przygotowywania pytania
|
|
12
|
-
model_query.description = Model używany do zapytania LlamaIndex, domyślnie:
|
|
12
|
+
model_query.description = Model używany do zapytania LlamaIndex, domyślnie: %MODEL_DEFAULT_MINI%.
|
|
13
13
|
model_query.label = Model
|
|
14
14
|
plugin.description = Integruje przechowywanie LlamaIndex (Chat z plikami) w dowolnym czacie i dostarcza dodatkową wiedzę do kontekstu (z plików i z historii kontekstu w bazie danych)
|
|
15
15
|
plugin.name = Chat z plikami (LlamaIndex, inline)
|
|
@@ -7,9 +7,9 @@ idx.description = Індекси, які слід використовувати
|
|
|
7
7
|
idx.label = Індекси для використання
|
|
8
8
|
max_question_chars.description = Максимальна кількість символів у запитанні при зверненні до LlamaIndex, 0 = без обмеження.
|
|
9
9
|
max_question_chars.label = Максимум символів у запитанні
|
|
10
|
-
model_prepare_question.description = Модель, що використовується для підготовки запитань перед зверненням до LlamaIndex, за замовчуванням:
|
|
10
|
+
model_prepare_question.description = Модель, що використовується для підготовки запитань перед зверненням до LlamaIndex, за замовчуванням: %MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = Модель для підготовки запитань
|
|
12
|
-
model_query.description = Модель, що використовується для запиту у LlamaIndex, за замовчуванням:
|
|
12
|
+
model_query.description = Модель, що використовується для запиту у LlamaIndex, за замовчуванням: %MODEL_DEFAULT_MINI%.
|
|
13
13
|
model_query.label = Модель
|
|
14
14
|
plugin.description = Інтегрує зберігання даних LlamaIndex (Чат з файлами) в будь-який чат і надає додаткові знання для контексту (з файлів та з історії контексту в базі даних)
|
|
15
15
|
plugin.name = Чат з файлами (LlamaIndex, вбудований)
|
|
@@ -7,9 +7,9 @@ idx.description = 查询附加上下文时要使用的索引。您可以同时
|
|
|
7
7
|
idx.label = 要使用的索引
|
|
8
8
|
max_question_chars.description = 查询LlamaIndex时问题中的最大字符数,0 = 无限制。
|
|
9
9
|
max_question_chars.label = 问题中的最大字符数
|
|
10
|
-
model_prepare_question.description = 用于在询问LlamaIndex
|
|
10
|
+
model_prepare_question.description = 用于在询问LlamaIndex之前准备问题的模型,默认为:%MODEL_DEFAULT_MINI%
|
|
11
11
|
model_prepare_question.label = 准备问题的模型
|
|
12
|
-
model_query.description = 用于查询LlamaIndex
|
|
12
|
+
model_query.description = 用于查询LlamaIndex的模型,默认为:%MODEL_DEFAULT_MINI%。
|
|
13
13
|
model_query.label = 模型
|
|
14
14
|
plugin.description = 将LlamaIndex(文件聊天)存储集成到任何聊天中,并提供来自文件和数据库中上下文历史的额外上下文知识
|
|
15
15
|
plugin.name = 文件聊天(LlamaIndex,内联)
|
pygpt_net/item/assistant.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:
|
|
9
|
+
# Updated Date: 2026.01.02 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import json
|
|
@@ -219,213 +219,3 @@ class AssistantItem:
|
|
|
219
219
|
"""To string"""
|
|
220
220
|
return self.dump()
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
@dataclass(slots=True)
|
|
224
|
-
class AssistantStoreItem:
|
|
225
|
-
id: Optional[object] = None
|
|
226
|
-
record_id: Optional[object] = None
|
|
227
|
-
uuid: Optional[object] = None
|
|
228
|
-
name: Optional[object] = None
|
|
229
|
-
description: Optional[object] = None
|
|
230
|
-
status: dict = field(default_factory=dict)
|
|
231
|
-
last_status: str = ""
|
|
232
|
-
expire_days: int = 0
|
|
233
|
-
usage_bytes: int = 0
|
|
234
|
-
bytes: int = 0
|
|
235
|
-
num_files: int = 0
|
|
236
|
-
is_thread: bool = False
|
|
237
|
-
created: int = 0
|
|
238
|
-
updated: int = 0
|
|
239
|
-
last_active: int = 0
|
|
240
|
-
last_sync: int = 0
|
|
241
|
-
file_ids: list = field(default_factory=list)
|
|
242
|
-
|
|
243
|
-
def __init__(self):
|
|
244
|
-
"""Assistant vector store item"""
|
|
245
|
-
self.id = None
|
|
246
|
-
self.record_id = None
|
|
247
|
-
self.uuid = None
|
|
248
|
-
self.name = None
|
|
249
|
-
self.description = None
|
|
250
|
-
self.status = {}
|
|
251
|
-
self.last_status = ""
|
|
252
|
-
self.expire_days = 0
|
|
253
|
-
self.usage_bytes = 0
|
|
254
|
-
self.bytes = 0
|
|
255
|
-
self.num_files = 0
|
|
256
|
-
self.is_thread = False
|
|
257
|
-
self.created = int(time.time())
|
|
258
|
-
self.updated = int(time.time())
|
|
259
|
-
self.last_active = int(time.time())
|
|
260
|
-
self.last_sync = int(time.time())
|
|
261
|
-
|
|
262
|
-
def reset(self):
|
|
263
|
-
"""Reset store"""
|
|
264
|
-
self.id = None
|
|
265
|
-
self.record_id = None
|
|
266
|
-
self.uuid = None
|
|
267
|
-
self.name = None
|
|
268
|
-
self.description = None
|
|
269
|
-
self.status = {}
|
|
270
|
-
self.last_status = ""
|
|
271
|
-
self.expire_days = 0
|
|
272
|
-
self.usage_bytes = 0
|
|
273
|
-
self.num_files = 0
|
|
274
|
-
self.bytes = 0
|
|
275
|
-
self.is_thread = False
|
|
276
|
-
self.last_active = int(time.time())
|
|
277
|
-
self.last_sync = int(time.time())
|
|
278
|
-
|
|
279
|
-
def to_dict(self) -> dict:
|
|
280
|
-
"""
|
|
281
|
-
Return as dictionary
|
|
282
|
-
|
|
283
|
-
:return: dictionary
|
|
284
|
-
"""
|
|
285
|
-
return {
|
|
286
|
-
"id": self.id,
|
|
287
|
-
"uuid": self.uuid,
|
|
288
|
-
"name": self.name,
|
|
289
|
-
"description": self.description,
|
|
290
|
-
"last_status": self.last_status,
|
|
291
|
-
"expire_days": self.expire_days,
|
|
292
|
-
"usage_bytes": self.usage_bytes,
|
|
293
|
-
"num_files": self.num_files,
|
|
294
|
-
"status": self.status,
|
|
295
|
-
"is_thread": self.is_thread,
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
def from_dict(self, data: dict):
|
|
299
|
-
"""
|
|
300
|
-
Load from dictionary
|
|
301
|
-
|
|
302
|
-
:param data: dictionary
|
|
303
|
-
"""
|
|
304
|
-
self.id = data.get('id', None)
|
|
305
|
-
self.name = data.get('name', None)
|
|
306
|
-
self.uuid = data.get('uuid', None)
|
|
307
|
-
self.expire_days = data.get('expire_days', 0)
|
|
308
|
-
self.status = data.get('status', {})
|
|
309
|
-
|
|
310
|
-
def get_file_count(self):
|
|
311
|
-
"""
|
|
312
|
-
Return number of files in store
|
|
313
|
-
|
|
314
|
-
:return: number of files
|
|
315
|
-
"""
|
|
316
|
-
num = self.num_files
|
|
317
|
-
if self.status and isinstance(self.status, dict) and 'file_counts' in self.status:
|
|
318
|
-
if 'completed' in self.status['file_counts']:
|
|
319
|
-
num = int(self.status['file_counts']['completed'] or 0)
|
|
320
|
-
return num
|
|
321
|
-
|
|
322
|
-
def dump(self) -> str:
|
|
323
|
-
"""
|
|
324
|
-
Dump item to string
|
|
325
|
-
|
|
326
|
-
:return: serialized item
|
|
327
|
-
"""
|
|
328
|
-
try:
|
|
329
|
-
return json.dumps(self.to_dict())
|
|
330
|
-
except Exception as e:
|
|
331
|
-
pass
|
|
332
|
-
return ""
|
|
333
|
-
|
|
334
|
-
def __str__(self):
|
|
335
|
-
"""To string"""
|
|
336
|
-
return self.dump()
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
@dataclass(slots=True)
|
|
340
|
-
class AssistantFileItem:
|
|
341
|
-
id: Optional[object] = None
|
|
342
|
-
record_id: Optional[object] = None
|
|
343
|
-
name: Optional[object] = None
|
|
344
|
-
path: Optional[object] = None
|
|
345
|
-
file_id: Optional[object] = None
|
|
346
|
-
store_id: Optional[object] = None
|
|
347
|
-
thread_id: Optional[object] = None
|
|
348
|
-
uuid: Optional[object] = None
|
|
349
|
-
size: int = 0
|
|
350
|
-
created: int = 0
|
|
351
|
-
updated: int = 0
|
|
352
|
-
|
|
353
|
-
def __init__(self):
|
|
354
|
-
"""Assistant file item"""
|
|
355
|
-
self.id = None
|
|
356
|
-
self.record_id = None
|
|
357
|
-
self.name = None
|
|
358
|
-
self.path = None
|
|
359
|
-
self.file_id = None
|
|
360
|
-
self.store_id = None
|
|
361
|
-
self.thread_id = None
|
|
362
|
-
self.uuid = None
|
|
363
|
-
self.size = 0
|
|
364
|
-
self.created = 0
|
|
365
|
-
self.updated = 0
|
|
366
|
-
|
|
367
|
-
def reset(self):
|
|
368
|
-
"""Reset store"""
|
|
369
|
-
self.id = None
|
|
370
|
-
self.record_id = None
|
|
371
|
-
self.name = None
|
|
372
|
-
self.path = None
|
|
373
|
-
self.file_id = None
|
|
374
|
-
self.store_id = None
|
|
375
|
-
self.thread_id = None
|
|
376
|
-
self.uuid = None
|
|
377
|
-
self.size = 0
|
|
378
|
-
self.created = 0
|
|
379
|
-
self.updated = 0
|
|
380
|
-
|
|
381
|
-
def to_dict(self) -> dict:
|
|
382
|
-
"""
|
|
383
|
-
Return as dictionary
|
|
384
|
-
|
|
385
|
-
:return: dictionary
|
|
386
|
-
"""
|
|
387
|
-
return {
|
|
388
|
-
"id": self.id,
|
|
389
|
-
"name": self.name,
|
|
390
|
-
"path": self.path,
|
|
391
|
-
"file_id": self.file_id,
|
|
392
|
-
"store_id": self.store_id,
|
|
393
|
-
"thread_id": self.thread_id,
|
|
394
|
-
"uuid": self.uuid,
|
|
395
|
-
"size": self.size,
|
|
396
|
-
"created": self.created,
|
|
397
|
-
"updated": self.updated,
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
def from_dict(self, data: dict):
|
|
401
|
-
"""
|
|
402
|
-
Load from dictionary
|
|
403
|
-
|
|
404
|
-
:param data: dictionary
|
|
405
|
-
"""
|
|
406
|
-
self.id = data.get('id', None)
|
|
407
|
-
self.name = data.get('name', None)
|
|
408
|
-
self.path = data.get('path', None)
|
|
409
|
-
self.file_id = data.get('file_id', None)
|
|
410
|
-
self.store_id = data.get('store_id', None)
|
|
411
|
-
self.thread_id = data.get('thread_id', None)
|
|
412
|
-
self.uuid = data.get('uuid', None)
|
|
413
|
-
self.size = data.get('size', 0)
|
|
414
|
-
self.created = data.get('created', 0)
|
|
415
|
-
self.updated = data.get('updated', 0)
|
|
416
|
-
|
|
417
|
-
def dump(self) -> str:
|
|
418
|
-
"""
|
|
419
|
-
Dump item to string
|
|
420
|
-
|
|
421
|
-
:return: serialized item
|
|
422
|
-
"""
|
|
423
|
-
try:
|
|
424
|
-
return json.dumps(self.to_dict())
|
|
425
|
-
except Exception as e:
|
|
426
|
-
pass
|
|
427
|
-
return ""
|
|
428
|
-
|
|
429
|
-
def __str__(self):
|
|
430
|
-
"""To string"""
|
|
431
|
-
return self.dump()
|
pygpt_net/item/ctx.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:
|
|
9
|
+
# Updated Date: 2026.01.03 17:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import copy
|
|
@@ -31,6 +31,7 @@ class CtxItem:
|
|
|
31
31
|
audio_id: Optional[object] = None
|
|
32
32
|
audio_output: Optional[object] = None
|
|
33
33
|
bag: Optional[object] = None
|
|
34
|
+
chunk_type: Optional[str] = None
|
|
34
35
|
cmds: list = field(default_factory=list)
|
|
35
36
|
cmds_before: list = field(default_factory=list)
|
|
36
37
|
current: bool = False
|
|
@@ -87,7 +88,6 @@ class CtxItem:
|
|
|
87
88
|
urls: list = field(default_factory=list)
|
|
88
89
|
urls_before: list = field(default_factory=list)
|
|
89
90
|
use_agent_final_response: bool = False
|
|
90
|
-
use_responses_api: bool = False
|
|
91
91
|
ai_name: Optional[str] = None
|
|
92
92
|
|
|
93
93
|
def __init__(self, mode: Optional[str] = None):
|
|
@@ -106,6 +106,7 @@ class CtxItem:
|
|
|
106
106
|
self.audio_id = None
|
|
107
107
|
self.audio_output = None
|
|
108
108
|
self.bag = None
|
|
109
|
+
self.chunk_type = None
|
|
109
110
|
self.cmds = []
|
|
110
111
|
self.cmds_before = []
|
|
111
112
|
self.current = False
|
|
@@ -163,7 +164,6 @@ class CtxItem:
|
|
|
163
164
|
self.urls = []
|
|
164
165
|
self.urls_before = []
|
|
165
166
|
self.use_agent_final_response = False # use agent final response
|
|
166
|
-
self.use_responses_api = False # use responses API format
|
|
167
167
|
self.ai_name = None # AI name
|
|
168
168
|
|
|
169
169
|
@property
|
pygpt_net/item/store.py
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# ================================================== #
|
|
4
|
+
# This file is a part of PYGPT package #
|
|
5
|
+
# Website: https://pygpt.net #
|
|
6
|
+
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
|
+
# MIT License #
|
|
8
|
+
# Created By : Marcin Szczygliński #
|
|
9
|
+
# Updated Date: 2026.01.02 20:00:00 #
|
|
10
|
+
# ================================================== #
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import time
|
|
14
|
+
from dataclasses import dataclass, field
|
|
15
|
+
from typing import Optional
|
|
16
|
+
|
|
17
|
+
from pygpt_net.item.attachment import AttachmentItem
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(slots=True)
|
|
21
|
+
class RemoteStoreItem:
|
|
22
|
+
id: Optional[object] = None
|
|
23
|
+
record_id: Optional[object] = None
|
|
24
|
+
uuid: Optional[object] = None
|
|
25
|
+
name: Optional[object] = None
|
|
26
|
+
provider: Optional[object] = None
|
|
27
|
+
description: Optional[object] = None
|
|
28
|
+
status: dict = field(default_factory=dict)
|
|
29
|
+
last_status: str = ""
|
|
30
|
+
expire_days: int = 0
|
|
31
|
+
usage_bytes: int = 0
|
|
32
|
+
bytes: int = 0
|
|
33
|
+
num_files: int = 0
|
|
34
|
+
is_thread: bool = False
|
|
35
|
+
created: int = 0
|
|
36
|
+
updated: int = 0
|
|
37
|
+
last_active: int = 0
|
|
38
|
+
last_sync: int = 0
|
|
39
|
+
file_ids: list = field(default_factory=list)
|
|
40
|
+
|
|
41
|
+
def __init__(self):
|
|
42
|
+
"""Assistant vector store item"""
|
|
43
|
+
self.id = None
|
|
44
|
+
self.record_id = None
|
|
45
|
+
self.uuid = None
|
|
46
|
+
self.name = None
|
|
47
|
+
self.provider = None
|
|
48
|
+
self.description = None
|
|
49
|
+
self.status = {}
|
|
50
|
+
self.last_status = ""
|
|
51
|
+
self.expire_days = 0
|
|
52
|
+
self.usage_bytes = 0
|
|
53
|
+
self.bytes = 0
|
|
54
|
+
self.num_files = 0
|
|
55
|
+
self.is_thread = False
|
|
56
|
+
self.created = int(time.time())
|
|
57
|
+
self.updated = int(time.time())
|
|
58
|
+
self.last_active = int(time.time())
|
|
59
|
+
self.last_sync = int(time.time())
|
|
60
|
+
|
|
61
|
+
def reset(self):
|
|
62
|
+
"""Reset store"""
|
|
63
|
+
self.id = None
|
|
64
|
+
self.record_id = None
|
|
65
|
+
self.uuid = None
|
|
66
|
+
self.name = None
|
|
67
|
+
self.provider = None
|
|
68
|
+
self.description = None
|
|
69
|
+
self.status = {}
|
|
70
|
+
self.last_status = ""
|
|
71
|
+
self.expire_days = 0
|
|
72
|
+
self.usage_bytes = 0
|
|
73
|
+
self.num_files = 0
|
|
74
|
+
self.bytes = 0
|
|
75
|
+
self.is_thread = False
|
|
76
|
+
self.last_active = int(time.time())
|
|
77
|
+
self.last_sync = int(time.time())
|
|
78
|
+
|
|
79
|
+
def to_dict(self) -> dict:
|
|
80
|
+
"""
|
|
81
|
+
Return as dictionary
|
|
82
|
+
|
|
83
|
+
:return: dictionary
|
|
84
|
+
"""
|
|
85
|
+
return {
|
|
86
|
+
"id": self.id,
|
|
87
|
+
"uuid": self.uuid,
|
|
88
|
+
"name": self.name,
|
|
89
|
+
"provider": self.provider,
|
|
90
|
+
"description": self.description,
|
|
91
|
+
"last_status": self.last_status,
|
|
92
|
+
"expire_days": self.expire_days,
|
|
93
|
+
"usage_bytes": self.usage_bytes,
|
|
94
|
+
"num_files": self.num_files,
|
|
95
|
+
"status": self.status,
|
|
96
|
+
"is_thread": self.is_thread,
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
def from_dict(self, data: dict):
|
|
100
|
+
"""
|
|
101
|
+
Load from dictionary
|
|
102
|
+
|
|
103
|
+
:param data: dictionary
|
|
104
|
+
"""
|
|
105
|
+
self.id = data.get('id', None)
|
|
106
|
+
self.name = data.get('name', None)
|
|
107
|
+
self.provider = data.get('provider', None)
|
|
108
|
+
self.uuid = data.get('uuid', None)
|
|
109
|
+
self.expire_days = data.get('expire_days', 0)
|
|
110
|
+
self.status = data.get('status', {})
|
|
111
|
+
|
|
112
|
+
def get_file_count(self):
|
|
113
|
+
"""
|
|
114
|
+
Return number of files in store
|
|
115
|
+
|
|
116
|
+
:return: number of files
|
|
117
|
+
"""
|
|
118
|
+
num = self.num_files
|
|
119
|
+
if self.status and isinstance(self.status, dict) and 'file_counts' in self.status:
|
|
120
|
+
if 'completed' in self.status['file_counts']:
|
|
121
|
+
num = int(self.status['file_counts']['completed'] or 0)
|
|
122
|
+
return num
|
|
123
|
+
|
|
124
|
+
def dump(self) -> str:
|
|
125
|
+
"""
|
|
126
|
+
Dump item to string
|
|
127
|
+
|
|
128
|
+
:return: serialized item
|
|
129
|
+
"""
|
|
130
|
+
try:
|
|
131
|
+
return json.dumps(self.to_dict())
|
|
132
|
+
except Exception as e:
|
|
133
|
+
pass
|
|
134
|
+
return ""
|
|
135
|
+
|
|
136
|
+
def __str__(self):
|
|
137
|
+
"""To string"""
|
|
138
|
+
return self.dump()
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@dataclass(slots=True)
|
|
142
|
+
class RemoteFileItem:
|
|
143
|
+
id: Optional[object] = None
|
|
144
|
+
record_id: Optional[object] = None
|
|
145
|
+
name: Optional[object] = None
|
|
146
|
+
provider: Optional[object] = None
|
|
147
|
+
path: Optional[object] = None
|
|
148
|
+
file_id: Optional[object] = None
|
|
149
|
+
store_id: Optional[object] = None
|
|
150
|
+
thread_id: Optional[object] = None
|
|
151
|
+
uuid: Optional[object] = None
|
|
152
|
+
size: int = 0
|
|
153
|
+
created: int = 0
|
|
154
|
+
updated: int = 0
|
|
155
|
+
|
|
156
|
+
def __init__(self):
|
|
157
|
+
"""Assistant file item"""
|
|
158
|
+
self.id = None
|
|
159
|
+
self.record_id = None
|
|
160
|
+
self.name = None
|
|
161
|
+
self.provider = None
|
|
162
|
+
self.path = None
|
|
163
|
+
self.file_id = None
|
|
164
|
+
self.store_id = None
|
|
165
|
+
self.thread_id = None
|
|
166
|
+
self.uuid = None
|
|
167
|
+
self.size = 0
|
|
168
|
+
self.created = 0
|
|
169
|
+
self.updated = 0
|
|
170
|
+
|
|
171
|
+
def reset(self):
|
|
172
|
+
"""Reset store"""
|
|
173
|
+
self.id = None
|
|
174
|
+
self.record_id = None
|
|
175
|
+
self.name = None
|
|
176
|
+
self.provider = None
|
|
177
|
+
self.path = None
|
|
178
|
+
self.file_id = None
|
|
179
|
+
self.store_id = None
|
|
180
|
+
self.thread_id = None
|
|
181
|
+
self.uuid = None
|
|
182
|
+
self.size = 0
|
|
183
|
+
self.created = 0
|
|
184
|
+
self.updated = 0
|
|
185
|
+
|
|
186
|
+
def to_dict(self) -> dict:
|
|
187
|
+
"""
|
|
188
|
+
Return as dictionary
|
|
189
|
+
|
|
190
|
+
:return: dictionary
|
|
191
|
+
"""
|
|
192
|
+
return {
|
|
193
|
+
"id": self.id,
|
|
194
|
+
"name": self.name,
|
|
195
|
+
"provider": self.provider,
|
|
196
|
+
"path": self.path,
|
|
197
|
+
"file_id": self.file_id,
|
|
198
|
+
"store_id": self.store_id,
|
|
199
|
+
"thread_id": self.thread_id,
|
|
200
|
+
"uuid": self.uuid,
|
|
201
|
+
"size": self.size,
|
|
202
|
+
"created": self.created,
|
|
203
|
+
"updated": self.updated,
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
def from_dict(self, data: dict):
|
|
207
|
+
"""
|
|
208
|
+
Load from dictionary
|
|
209
|
+
|
|
210
|
+
:param data: dictionary
|
|
211
|
+
"""
|
|
212
|
+
self.id = data.get('id', None)
|
|
213
|
+
self.name = data.get('name', None)
|
|
214
|
+
self.provider = data.get('provider', None)
|
|
215
|
+
self.path = data.get('path', None)
|
|
216
|
+
self.file_id = data.get('file_id', None)
|
|
217
|
+
self.store_id = data.get('store_id', None)
|
|
218
|
+
self.thread_id = data.get('thread_id', None)
|
|
219
|
+
self.uuid = data.get('uuid', None)
|
|
220
|
+
self.size = data.get('size', 0)
|
|
221
|
+
self.created = data.get('created', 0)
|
|
222
|
+
self.updated = data.get('updated', 0)
|
|
223
|
+
|
|
224
|
+
def dump(self) -> str:
|
|
225
|
+
"""
|
|
226
|
+
Dump item to string
|
|
227
|
+
|
|
228
|
+
:return: serialized item
|
|
229
|
+
"""
|
|
230
|
+
try:
|
|
231
|
+
return json.dumps(self.to_dict())
|
|
232
|
+
except Exception as e:
|
|
233
|
+
pass
|
|
234
|
+
return ""
|
|
235
|
+
|
|
236
|
+
def __str__(self):
|
|
237
|
+
"""To string"""
|
|
238
|
+
return self.dump()
|