pygpt-net 2.4.31__py3-none-any.whl → 2.4.33__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 +10 -0
- README.md +14 -4
- pygpt_net/CHANGELOG.txt +10 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/controller/attachment.py +52 -1
- pygpt_net/controller/chat/attachment.py +109 -44
- pygpt_net/controller/dialogs/confirm.py +17 -1
- pygpt_net/core/attachments/__init__.py +11 -7
- pygpt_net/core/attachments/context.py +171 -34
- pygpt_net/core/debug/attachments.py +3 -1
- pygpt_net/core/debug/context.py +5 -1
- pygpt_net/core/idx/indexing.py +123 -15
- pygpt_net/core/render/markdown/pid.py +2 -1
- pygpt_net/core/render/plain/pid.py +2 -1
- pygpt_net/core/render/web/body.py +34 -12
- pygpt_net/core/render/web/pid.py +2 -1
- pygpt_net/core/render/web/renderer.py +8 -3
- pygpt_net/data/config/config.json +3 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/config/modes.json +3 -3
- pygpt_net/data/css/web.css +70 -0
- pygpt_net/data/css/web.dark.css +4 -1
- pygpt_net/data/css/web.light.css +1 -1
- pygpt_net/data/locale/locale.de.ini +7 -1
- pygpt_net/data/locale/locale.en.ini +10 -4
- pygpt_net/data/locale/locale.es.ini +7 -1
- pygpt_net/data/locale/locale.fr.ini +7 -1
- pygpt_net/data/locale/locale.it.ini +7 -1
- pygpt_net/data/locale/locale.pl.ini +7 -1
- pygpt_net/data/locale/locale.uk.ini +7 -1
- pygpt_net/data/locale/locale.zh.ini +7 -1
- pygpt_net/item/attachment.py +9 -1
- pygpt_net/plugin/cmd_code_interpreter/runner.py +2 -2
- pygpt_net/plugin/cmd_mouse_control/__init__.py +4 -2
- pygpt_net/provider/core/attachment/json_file.py +4 -1
- pygpt_net/provider/loaders/base.py +10 -1
- pygpt_net/provider/loaders/web_yt.py +19 -1
- pygpt_net/tools/image_viewer/ui/dialogs.py +3 -1
- pygpt_net/ui/dialog/url.py +29 -0
- pygpt_net/ui/dialogs.py +5 -1
- pygpt_net/ui/layout/chat/attachments.py +20 -6
- pygpt_net/ui/layout/chat/attachments_ctx.py +4 -3
- pygpt_net/ui/layout/chat/attachments_uploaded.py +8 -4
- pygpt_net/ui/widget/dialog/url.py +59 -0
- pygpt_net/ui/widget/lists/attachment.py +22 -17
- pygpt_net/ui/widget/textarea/url.py +43 -0
- {pygpt_net-2.4.31.dist-info → pygpt_net-2.4.33.dist-info}/METADATA +15 -5
- {pygpt_net-2.4.31.dist-info → pygpt_net-2.4.33.dist-info}/RECORD +51 -48
- {pygpt_net-2.4.31.dist-info → pygpt_net-2.4.33.dist-info}/LICENSE +0 -0
- {pygpt_net-2.4.31.dist-info → pygpt_net-2.4.33.dist-info}/WHEEL +0 -0
- {pygpt_net-2.4.31.dist-info → pygpt_net-2.4.33.dist-info}/entry_points.txt +0 -0
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.11.
|
9
|
+
# Updated Date: 2024.11.26 04:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import json
|
@@ -420,16 +420,20 @@ class Renderer(BaseRenderer):
|
|
420
420
|
# files and attachments, TODO check attachments
|
421
421
|
c = len(ctx.files)
|
422
422
|
if c > 0:
|
423
|
+
files_html = []
|
423
424
|
n = 1
|
424
425
|
for file in ctx.files:
|
425
|
-
if file in appended:
|
426
|
+
if file in appended or file in self.pids[pid].files_appended:
|
426
427
|
continue
|
427
428
|
try:
|
428
429
|
appended.append(file)
|
429
|
-
|
430
|
+
files_html.append(self.body.get_file_html(file, n, c))
|
431
|
+
self.pids[pid].files_appended.append(file)
|
430
432
|
n += 1
|
431
433
|
except Exception as e:
|
432
434
|
pass
|
435
|
+
if files_html:
|
436
|
+
html += "<br/>" + "<br/>".join(files_html)
|
433
437
|
|
434
438
|
# urls
|
435
439
|
c = len(ctx.urls)
|
@@ -519,6 +523,7 @@ class Renderer(BaseRenderer):
|
|
519
523
|
self.clear_chunks(pid)
|
520
524
|
self.pids[pid].images_appended = []
|
521
525
|
self.pids[pid].urls_appended = []
|
526
|
+
self.pids[pid].files_appended = []
|
522
527
|
self.get_output_node_by_pid(pid).reset_current_content()
|
523
528
|
self.reset_names_by_pid(pid)
|
524
529
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"__meta__": {
|
3
|
-
"version": "2.4.
|
4
|
-
"app.version": "2.4.
|
5
|
-
"updated_at": "2024-11-
|
3
|
+
"version": "2.4.33",
|
4
|
+
"app.version": "2.4.33",
|
5
|
+
"updated_at": "2024-11-26T00:00:00"
|
6
6
|
},
|
7
7
|
"access.audio.event.speech": false,
|
8
8
|
"access.audio.event.speech.disabled": [],
|
pygpt_net/data/config/modes.json
CHANGED
pygpt_net/data/css/web.css
CHANGED
@@ -26,10 +26,76 @@ body {{
|
|
26
26
|
-webkit-border-radius: 1ex;
|
27
27
|
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75);
|
28
28
|
}}
|
29
|
+
a {{
|
30
|
+
text-decoration: none;
|
31
|
+
color: #a1b5c4 !important;
|
32
|
+
}}
|
33
|
+
a:hover {{
|
34
|
+
cursor: pointer !important;
|
35
|
+
text-decoration: underline;
|
36
|
+
}}
|
29
37
|
p {{
|
30
38
|
margin-top: 5px;
|
31
39
|
margin-bottom: 5px;
|
32
40
|
}}
|
41
|
+
.extra-src-icon {{
|
42
|
+
padding-right: 2px;
|
43
|
+
}}
|
44
|
+
.extra-src-img-box {{
|
45
|
+
display: inline-block;
|
46
|
+
text-align: center;
|
47
|
+
padding: 5px;
|
48
|
+
margin: 5px;
|
49
|
+
max-width: 400px;
|
50
|
+
height: auto;
|
51
|
+
white-space: pre-wrap;
|
52
|
+
word-break: break-all !important;
|
53
|
+
}}
|
54
|
+
.extra-src-img-box:hover {{
|
55
|
+
cursor: pointer;
|
56
|
+
}}
|
57
|
+
.extra-src-img-box .title {{
|
58
|
+
width: 400px;
|
59
|
+
overflow: hidden;
|
60
|
+
white-space: nowrap;
|
61
|
+
text-overflow: ellipsis;
|
62
|
+
display: block;
|
63
|
+
text-align: center;
|
64
|
+
padding: 0;
|
65
|
+
margin: 0;
|
66
|
+
padding-top: 10px;
|
67
|
+
display: block;
|
68
|
+
font-size: 0.95rem;
|
69
|
+
}}
|
70
|
+
.extra-src-img-box .img-outer {{
|
71
|
+
display: flex;
|
72
|
+
flex-direction: column;
|
73
|
+
}}
|
74
|
+
.extra-src-img-box .img-wrapper {{
|
75
|
+
position: relative;
|
76
|
+
overflow: hidden;
|
77
|
+
border: 1px solid #000;
|
78
|
+
background: #000;
|
79
|
+
width: 400px;
|
80
|
+
height: 280px;
|
81
|
+
margin: 0;
|
82
|
+
margin-bottom: 0px !important;
|
83
|
+
border-radius: 5px;
|
84
|
+
-webkit-box-shadow: 8px 8px 22px -16px rgba(0, 0, 0, 1);
|
85
|
+
-moz-box-shadow: 8px 8px 22px -16px rgba(0, 0, 0, 1);
|
86
|
+
box-shadow: 8px 8px 22px -16px rgba(0, 0, 0, 1);
|
87
|
+
}}
|
88
|
+
.extra-src-img-box .img-wrapper:hover {{
|
89
|
+
border: 1px solid gray;
|
90
|
+
}}
|
91
|
+
.extra-src-img-box img {{
|
92
|
+
margin-bottom: 2px;
|
93
|
+
padding-bottom: 0px;
|
94
|
+
display: block;
|
95
|
+
width: 100%;
|
96
|
+
height: 100%;
|
97
|
+
object-fit: cover;
|
98
|
+
}}
|
33
99
|
.msg-user {{
|
34
100
|
white-space: pre-wrap;
|
35
101
|
width: auto;
|
@@ -52,6 +118,10 @@ p {{
|
|
52
118
|
.msg-extra {{
|
53
119
|
margin-top: 10px;
|
54
120
|
margin-bottom: 0px;
|
121
|
+
color: gray;
|
122
|
+
}}
|
123
|
+
.msg-extra a {{
|
124
|
+
color: gray;
|
55
125
|
}}
|
56
126
|
.msg-user .msg-extra {{
|
57
127
|
font-weight: bold;
|
pygpt_net/data/css/web.dark.css
CHANGED
pygpt_net/data/css/web.light.css
CHANGED
@@ -8,7 +8,7 @@ about.thanks.sponsors = Sponsoren
|
|
8
8
|
about.thanks.supporters = Unterstützer
|
9
9
|
action.add = Hinzufügen
|
10
10
|
action.clear = Löschen
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = JSON-Ausgabe
|
12
12
|
action.copy = Kopieren
|
13
13
|
action.ctx_copy_id = ID kopieren
|
14
14
|
action.ctx.indexed = Zuletzt indiziert am
|
@@ -98,6 +98,7 @@ assistant.tool.retrieval = Werkzeug: Abruf
|
|
98
98
|
assistant.vector_store = Vektor Speicher
|
99
99
|
attachments.auto_index = Automatische Indizierung beim Hochladen
|
100
100
|
attachments.btn.add = Datei hinzufügen
|
101
|
+
attachments.btn.add_url = URL
|
101
102
|
attachments.btn.clear = Dateien löschen
|
102
103
|
attachments.capture_clear = Beim Erfassen löschen
|
103
104
|
attachments.clear.confirm = Liste löschen?
|
@@ -114,6 +115,7 @@ attachments.header.name = Name
|
|
114
115
|
attachments.header.path = Pfad
|
115
116
|
attachments.header.size = Größe
|
116
117
|
attachments.header.store = Vektor Speicher(e)
|
118
|
+
attachments.options.label = Optionen
|
117
119
|
attachments.send_clear = Liste nach dem Senden löschen
|
118
120
|
attachments.tab = Anhänge
|
119
121
|
attachments_uploaded.btn.clear = Dateien löschen
|
@@ -340,6 +342,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
340
342
|
dialog.start.settings.text = Wenn Sie bereits einen API-KEY haben, dann können Sie ihn im Einstellungsfenster konfigurieren.\nKlicken Sie auf die Schaltfläche EINSTELLUNGEN ÖFFNEN und fügen Sie dann Ihren API-KEY in das API-KEY-Feld ein.
|
341
343
|
dialog.start.title = API-KEY ist noch nicht konfiguriert
|
342
344
|
dialog.start.title.text = Ihr API-Schlüssel ist noch nicht konfiguriert...\nSie erhalten einen API-Schlüssel, indem Sie ein Konto auf der OpenAI-Website registrieren:
|
345
|
+
dialog.url.dismiss = Abbrechen
|
346
|
+
dialog.url.tip = Geben Sie die URL der Webseite an, die Sie als zusätzlichen Kontext anfügen möchten, z.B. https://de.wikipedia.org/wiki/Elon_Musk, oder ein YouTube-Video zur Transkription, z.B. https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
347
|
+
dialog.url.title = URL
|
348
|
+
dialog.url.update = Hinzufügen
|
343
349
|
dialog.workdir.change.confirm = Sind Sie sicher, dass Sie das Arbeitsverzeichnis zu folgendem ändern/verschieben möchten:\n{path}?
|
344
350
|
dialog.workdir.change.empty.alert = Verzeichnis ist nicht leer! Vorgang wird abgebrochen.
|
345
351
|
dialog.workdir.reset.btn = Aktuell
|
@@ -9,7 +9,7 @@ about.thanks.supporters = Supporters
|
|
9
9
|
action.add = Add
|
10
10
|
action.clear = Clear
|
11
11
|
action.close = Close
|
12
|
-
action.cmd.expand =
|
12
|
+
action.cmd.expand = JSON output
|
13
13
|
action.copy = Copy
|
14
14
|
action.ctx_copy_id = Copy ID
|
15
15
|
action.ctx.indexed = Last indexed at
|
@@ -107,7 +107,8 @@ assistant.tool.retrieval = Retrieval
|
|
107
107
|
assistant.vector_store = Vector Store
|
108
108
|
attachments.auto_index = Auto-index on upload
|
109
109
|
attachments.btn.add = Add file
|
110
|
-
attachments.btn.
|
110
|
+
attachments.btn.add_url = URL
|
111
|
+
attachments.btn.clear = Clear
|
111
112
|
attachments.capture_clear = Clear on capture
|
112
113
|
attachments.clear.confirm = Clear list?
|
113
114
|
attachments.ctx.indexed = Yes
|
@@ -124,16 +125,17 @@ attachments.header.name = Name
|
|
124
125
|
attachments.header.path = Path
|
125
126
|
attachments.header.size = Size
|
126
127
|
attachments.header.store = Vector Store(s)
|
128
|
+
attachments.options.label = Options
|
127
129
|
attachments.send_clear = Clear list after sending
|
128
130
|
attachments.tab = Attachments
|
129
|
-
attachments_uploaded.btn.clear = Clear
|
131
|
+
attachments_uploaded.btn.clear = Clear
|
130
132
|
attachments_uploaded.btn.sync = Sync
|
131
133
|
attachments_uploaded.btn.sync.all = All stores
|
132
134
|
attachments_uploaded.btn.sync.current = Current only
|
133
135
|
attachments_uploaded.clear.confirm = WARNING: are you sure you want to delete all these files from the remote server?
|
134
136
|
attachments_uploaded.delete.confirm = WARNING: are you sure you want to delete this file from the remote server?
|
135
137
|
attachments_uploaded.sync.tip = Tip: click on 'Sync' to retrieve the file list from OpenAI
|
136
|
-
attachments_uploaded.tab = Uploaded
|
138
|
+
attachments_uploaded.tab = Uploaded
|
137
139
|
audio.cache.clear.confirm = Are you sure you want to delete all cached audio files?
|
138
140
|
audio.cache.clear.success = OK. All audio cache files cleared.
|
139
141
|
audio.control.btn = Voice control
|
@@ -370,6 +372,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
370
372
|
dialog.start.settings.text = If you already have an API key, you can configure it in the settings window.\nClick the "Go to Settings" button, and then paste your API key into the API key field.
|
371
373
|
dialog.start.title = Api Key is not configured yet
|
372
374
|
dialog.start.title.text = Your API key is not configured yet...\nYou will obtain an API key by registering an account on the OpenAI website:
|
375
|
+
dialog.url.dismiss = Cancel
|
376
|
+
dialog.url.tip = Provide the URL of the web page you want to attach as additional context, e.g., https://pl.wikipedia.org/wiki/Elon_Musk, or a YouTube video to transcribe, e.g., https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
377
|
+
dialog.url.title = URL
|
378
|
+
dialog.url.update = Add
|
373
379
|
dialog.workdir.change.confirm = Are you sure you want to change/move workdir to:\n{path}?
|
374
380
|
dialog.workdir.change.empty.alert = Directory is not empty! Aborting.
|
375
381
|
dialog.workdir.reset.btn = Current
|
@@ -8,7 +8,7 @@ about.thanks.sponsors = Patrocinadores
|
|
8
8
|
about.thanks.supporters = Colaboradores
|
9
9
|
action.add = Añadir
|
10
10
|
action.clear = Limpiar
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = salida JSON
|
12
12
|
action.copy = Copiar
|
13
13
|
action.ctx_copy_id = Copiar ID
|
14
14
|
action.ctx.indexed = Última indexación el
|
@@ -98,6 +98,7 @@ assistant.tool.retrieval = Herramienta: recuperación
|
|
98
98
|
assistant.vector_store = Almacén de vectores
|
99
99
|
attachments.auto_index = Indexación automática al subir
|
100
100
|
attachments.btn.add = Añadir archivo
|
101
|
+
attachments.btn.add_url = URL
|
101
102
|
attachments.btn.clear = Limpiar archivos
|
102
103
|
attachments.capture_clear = Limpiar al capturar
|
103
104
|
attachments.clear.confirm = ¿Limpiar la lista?
|
@@ -114,6 +115,7 @@ attachments.header.name = Nombre
|
|
114
115
|
attachments.header.path = Ruta
|
115
116
|
attachments.header.size = Tamaño
|
116
117
|
attachments.header.store = Almacén(es) de vectores
|
118
|
+
attachments.options.label = Opciones
|
117
119
|
attachments.send_clear = Limpiar lista después de enviar
|
118
120
|
attachments.tab = Adjuntos
|
119
121
|
attachments_uploaded.btn.clear = Limpiar archivos
|
@@ -340,6 +342,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
340
342
|
dialog.start.settings.text = Si ya tiene una API KEY, puede configurarla en la ventana de configuración.\nHaga clic en el botón IR A CONFIGURACIÓN y luego pegue su API KEY en el campo API KEY.
|
341
343
|
dialog.start.title = La API KEY aún no está configurada
|
342
344
|
dialog.start.title.text = Su clave de API aún no está configurada...\nObtendrá una clave de API registrando una cuenta en el sitio web de OpenAI:
|
345
|
+
dialog.url.dismiss = Cancelar
|
346
|
+
dialog.url.tip = Proporcione la URL de la página web que desea adjuntar como contexto adicional, por ejemplo, https://es.wikipedia.org/wiki/Elon_Musk, o un video de YouTube para transcribir, por ejemplo, https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
347
|
+
dialog.url.title = URL
|
348
|
+
dialog.url.update = Agregar
|
343
349
|
dialog.workdir.change.confirm = ¿Está seguro de querer cambiar/mover el directorio de trabajo a:\n{path}?
|
344
350
|
dialog.workdir.change.empty.alert = ¡El directorio no está vacío! Cancelando la operación.
|
345
351
|
dialog.workdir.reset.btn = Actual
|
@@ -8,7 +8,7 @@ about.thanks.sponsors = Sponsors
|
|
8
8
|
about.thanks.supporters = Supporteurs
|
9
9
|
action.add = Ajouter
|
10
10
|
action.clear = Effacer
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = résultat JSON
|
12
12
|
action.copy = Copier
|
13
13
|
action.ctx_copy_id = Copier l'ID
|
14
14
|
action.ctx.indexed = Dernière indexation le
|
@@ -98,6 +98,7 @@ assistant.tool.retrieval = Outil : récupération
|
|
98
98
|
assistant.vector_store = Base vectorielle
|
99
99
|
attachments.auto_index = Indexation automatique lors du téléchargement
|
100
100
|
attachments.btn.add = Ajouter un fichier
|
101
|
+
attachments.btn.add_url = URL
|
101
102
|
attachments.btn.clear = Effacer les fichiers
|
102
103
|
attachments.capture_clear = Effacer à la capture
|
103
104
|
attachments.clear.confirm = Effacer la liste ?
|
@@ -114,6 +115,7 @@ attachments.header.name = Nom
|
|
114
115
|
attachments.header.path = Chemin
|
115
116
|
attachments.header.size = Taille
|
116
117
|
attachments.header.store = Base(s) vectorielle(s)
|
118
|
+
attachments.options.label = Options
|
117
119
|
attachments.send_clear = Effacer la liste après envoi
|
118
120
|
attachments.tab = Pièces jointes
|
119
121
|
attachments_uploaded.btn.clear = Effacer les fichiers
|
@@ -340,6 +342,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
340
342
|
dialog.start.settings.text = Si vous avez déjà une CLÉ API, vous pouvez la configurer dans la fenêtre des paramètres.\nCliquez sur le bouton ALLER AUX PARAMÈTRES, puis collez votre CLÉ API dans le champ CLÉ API.
|
341
343
|
dialog.start.title = La CLÉ API n’est pas encore configurée
|
342
344
|
dialog.start.title.text = Votre clé API n'est pas encore configurée...\nVous obtiendrez une clé API en vous inscrivant sur le site web d'OpenAI :
|
345
|
+
dialog.url.dismiss = Annuler
|
346
|
+
dialog.url.tip = Fournissez l'URL de la page Web que vous souhaitez joindre comme contexte supplémentaire, par exemple, https://fr.wikipedia.org/wiki/Elon_Musk, ou une vidéo YouTube à transcrire, par exemple, https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
347
|
+
dialog.url.title = URL
|
348
|
+
dialog.url.update = Ajouter
|
343
349
|
dialog.workdir.change.confirm = Êtes-vous sûr de vouloir changer/déplacer le répertoire de travail vers :\n{path}?
|
344
350
|
dialog.workdir.change.empty.alert = Le répertoire n'est pas vide ! Opération annulée.
|
345
351
|
dialog.workdir.reset.btn = Actuel
|
@@ -8,7 +8,7 @@ about.thanks.sponsors = Sponsor
|
|
8
8
|
about.thanks.supporters = Sostenitori
|
9
9
|
action.add = Aggiungi
|
10
10
|
action.clear = Cancella
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = output JSON
|
12
12
|
action.copy = Copia
|
13
13
|
action.ctx_copy_id = Copia ID
|
14
14
|
action.ctx.indexed = Ultima indicizzazione il
|
@@ -98,6 +98,7 @@ assistant.tool.retrieval = Strumento: recupero
|
|
98
98
|
assistant.vector_store = Archivio vettoriale
|
99
99
|
attachments.auto_index = Indicizzazione automatica al caricamento
|
100
100
|
attachments.btn.add = Aggiungi file
|
101
|
+
attachments.btn.add_url = URL
|
101
102
|
attachments.btn.clear = Pulisci file
|
102
103
|
attachments.capture_clear = Pulisci alla cattura
|
103
104
|
attachments.clear.confirm = Pulire l'elenco?
|
@@ -114,6 +115,7 @@ attachments.header.name = Nome
|
|
114
115
|
attachments.header.path = Percorso
|
115
116
|
attachments.header.size = Dimensione
|
116
117
|
attachments.header.store = Archivio(i) vettoriale(i)
|
118
|
+
attachments.options.label = Opzioni
|
117
119
|
attachments.send_clear = Pulire l'elenco dopo l'invio
|
118
120
|
attachments.tab = Allegati
|
119
121
|
attachments_uploaded.btn.clear = Pulisci file
|
@@ -340,6 +342,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
340
342
|
dialog.start.settings.text = Se hai già una API KEY puoi configurarla nella finestra delle impostazioni.\nClicca sul pulsante VAI ALLE IMPOSTAZIONI e poi incolla la tua API KEY nel campo API KEY.
|
341
343
|
dialog.start.title = API KEY non ancora configurata
|
342
344
|
dialog.start.title.text = La tua API key non è ancora configurata...\nOtterrai una API key registrando un account sul sito web di OpenAI:
|
345
|
+
dialog.url.dismiss = Annulla
|
346
|
+
dialog.url.tip = Fornisci l'URL della pagina web che desideri allegare come contesto aggiuntivo, ad esempio, https://it.wikipedia.org/wiki/Elon_Musk, o un video YouTube da trascrivere, ad esempio, https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
347
|
+
dialog.url.title = URL
|
348
|
+
dialog.url.update = Aggiungi
|
343
349
|
dialog.workdir.change.confirm = Sei sicuro di voler cambiare/spostare la workdir a:\n{path}?
|
344
350
|
dialog.workdir.change.empty.alert = La cartella non è vuota! Annullamento dell'operazione.
|
345
351
|
dialog.workdir.reset.btn = Corrente
|
@@ -8,7 +8,7 @@ about.thanks.sponsors = Sponsorzy
|
|
8
8
|
about.thanks.supporters = Wspierający
|
9
9
|
action.add = Dodaj
|
10
10
|
action.clear = Wyczyść
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = wynik JSON
|
12
12
|
action.copy = Kopiuj
|
13
13
|
action.ctx_copy_id = Kopiuj ID
|
14
14
|
action.ctx.indexed = Ostatnio zindeksowane
|
@@ -98,6 +98,7 @@ assistant.tool.retrieval = Tool: retrieval
|
|
98
98
|
assistant.vector_store = Baza wektorowa
|
99
99
|
attachments.auto_index = Auto-indeksacja przy przesyłaniu
|
100
100
|
attachments.btn.add = Dodaj plik
|
101
|
+
attachments.btn.add_url = URL
|
101
102
|
attachments.btn.clear = Wyczyść
|
102
103
|
attachments.capture_clear = Wyczyść przy przechwytywaniu
|
103
104
|
attachments.clear.confirm = Wyczyścić listę plików?
|
@@ -114,6 +115,7 @@ attachments.header.name = Nazwa
|
|
114
115
|
attachments.header.path = Ścieżka
|
115
116
|
attachments.header.size = Rozmiar
|
116
117
|
attachments.header.store = Baza(y) wektorowa
|
118
|
+
attachments.options.label
|
117
119
|
attachments.send_clear = Wyczyść listę po wysłaniu
|
118
120
|
attachments.tab = Załączniki
|
119
121
|
attachments_uploaded.btn.clear = Wyczyść
|
@@ -340,6 +342,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
340
342
|
dialog.start.settings.text = Jeśli posiadasz już klucz API możesz go skonfigurować w oknie ustawień.\nAby to zrobić, kliknij na przycisk poniżej i wklej swój klucz API do pola Klucz API.
|
341
343
|
dialog.start.title = Klucz API nie jest zdefiniowany
|
342
344
|
dialog.start.title.text = Nie skonfigurowałeś jeszcze klucza API...\nKlucz API uzyskasz rejestrując konto na stronie internetowej OpenAI:
|
345
|
+
dialog.url.dismiss = Anuluj
|
346
|
+
dialog.url.tip = Podaj URL strony internetowej, którą chcesz dołączyć jako dodatkowy kontekst, np. https://pl.wikipedia.org/wiki/Elon_Musk, lub film na YouTube do transkrypcji, np. https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
347
|
+
dialog.url.title = URL
|
348
|
+
dialog.url.update = Dodaj
|
343
349
|
dialog.workdir.change.confirm = Czy jesteś pewny, że chcesz zmienić/przenieść katalog roboczy do:\n{path}?
|
344
350
|
dialog.workdir.change.empty.alert = Katalog nie jest pusty! Anulowanie.
|
345
351
|
dialog.workdir.reset.btn = Aktualny
|
@@ -8,7 +8,7 @@ about.thanks.sponsors = Спонсори
|
|
8
8
|
about.thanks.supporters = Підтримувачі
|
9
9
|
action.add = Додати
|
10
10
|
action.clear = Очистити
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = результат JSON
|
12
12
|
action.copy = Копіювати
|
13
13
|
action.ctx_copy_id = Копіювати ID
|
14
14
|
action.ctx.indexed = Останнє індексування в
|
@@ -98,6 +98,7 @@ assistant.tool.retrieval = Інструмент: пошук
|
|
98
98
|
assistant.vector_store = Векторне сховище
|
99
99
|
attachments.auto_index = Автоматичне індексування при завантаженні
|
100
100
|
attachments.btn.add = Додати файл
|
101
|
+
attachments.btn.add_url = URL
|
101
102
|
attachments.btn.clear = Очистити файли
|
102
103
|
attachments.capture_clear = Очистити під час захоплення
|
103
104
|
attachments.clear.confirm = Очистити список?
|
@@ -114,6 +115,7 @@ attachments.header.name = Ім'я
|
|
114
115
|
attachments.header.path = Шлях
|
115
116
|
attachments.header.size = Розмір
|
116
117
|
attachments.header.store = Векторне(і) сховище(а)
|
118
|
+
attachments.options.label = Опції
|
117
119
|
attachments.send_clear = Очистити список після відправлення
|
118
120
|
attachments.tab = Вкладення
|
119
121
|
attachments_uploaded.btn.clear = Очистити файли
|
@@ -340,6 +342,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
340
342
|
dialog.start.settings.text = Якщо у вас вже є API КЛЮЧ, то ви можете налаштувати його у вікні налаштувань.\nНатисніть на кнопку ПЕРЕЙТИ ДО НАЛАШТУВАНЬ, а потім вставте свій API КЛЮЧ у поле API КЛЮЧ.
|
341
343
|
dialog.start.title = API КЛЮЧ ще не налаштований
|
342
344
|
dialog.start.title.text = Ваш API ключ ще не налаштований...\nВи отримаєте API ключ, зареєструвавшись на сайті OpenAI:
|
345
|
+
dialog.url.dismiss = Скасувати
|
346
|
+
dialog.url.tip = Вкажіть URL веб-сторінки, яку ви хочете прикріпити як додатковий контекст, наприклад, https://uk.wikipedia.org/wiki/Ілон_Маск, або відео на YouTube для транскрипції, наприклад, https://www.youtube.com/watch?v=CRRlbK5w8AE.
|
347
|
+
dialog.url.title = URL
|
348
|
+
dialog.url.update = Додати
|
343
349
|
dialog.workdir.change.confirm = Ви впевнені, що хочете змінити/перемістити робочий каталог до:\n{path}?
|
344
350
|
dialog.workdir.change.empty.alert = Каталог не порожній! Операцію скасовано.
|
345
351
|
dialog.workdir.reset.btn = Поточний
|
@@ -8,7 +8,7 @@ about.thanks.sponsors = 贊助商
|
|
8
8
|
about.thanks.supporters = 支持者
|
9
9
|
action.add = 添加
|
10
10
|
action.clear = 清除
|
11
|
-
action.cmd.expand =
|
11
|
+
action.cmd.expand = JSON输出
|
12
12
|
action.copy = 复制
|
13
13
|
action.ctx_copy_id = 複製ID
|
14
14
|
action.ctx.indexed = 最後索引於
|
@@ -100,6 +100,7 @@ assistant.tool.retrieval = 工具:檢索
|
|
100
100
|
assistant.vector_store = 向量存储库
|
101
101
|
attachments.auto_index = 上传时自动索引
|
102
102
|
attachments.btn.add = 添加文件
|
103
|
+
attachments.btn.add_url = URL
|
103
104
|
attachments.btn.clear = 清除文件
|
104
105
|
attachments.capture_clear = 捕獲後清除
|
105
106
|
attachments.clear.confirm = 清除列表?
|
@@ -116,6 +117,7 @@ attachments.header.name = 名稱
|
|
116
117
|
attachments.header.path = 路徑
|
117
118
|
attachments.header.size = 尺寸
|
118
119
|
attachments.header.store = 向量存储库
|
120
|
+
attachments.options.label = 选项
|
119
121
|
attachments.send_clear = 發送後清除列表
|
120
122
|
attachments.tab = 附件
|
121
123
|
attachments_uploaded.btn.clear = 清除文件
|
@@ -350,6 +352,10 @@ dialog.start.link = https://platform.openai.com/account/api-keys
|
|
350
352
|
dialog.start.settings.text = 如果您已經有API KEY,則可以在設置窗口中配置它。\n點擊按鈕轉到設置,然後將您的API KEY粘貼到API KEY字段中。
|
351
353
|
dialog.start.title = API KEY尚未配置
|
352
354
|
dialog.start.title.text = 您的API密鑰尚未配置...\n您將通過在OpenAI網站上註冊賬戶獲得API密鑰:
|
355
|
+
dialog.url.dismiss = 取消
|
356
|
+
dialog.url.tip = 提供您要附加为附加上下文的网页 URL,例如,https://zh.wikipedia.org/wiki/Elon_Musk,或一个要转录的 YouTube 视频,例如,https://www.youtube.com/watch?v=CRRlbK5w8AE。
|
357
|
+
dialog.url.title = URL
|
358
|
+
dialog.url.update = 添加
|
353
359
|
dialog.workdir.change.confirm = 您确定要更改/移动工作目录到:\n{path}吗?
|
354
360
|
dialog.workdir.change.empty.alert = 目录不为空!操作取消。
|
355
361
|
dialog.workdir.reset.btn = 当前
|
pygpt_net/item/attachment.py
CHANGED
@@ -6,13 +6,17 @@
|
|
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.
|
9
|
+
# Updated Date: 2024.11.26 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import json
|
13
13
|
|
14
14
|
|
15
15
|
class AttachmentItem:
|
16
|
+
|
17
|
+
TYPE_FILE = 'file'
|
18
|
+
TYPE_URL = 'url'
|
19
|
+
|
16
20
|
def __init__(self):
|
17
21
|
"""
|
18
22
|
Attachment item
|
@@ -28,6 +32,7 @@ class AttachmentItem:
|
|
28
32
|
self.consumed = False
|
29
33
|
self.size = 0
|
30
34
|
self.send = False
|
35
|
+
self.type = self.TYPE_FILE
|
31
36
|
|
32
37
|
def serialize(self) -> dict:
|
33
38
|
"""
|
@@ -44,6 +49,7 @@ class AttachmentItem:
|
|
44
49
|
'remote': self.remote,
|
45
50
|
'ctx': self.ctx,
|
46
51
|
'vector_store_ids': self.vector_store_ids,
|
52
|
+
'type': self.type,
|
47
53
|
'meta_id': self.meta_id,
|
48
54
|
'send': self.send
|
49
55
|
}
|
@@ -70,6 +76,8 @@ class AttachmentItem:
|
|
70
76
|
self.ctx = data['ctx']
|
71
77
|
if 'vector_store_ids' in data:
|
72
78
|
self.vector_store_ids = data['vector_store_ids']
|
79
|
+
if 'type' in data:
|
80
|
+
self.type = data['type']
|
73
81
|
if 'meta_id' in data:
|
74
82
|
self.meta_id = data['meta_id']
|
75
83
|
if 'send' in data:
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.11.
|
9
|
+
# Updated Date: 2024.11.26 04:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import os.path
|
@@ -140,7 +140,7 @@ class Runner:
|
|
140
140
|
|
141
141
|
# append to ctx
|
142
142
|
ctx.files = paths
|
143
|
-
ctx.images = images_list
|
143
|
+
ctx.images = self.plugin.window.core.filesystem.make_local_list(list(images_list))
|
144
144
|
return paths
|
145
145
|
|
146
146
|
def handle_result_ipython(self, ctx: CtxItem, response) -> str:
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.11.
|
9
|
+
# Updated Date: 2024.11.26 04:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from PySide6.QtCore import Slot, QTimer
|
@@ -141,7 +141,9 @@ class Plugin(BasePlugin):
|
|
141
141
|
self.window.controller.attachment.clear_silent()
|
142
142
|
path = self.window.controller.painter.capture.screenshot(attach_cursor=True,
|
143
143
|
silent=True) # attach screenshot
|
144
|
-
|
144
|
+
|
145
|
+
img_path = self.window.core.filesystem.make_local(path)
|
146
|
+
ctx.images.append(img_path)
|
145
147
|
#ctx.images_before.append(path)
|
146
148
|
|
147
149
|
context = BridgeContext()
|
@@ -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: 2024.11.26 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import json
|
@@ -143,6 +143,7 @@ class JsonFileProvider(BaseProvider):
|
|
143
143
|
'remote': attachment.remote,
|
144
144
|
'send': attachment.send,
|
145
145
|
'vector_store_ids': attachment.vector_store_ids,
|
146
|
+
'type': attachment.type,
|
146
147
|
}
|
147
148
|
|
148
149
|
@staticmethod
|
@@ -165,6 +166,8 @@ class JsonFileProvider(BaseProvider):
|
|
165
166
|
attachment.send = data['send']
|
166
167
|
if 'vector_store_ids' in data:
|
167
168
|
attachment.vector_store_ids = data['vector_store_ids']
|
169
|
+
if 'type' in data:
|
170
|
+
attachment.type = data['type']
|
168
171
|
|
169
172
|
def dump(self, item: AttachmentItem) -> str:
|
170
173
|
"""
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.11.26 04:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from llama_index.core.readers.base import BaseReader
|
@@ -75,6 +75,15 @@ class BaseLoader:
|
|
75
75
|
return args.get("url")
|
76
76
|
return ""
|
77
77
|
|
78
|
+
def is_supported_attachment(self, source: str) -> bool:
|
79
|
+
"""
|
80
|
+
Check if attachment is supported by loader
|
81
|
+
|
82
|
+
:param source: attachment source
|
83
|
+
:return: True if supported
|
84
|
+
"""
|
85
|
+
return False
|
86
|
+
|
78
87
|
def get(self) -> BaseReader:
|
79
88
|
"""
|
80
89
|
Get reader instance
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.11.26 04:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from llama_index.core.readers.base import BaseReader
|
@@ -52,3 +52,21 @@ class Loader(BaseLoader):
|
|
52
52
|
args = {}
|
53
53
|
args["ytlinks"] = [kwargs.get("url")] # list of links
|
54
54
|
return args
|
55
|
+
|
56
|
+
def is_supported_attachment(self, source: str) -> bool:
|
57
|
+
"""
|
58
|
+
Check if attachment is supported by loader
|
59
|
+
|
60
|
+
:param source: attachment source
|
61
|
+
:return: True if supported
|
62
|
+
"""
|
63
|
+
yt_prefix = [
|
64
|
+
"https://youtube.com",
|
65
|
+
"https://youtu.be",
|
66
|
+
"https://www.youtube.com",
|
67
|
+
"https://m.youtube.com",
|
68
|
+
]
|
69
|
+
for prefix in yt_prefix:
|
70
|
+
if source.startswith(prefix):
|
71
|
+
return True
|
72
|
+
return False
|