pygpt-net 2.5.16__py3-none-any.whl → 2.5.18__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 (48) hide show
  1. pygpt_net/CHANGELOG.txt +12 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/controller/chat/common.py +4 -2
  4. pygpt_net/controller/chat/input.py +36 -27
  5. pygpt_net/controller/chat/stream.py +22 -2
  6. pygpt_net/controller/config/placeholder.py +1 -1
  7. pygpt_net/controller/model/__init__.py +1 -1
  8. pygpt_net/controller/model/editor.py +6 -1
  9. pygpt_net/controller/model/importer.py +4 -3
  10. pygpt_net/core/bridge/__init__.py +8 -4
  11. pygpt_net/core/command/__init__.py +10 -1
  12. pygpt_net/core/idx/chat.py +6 -1
  13. pygpt_net/core/image/__init__.py +15 -0
  14. pygpt_net/core/models/__init__.py +14 -6
  15. pygpt_net/core/models/ollama.py +4 -3
  16. pygpt_net/data/config/config.json +6 -4
  17. pygpt_net/data/config/models.json +205 -34
  18. pygpt_net/data/config/modes.json +10 -10
  19. pygpt_net/data/config/settings.json +35 -0
  20. pygpt_net/data/config/settings_section.json +3 -0
  21. pygpt_net/data/locale/locale.de.ini +4 -1
  22. pygpt_net/data/locale/locale.en.ini +9 -2
  23. pygpt_net/data/locale/locale.es.ini +4 -1
  24. pygpt_net/data/locale/locale.fr.ini +4 -1
  25. pygpt_net/data/locale/locale.it.ini +3 -0
  26. pygpt_net/data/locale/locale.pl.ini +4 -1
  27. pygpt_net/data/locale/locale.uk.ini +4 -1
  28. pygpt_net/data/locale/locale.zh.ini +4 -1
  29. pygpt_net/item/model.py +35 -1
  30. pygpt_net/provider/core/config/patch.py +14 -0
  31. pygpt_net/provider/core/model/json_file.py +4 -1
  32. pygpt_net/provider/core/model/patch.py +17 -1
  33. pygpt_net/provider/gpt/__init__.py +14 -0
  34. pygpt_net/provider/gpt/image.py +42 -8
  35. pygpt_net/provider/gpt/responses.py +24 -17
  36. pygpt_net/provider/llms/anthropic.py +3 -1
  37. pygpt_net/provider/llms/google.py +3 -1
  38. pygpt_net/provider/llms/hugging_face.py +3 -1
  39. pygpt_net/provider/llms/hugging_face_api.py +3 -1
  40. pygpt_net/provider/llms/ollama.py +9 -3
  41. pygpt_net/provider/llms/ollama_custom.py +2 -0
  42. pygpt_net/provider/llms/openai.py +7 -1
  43. pygpt_net/ui/dialog/preset.py +1 -1
  44. {pygpt_net-2.5.16.dist-info → pygpt_net-2.5.18.dist-info}/METADATA +18 -6
  45. {pygpt_net-2.5.16.dist-info → pygpt_net-2.5.18.dist-info}/RECORD +48 -48
  46. {pygpt_net-2.5.16.dist-info → pygpt_net-2.5.18.dist-info}/LICENSE +0 -0
  47. {pygpt_net-2.5.16.dist-info → pygpt_net-2.5.18.dist-info}/WHEEL +0 -0
  48. {pygpt_net-2.5.16.dist-info → pygpt_net-2.5.18.dist-info}/entry_points.txt +0 -0
@@ -1027,6 +1027,11 @@
1027
1027
  "step": null,
1028
1028
  "advanced": false,
1029
1029
  "keys": [
1030
+ {"auto": "[gpt-image-1] auto"},
1031
+ {"1024x1024": "[gpt-image-1] 1024x1024"},
1032
+ {"1536x1024": "[gpt-image-1] 1536x1024"},
1033
+ {"1024x1536": "[gpt-image-1] 1024x1536"},
1034
+ {"1536x1024": "[gpt-image-1] 1536x1024"},
1030
1035
  {"1792x1024": "[DALL-E 3] 1792x1024"},
1031
1036
  {"1024x1792": "[DALL-E 3] 1024x1792"},
1032
1037
  {"1024x1024": "[DALL-E 3] 1024x1024"},
@@ -1047,6 +1052,10 @@
1047
1052
  "step": null,
1048
1053
  "advanced": false,
1049
1054
  "keys": [
1055
+ {"auto": "[gpt-image-1] auto"},
1056
+ {"high": "[gpt-image-1] high"},
1057
+ {"medium": "[gpt-image-1] medium"},
1058
+ {"medium": "[gpt-image-1] low"},
1050
1059
  {"standard": "[DALL-E 3] standard"},
1051
1060
  {"hd": "[DALL-E 3] hd"},
1052
1061
  {"standard": "[DALL-E 2] standard"}
@@ -1198,6 +1207,32 @@
1198
1207
  "step": null,
1199
1208
  "advanced": false
1200
1209
  },
1210
+ "remote_tools.web_search": {
1211
+ "section": "remote_tools",
1212
+ "type": "bool",
1213
+ "slider": false,
1214
+ "label": "settings.remote_tools.web_search",
1215
+ "description": "settings.remote_tools.web_search.desc",
1216
+ "value": true,
1217
+ "min": null,
1218
+ "max": null,
1219
+ "multiplier": null,
1220
+ "step": null,
1221
+ "advanced": false
1222
+ },
1223
+ "remote_tools.image": {
1224
+ "section": "remote_tools",
1225
+ "type": "bool",
1226
+ "slider": false,
1227
+ "label": "settings.remote_tools.image",
1228
+ "description": "settings.remote_tools.image.desc",
1229
+ "value": true,
1230
+ "min": null,
1231
+ "max": null,
1232
+ "multiplier": null,
1233
+ "step": null,
1234
+ "advanced": false
1235
+ },
1201
1236
  "llama.idx.list": {
1202
1237
  "section": "llama-index",
1203
1238
  "type": "dict",
@@ -14,6 +14,9 @@
14
14
  "ctx": {
15
15
  "label": "settings.section.ctx"
16
16
  },
17
+ "remote_tools": {
18
+ "label": "settings.section.remote_tools"
19
+ },
17
20
  "model": {
18
21
  "label": "settings.section.model"
19
22
  },
@@ -899,6 +899,8 @@ settings.prompt.expert = Experte: Masteraufforderung
899
899
  settings.prompt.expert.desc = Anweisung (Systemaufforderung) für den Master-Experten, wie man Sklavenexperten handhabt. Anweisungen für Sklavenexperten werden aus ihren Voreinstellungen gegeben.
900
900
  settings.prompt.img = DALL-E: Bildgenerierung
901
901
  settings.prompt.img.desc = Aufforderung zur Erzeugung von Anweisungen für DALL-E (falls Rohmodus deaktiviert ist). Nur im Bildmodus.
902
+ settings.remote_tools.web_search = Web Search
903
+ settings.remote_tools.web_search.desc = Aktiviert das `web_search` Remote-Tool im Chat-Modus / über die OpenAI Responses API.
902
904
  settings.render.code_syntax = Stil der Syntaxhervorhebung für Code
903
905
  settings.render.plain = Markdown-Formatierung in der Ausgabe deaktivieren (RAW-Textmodus)
904
906
  settings.restart.required = Ein Neustart der Anwendung ist notwendig, damit die Änderungen für diese Option übernommen werden.
@@ -918,6 +920,7 @@ settings.section.images = Bilder
918
920
  settings.section.layout = Layout
919
921
  settings.section.llama_index = Indizes (LlamaIndex)
920
922
  settings.section.model = Modelle
923
+ settings.section.remote_tools = Remote tools
921
924
  settings.section.updates = Aktualisierungen
922
925
  settings.section.vision = Vision
923
926
  settings.store_history = Verlauf speichern
@@ -986,7 +989,7 @@ tip.tokens.input = Token: Benutzereingabeaufforderung + Systemaufforderung + Kon
986
989
  tip.toolbox.assistants = Die Liste der Assistenten zeigt die erstellten Assistenten, die auf dem entfernten Server arbeiten. Alle Änderungen werden mit dem entfernten Assistenten synchronisiert.
987
990
  tip.toolbox.ctx = Erstellen Sie so viele Gesprächskontexte, wie Sie benötigen; Sie können jederzeit zu ihnen zurückkehren.
988
991
  tip.toolbox.indexes = Durch das Indizieren von Gesprächen und Dateien können Sie das verfügbare Wissen mit Ihren eigenen Daten und Gesprächsverläufen erweitern.
989
- tip.toolbox.mode = Sie können den Arbeitsmodus und das Modell in Echtzeit ändern. Um andere Modelle als GPT zu verwenden, nutzen Sie den Modus Chat mit Dateien.
992
+ tip.toolbox.mode = Sie können den Arbeitsmodus und das Modell in Echtzeit ändern.
990
993
  tip.toolbox.presets = Erstellen Sie Voreinstellungen mit verschiedenen Konfigurationen, um schnell zwischen verschiedenen Einstellungen wie dem Systemprompt und anderen zu wechseln.
991
994
  tip.toolbox.prompt = Die aktuelle Systemeingabeaufforderung kann in Echtzeit geändert werden. Um Werkzeuge aus Plugins zu aktivieren, aktivieren Sie die Option "+ Werkzeuge."
992
995
  toolbox.agent.auto_stop.label = Automatischer Stopp
@@ -816,7 +816,7 @@ model.llama_index.mode.desc = Available sub-modes: chat
816
816
  model.llama_index.provider = [LlamaIndex] Provider
817
817
  model.llama_index.provider.desc = LLM provider to use in "Chat with Files" mode
818
818
  model.mode = Mode(s)
819
- model.mode.desc = Available modes: chat, completion, img, audio, vision, assistant, langchain, llama_index, agent, agent_llama, research
819
+ model.mode.desc = Available modes: chat (Chat), llama_index (Chat with Files), audio (Chat with Audio), research (Research), completion (Completion), img (Image), vision (Vision), assistant (Assistants), langchain (Langchain), agent_llama (Agent LlamaIndex), agent (Agent Autonomous), expert (Experts)
820
820
  model.name = Name
821
821
  models.importer.all = Show all
822
822
  models.importer.available.label = Ollama models
@@ -829,6 +829,8 @@ models.importer.error.remove.no_model = No model selected to remove
829
829
  models.importer.error.remove.not_exists = Model already exists in current list
830
830
  models.importer.loaded = Ollama models loaded successfully.
831
831
  models.importer.status.imported = Models imported successfully.
832
+ model.openai = OpenAI API
833
+ model.openai.desc = Supports native OpenAI API
832
834
  model.tokens = Output tokens
833
835
  model.tokens.desc = Max model output tokens
834
836
  mode.research = Research (Perplexity)
@@ -1127,6 +1129,10 @@ settings.prompt.expert = Expert: Master prompt
1127
1129
  settings.prompt.expert.desc = Instruction (system prompt) for Master expert on how to handle slave experts. Instructions for slave experts are given from their presets.
1128
1130
  settings.prompt.img = DALL-E: image generation
1129
1131
  settings.prompt.img.desc = Prompt for generating prompts for DALL-E (if raw-mode is disabled). Image mode only.
1132
+ settings.remote_tools.web_search = Web Search
1133
+ settings.remote_tools.web_search.desc = Enable `web_search` remote tool in Chat mode / via OpenAI Responses API.
1134
+ settings.remote_tools.image = Image generation
1135
+ settings.remote_tools.image.desc = Enable `image_generation` remote tool in Chat mode / via OpenAI Responses API.
1130
1136
  settings.render.code_syntax = Code syntax highlight
1131
1137
  settings.render.engine = Rendering engine
1132
1138
  settings.render.open_gl = OpenGL hardware acceleration
@@ -1162,6 +1168,7 @@ settings.section.llama-index.store = Vector Store
1162
1168
  settings.section.llama-index.update = Update
1163
1169
  settings.section.model = Models
1164
1170
  settings.section.prompts = Prompts
1171
+ settings.section.remote_tools = Remote tools
1165
1172
  settings.section.tab.general = General
1166
1173
  settings.section.updates = Updates
1167
1174
  settings.section.vision = Vision
@@ -1235,7 +1242,7 @@ tip.tokens.input = Tokens: input prompt + system prompt + context + extra + atta
1235
1242
  tip.toolbox.assistants = The list of assistants shows the assistants created and operating on the remote server. Any changes will be synchronized with the remote assistant.
1236
1243
  tip.toolbox.ctx = Create as many conversation contexts as you need; you can return to them at any time.
1237
1244
  tip.toolbox.indexes = By indexing conversations and files, you can expand the available knowledge with your own data and conversation history.
1238
- tip.toolbox.mode = You can change the working mode and model in real-time. To use models other than GPT, use the Chat with Files mode.
1245
+ tip.toolbox.mode = You can change the working mode and model in real-time.
1239
1246
  tip.toolbox.presets = Create presets with different configurations to quickly switch between various settings, such as the system prompt and others.
1240
1247
  tip.toolbox.prompt = The current system prompt can be modified in real-time. To enable tools from plugins, enable the option "+ Tools."
1241
1248
  toolbox.agent.auto_stop.label = Auto-stop
@@ -899,6 +899,8 @@ settings.prompt.expert = Experto: Master prompt
899
899
  settings.prompt.expert.desc = Instrucción (prompt del sistema) para el experto Master cómo manejar a los expertos subordinados. Las instrucciones para los expertos subordinados se dan desde sus presets.
900
900
  settings.prompt.img = DALL-E: generación de imagen
901
901
  settings.prompt.img.desc = Mensaje para generar comandos para DALL-E (si el modo crudo está desactivado). Solo modo de imagen.
902
+ settings.remote_tools.web_search = Web Search
903
+ settings.remote_tools.web_search.desc = Habilitar la herramienta remota `web_search` en modo Chat / a través de la API de OpenAI Responses.
902
904
  settings.render.code_syntax = Estilo de resaltado de sintaxis de código
903
905
  settings.render.plain = Desactivar el formato markdown en la salida (modo de texto plano RAW)
904
906
  settings.restart.required = Es necesario reiniciar la aplicación para que los cambios en esta opción se apliquen.
@@ -918,6 +920,7 @@ settings.section.images = Imágenes
918
920
  settings.section.layout = Diseño
919
921
  settings.section.llama_index = Índices (LlamaIndex)
920
922
  settings.section.model = Modelos
923
+ settings.section.remote_tools = Remote tools
921
924
  settings.section.updates = Actualizaciones
922
925
  settings.section.vision = Visión
923
926
  settings.store_history = Almacenar historial
@@ -986,7 +989,7 @@ tip.tokens.input = Fichas: indicación del usuario + indicación del sistema + c
986
989
  tip.toolbox.assistants = La lista de asistentes muestra los asistentes creados y operando en el servidor remoto. Cualquier cambio se sincronizará con el asistente remoto.
987
990
  tip.toolbox.ctx = Crea tantos contextos de conversación como necesites; puedes volver a ellos en cualquier momento.
988
991
  tip.toolbox.indexes = Al indexar conversaciones y archivos, puedes ampliar el conocimiento disponible con tus propios datos e historial de conversaciones.
989
- tip.toolbox.mode = Puedes cambiar el modo de trabajo y el modelo en tiempo real. Para usar modelos distintos a GPT, utiliza el modo Chat con archivos.
992
+ tip.toolbox.mode = Puedes cambiar el modo de trabajo y el modelo en tiempo real.
990
993
  tip.toolbox.presets = Crea preajustes con diferentes configuraciones para cambiar rápidamente entre varios ajustes, como el prompt del sistema y otros.
991
994
  tip.toolbox.prompt = La solicitud del sistema actual se puede modificar en tiempo real. Para habilitar herramientas desde complementos, habilite la opción "+ Herramientas."
992
995
  toolbox.agent.auto_stop.label = Auto-parada
@@ -899,6 +899,8 @@ settings.prompt.expert = Expert : Master prompt
899
899
  settings.prompt.expert.desc = Instruction (prompt système) pour l'expert Master sur comment gérer les experts esclaves. Les instructions pour les experts esclaves sont données à partir de leurs presets.
900
900
  settings.prompt.img = DALL-E: génération d'image
901
901
  settings.prompt.img.desc = Prompt pour générer des commandes pour DALL-E (si le mode brut est désactivé). Mode image uniquement.
902
+ settings.remote_tools.web_search = Web Search
903
+ settings.remote_tools.web_search.desc = Activer l'outil distant `web_search` en mode Chat / via l'API OpenAI Responses.
902
904
  settings.render.code_syntax = Style de mise en évidence de la syntaxe du code
903
905
  settings.render.plain = Désactiver le formatage markdown dans la sortie (mode texte brut RAW)
904
906
  settings.restart.required = Un redémarrage de l'application est requis pour que les modifications de cette option soient appliquées.
@@ -918,6 +920,7 @@ settings.section.images = Images
918
920
  settings.section.layout = Mise en page
919
921
  settings.section.llama_index = Indexes (LlamaIndex)
920
922
  settings.section.model = Modèles
923
+ settings.section.remote_tools = Remote tools
921
924
  settings.section.updates = Mises à jour
922
925
  settings.section.vision = Vision
923
926
  settings.store_history = Stocker l'historique
@@ -986,7 +989,7 @@ tip.tokens.input = Jetons: invite de l'utilisateur + invite système + contexte
986
989
  tip.toolbox.assistants = La liste des assistants montre les assistants créés et opérant sur le serveur distant. Tout changement sera synchronisé avec l'assistant distant.
987
990
  tip.toolbox.ctx = Créez autant de contextes de conversation que vous en avez besoin ; vous pouvez y revenir à tout moment.
988
991
  tip.toolbox.indexes = En indexant des conversations et des fichiers, vous pouvez étendre les connaissances disponibles avec vos propres données et historique de conversation.
989
- tip.toolbox.mode = Vous pouvez changer le mode de travail et le modèle en temps réel. Pour utiliser des modèles autres que GPT, utilisez le mode Chat avec fichiers.
992
+ tip.toolbox.mode = Vous pouvez changer le mode de travail et le modèle en temps réel.
990
993
  tip.toolbox.presets = Créez des préréglages avec différentes configurations pour basculer rapidement entre divers réglages, tels que l'invite système et d'autres.
991
994
  tip.toolbox.prompt = L'invite système actuelle peut être modifiée en temps réel. Pour activer les outils à partir des plugins, activez l'option "+ Outils."
992
995
  toolbox.agent.auto_stop.label = Arrêt automatique
@@ -900,6 +900,8 @@ settings.prompt.expert = Esperto: Master prompt
900
900
  settings.prompt.expert.desc = Istruzione (prompt del sistema) per l'esperto Master su come gestire gli esperti subalterni. Le istruzioni per gli esperti subalterni sono date dalle loro preimpostazioni.
901
901
  settings.prompt.img = DALL-E: generazione immagine
902
902
  settings.prompt.img.desc = Prompt per generare comandi per DALL-E (se la modalità grezza è disabilitata). Solo modalità immagine.
903
+ settings.remote_tools.web_search = Web Search
904
+ settings.remote_tools.web_search.desc = Abilita lo strumento remoto `web_search` in modalità Chat / tramite OpenAI Responses API.
903
905
  settings.render.code_syntax = Stile di evidenziazione della sintassi del codice
904
906
  settings.restart.required = È necessario riavviare l'applicazione affinché le modifiche a questa opzione siano applicate.
905
907
  settings.section.access = Accessibilità
@@ -918,6 +920,7 @@ settings.section.images = Immagini
918
920
  settings.section.layout = Layout
919
921
  settings.section.llama_index = Indici (LlamaIndex)
920
922
  settings.section.model = Modelli
923
+ settings.section.remote_tools = Remote tools
921
924
  settings.section.updates = Aggiornamenti
922
925
  settings.section.vision = Visione
923
926
  settings.store_history = Conserva la cronologia
@@ -900,6 +900,8 @@ settings.prompt.expert = Ekspert: Główna wskazówka
900
900
  settings.prompt.expert.desc = Instrukcja (systemowa wskazówka) dla głównego eksperta, jak obsługiwać ekspertów pomocniczych. Instrukcje dla ekspertów pomocniczych są podawane z ich ustawień.
901
901
  settings.prompt.img = DALL-E: generowanie obrazu
902
902
  settings.prompt.img.desc = Prompt do generowania poleceń dla DALL-E (jeśli surowy tryb jest wyłączony). Tylko tryb obrazu.
903
+ settings.remote_tools.web_search = Web Search
904
+ settings.remote_tools.web_search.desc = Włącz zdalne narzędzie `web_search` w trybie czatu / używając OpenAI Responses API.
903
905
  settings.render.code_syntax = Styl podświetlenia składni kodu
904
906
  settings.render.plain = Wyłącz formatowanie markdown w wyjściu (tryb plain-text)
905
907
  settings.restart.required = Restart aplikacji jest wymagany, aby zmiany dla tej opcji zostały wprowadzone.
@@ -919,6 +921,7 @@ settings.section.images = Obrazy
919
921
  settings.section.layout = Wygląd
920
922
  settings.section.llama_index = Indeksy (LlamaIndex)
921
923
  settings.section.model = Modele
924
+ settings.section.remote_tools = Zdalne narzędzia
922
925
  settings.section.updates = Aktualizacje
923
926
  settings.section.vision = Wizja
924
927
  settings.store_history = Zapisuj historię
@@ -987,7 +990,7 @@ tip.tokens.input = Tokeny: prompt użytkownika + systemowy prompt + kontekst + d
987
990
  tip.toolbox.assistants = Lista asystentów pokazuje asystentów stworzonych i działających na zdalnym serwerze. Wszelkie zmiany zostaną zsynchronizowane ze zdalnym asystentem.
988
991
  tip.toolbox.ctx = Twórz tyle kontekstów rozmów, ile potrzebujesz; możesz do nich wrócić w dowolnym momencie.
989
992
  tip.toolbox.indexes = Indeksując rozmowy i pliki, możesz rozszerzyć dostępną wiedzę o własne dane i historię rozmów.
990
- tip.toolbox.mode = Możesz zmienić tryb pracy i model w czasie rzeczywistym. Aby użyć modeli innych niż GPT, użyj trybu Czat z plikami.
993
+ tip.toolbox.mode = Możesz zmienić tryb pracy i model w czasie rzeczywistym.
991
994
  tip.toolbox.presets = Twórz presety z różnymi konfiguracjami, aby szybko przełączać się między różnymi ustawieniami, takimi jak prompt systemowy i inne.
992
995
  tip.toolbox.prompt = Aktualna podpowiedź systemu może być modyfikowana w czasie rzeczywistym. Aby włączyć narzędzia z wtyczek, włącz opcję "+ Narzędzia."
993
996
  toolbox.agent.auto_stop.label = Auto-stop
@@ -899,6 +899,8 @@ settings.prompt.expert = Експерт: Основний запит
899
899
  settings.prompt.expert.desc = Інструкція (системний запит) для ведучого експерта, як керувати підеекспертами. Інструкції для підеекспертів даються з їхніх налаштувань.
900
900
  settings.prompt.img = DALL-E: генерація зображення
901
901
  settings.prompt.img.desc = Підказка для генерації команддля DALL-E (якщо вимкнено сирівний режим). Тільки режим зображення.
902
+ settings.remote_tools.web_search = Web Search
903
+ settings.remote_tools.web_search.desc = Увімкнути віддалений інструмент `web_search` у режимі чату / через API відповідей OpenAI.
902
904
  settings.render.code_syntax = Стиль підсвічування синтаксису коду
903
905
  settings.render.plain = Вимкнути форматування markdown у виводі (режим простого тексту RAW)
904
906
  settings.restart.required = Для внесення змін у цю опцію необхідно перезапустити програму.
@@ -918,6 +920,7 @@ settings.section.images = Зображення
918
920
  settings.section.layout = Макет
919
921
  settings.section.llama_index = Індекси (LlamaIndex)
920
922
  settings.section.model = Моделі
923
+ settings.section.remote_tools = Remote tools
921
924
  settings.section.updates = Оновлення
922
925
  settings.section.vision = Візія
923
926
  settings.store_history = Зберігати історію
@@ -986,7 +989,7 @@ tip.tokens.input = Токени: запит користувача + систе
986
989
  tip.toolbox.assistants = Список асистентів показує асистентів, створених і що працюють на віддаленому сервері. Будь-які зміни будуть синхронізовані з віддаленим асистентом.
987
990
  tip.toolbox.ctx = Створіть стільки контекстів розмов, як вам потрібно; ви можете повернутися до них у будь-який час.
988
991
  tip.toolbox.indexes = Індексуючи розмови та файли, ви можете розширити доступні знання зі своїми власними даними та історією розмов.
989
- tip.toolbox.mode = Ви можете змінити робочий режим та модель в реальному часі. Щоб використовувати моделі, відмінні від GPT, використовуйте режим Чат з файлами.
992
+ tip.toolbox.mode = Ви можете змінити робочий режим та модель в реальному часі.
990
993
  tip.toolbox.presets = Створіть пресети з різними конфігураціями для швидкого перемикання між різними налаштуваннями, такими як системний сповіщення та інші.
991
994
  tip.toolbox.prompt = Поточну системну підказку можна змінювати в режимі реального часу. Щоб увімкнути інструменти з плагінів, увімкніть опцію "+ Інструменти."
992
995
  toolbox.agent.auto_stop.label = Авто-стоп
@@ -1008,6 +1008,8 @@ settings.prompt.expert = 专家:主提示
1008
1008
  settings.prompt.expert.desc = 对主专家如何处理奴隶专家的指令(系统提示)。奴隶专家的指令根据他们的预设给出。
1009
1009
  settings.prompt.img = DALL-E:生成图像
1010
1010
  settings.prompt.img.desc = 提示用于生成DALL-E的命令(如果原始模式被禁用)。仅图像模式。
1011
+ settings.remote_tools.web_search = Web Search
1012
+ settings.remote_tools.web_search.desc = 在聊天模式/通过 OpenAI Responses API 启用 `web_search` 远程工具。
1011
1013
  settings.render.code_syntax = 代码语法高亮样式
1012
1014
  settings.render.plain = 在輸出中禁用markdown格式化(RAW純文本模式)
1013
1015
  settings.restart.required = 此選項生效需要重新啟動應用程序。
@@ -1032,6 +1034,7 @@ settings.section.llama-index.indexing = 索引
1032
1034
  settings.section.llama-index.store = 向量存儲
1033
1035
  settings.section.llama-index.update = 更新
1034
1036
  settings.section.model = 模型
1037
+ settings.section.remote_tools = Remote tools
1035
1038
  settings.section.tab.general = 一般設置
1036
1039
  settings.section.updates = 更新
1037
1040
  settings.section.vision = 視覺
@@ -1101,7 +1104,7 @@ tip.tokens.input = 代币:用户输入提示 + 系统提示 + 上下文 + 额
1101
1104
  tip.toolbox.assistants = 助手列表顯示在遠程服務器上創建和運行的助手。任何更改都將與遠程助手同步。
1102
1105
  tip.toolbox.ctx = 創建所需數量的對話上下文;您隨時可以返回它們。
1103
1106
  tip.toolbox.indexes = 通過索引對話和文件,您可以用自己的數據和對話歷史擴展可用知識。
1104
- tip.toolbox.mode = 您可以實時更換工作模式和模型。要使用非GPT模型,请使用“文件聊天模式”模式。
1107
+ tip.toolbox.mode = 您可以實時更換工作模式和模型。
1105
1108
  tip.toolbox.presets = 創建具有不同配置的預設,以便快速切換不同設置,例如系統提示等。
1106
1109
  tip.toolbox.prompt = 当前系统提示可以实时修改。要启用来自插件的工具,请启用“+ 工具”选项。
1107
1110
  toolbox.agent.auto_stop.label = 自動停止
pygpt_net/item/model.py CHANGED
@@ -6,11 +6,13 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.06.24 16:00:00 #
9
+ # Updated Date: 2025.06.26 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
13
13
 
14
+ from pygpt_net.core.types import MODE_CHAT
15
+
14
16
 
15
17
  class ModelItem:
16
18
  def __init__(self, id=None):
@@ -29,6 +31,7 @@ class ModelItem:
29
31
  self.tokens = 0
30
32
  self.default = False
31
33
  self.imported = False
34
+ self.openai = False # OpenAI API supported model
32
35
  self.extra = {}
33
36
 
34
37
  def from_dict(self, data: dict):
@@ -54,6 +57,8 @@ class ModelItem:
54
57
  self.extra = data['extra']
55
58
  if 'imported' in data:
56
59
  self.imported = data['imported']
60
+ if 'openai' in data:
61
+ self.openai = data['openai']
57
62
 
58
63
  # multimodal
59
64
  if 'multimodal' in data:
@@ -105,6 +110,7 @@ class ModelItem:
105
110
  data['multimodal'] = ','.join(self.multimodal)
106
111
  data['extra'] = self.extra
107
112
  data['imported'] = self.imported
113
+ data['openai'] = self.openai
108
114
 
109
115
  data['langchain.provider'] = None
110
116
  data['langchain.mode'] = ""
@@ -178,6 +184,9 @@ class ModelItem:
178
184
  :param mode: Mode
179
185
  :return: True if supported
180
186
  """
187
+ if mode == MODE_CHAT and not self.is_openai():
188
+ # only OpenAI models are supported for chat mode
189
+ return False
181
190
  return mode in self.mode
182
191
 
183
192
  def is_multimodal(self) -> bool:
@@ -188,6 +197,21 @@ class ModelItem:
188
197
  """
189
198
  return len(self.multimodal) > 0
190
199
 
200
+ def is_openai(self) -> bool:
201
+ """
202
+ Check if model is supported by OpenAI API
203
+
204
+ :return: True if OpenAI
205
+ """
206
+ if (self.id.startswith("gpt-")
207
+ or self.id.startswith("chatgpt")
208
+ or self.id.startswith("o1")
209
+ or self.id.startswith("o3")
210
+ or self.id.startswith("o4")
211
+ or self.id.startswith("o5")):
212
+ return True
213
+ return False
214
+
191
215
  def is_ollama(self) -> bool:
192
216
  """
193
217
  Check if model is Ollama
@@ -196,6 +220,8 @@ class ModelItem:
196
220
  """
197
221
  if self.llama_index is None:
198
222
  return False
223
+ if self.llama_index.get("provider") is None:
224
+ return False
199
225
  return "ollama" in self.llama_index.get("provider", "")
200
226
 
201
227
  def get_ollama_model(self) -> str:
@@ -210,6 +236,14 @@ class ModelItem:
210
236
  return arg["value"]
211
237
  return ""
212
238
 
239
+ def get_llama_provider(self) -> str:
240
+ """
241
+ Get Llama Index provider
242
+
243
+ :return: provider name
244
+ """
245
+ return self.llama_index.get("provider", "")
246
+
213
247
  def has_mode(self, mode: str) -> bool:
214
248
  """
215
249
  Check if model has mode
@@ -1855,6 +1855,20 @@ class Patch:
1855
1855
  data["api_endpoint_perplexity"] = "https://api.perplexity.ai"
1856
1856
  updated = True
1857
1857
 
1858
+ # < 2.5.17
1859
+ if old < parse_version("2.5.17"):
1860
+ print("Migrating config from < 2.5.17...")
1861
+ if 'remote_tools.web_search' not in data:
1862
+ data["remote_tools.web_search"] = True
1863
+ updated = True
1864
+
1865
+ # < 2.5.18
1866
+ if old < parse_version("2.5.18"):
1867
+ print("Migrating config from < 2.5.18...")
1868
+ if 'remote_tools.image' not in data:
1869
+ data["remote_tools.image"] = False
1870
+ updated = True
1871
+
1858
1872
  # update file
1859
1873
  migrated = False
1860
1874
  if updated:
@@ -6,7 +6,7 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.02.02 02:00:00 #
9
+ # Updated Date: 2025.06.26 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
@@ -166,6 +166,7 @@ class JsonFileProvider(BaseProvider):
166
166
  'multimodal': item.multimodal,
167
167
  'extra': item.extra,
168
168
  'imported': item.imported,
169
+ 'openai': item.openai,
169
170
  }
170
171
 
171
172
  @staticmethod
@@ -198,6 +199,8 @@ class JsonFileProvider(BaseProvider):
198
199
  item.extra = data['extra']
199
200
  if 'imported' in data:
200
201
  item.imported = data['imported']
202
+ if 'openai' in data:
203
+ item.openai = data['openai']
201
204
 
202
205
  def dump(self, item: ModelItem) -> str:
203
206
  """
@@ -6,7 +6,7 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.06.24 16:00:00 #
9
+ # Updated Date: 2025.06.26 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from packaging.version import parse as parse_version, Version
@@ -550,6 +550,22 @@ class Patch:
550
550
  del data[name_to_replace]
551
551
  updated = True
552
552
 
553
+ # < 2.5.18 <--- update openai flag
554
+ if old < parse_version("2.5.18"):
555
+ print("Migrating models from < 2.5.18...")
556
+ for id in data:
557
+ model = data[id]
558
+ if (model.id.startswith("o1")
559
+ or model.id.startswith("o3")
560
+ or model.id.startswith("gpt-")
561
+ or model.id.startswith("chatgpt")
562
+ or model.id.startswith("dall-e")):
563
+ model.openai = True
564
+ if model.is_supported("llama_index"):
565
+ if "chat" not in model.mode:
566
+ model.mode.append("chat")
567
+ updated = True
568
+
553
569
  # update file
554
570
  if updated:
555
571
  data = dict(sorted(data.items()))
@@ -8,6 +8,7 @@
8
8
  # Created By : Marcin Szczygliński #
9
9
  # Updated Date: 2025.06.25 02:00:00 #
10
10
  # ================================================== #
11
+ import base64
11
12
 
12
13
  from httpx_socks import SyncProxyTransport
13
14
 
@@ -271,6 +272,19 @@ class Gpt:
271
272
  response.usage.input_tokens,
272
273
  response.usage.output_tokens,
273
274
  )
275
+ if mode == MODE_CHAT:
276
+ # if image generation call in responses API
277
+ image_data = [
278
+ output.result
279
+ for output in response.output
280
+ if output.type == "image_generation_call"
281
+ ]
282
+ if image_data:
283
+ img_path = self.window.core.image.gen_unique_path(ctx)
284
+ image_base64 = image_data[0]
285
+ with open(img_path, "wb") as f:
286
+ f.write(base64.b64decode(image_base64))
287
+ ctx.images = [img_path]
274
288
  return True
275
289
 
276
290
  def quick_call(self, context: BridgeContext, extra: dict = None) -> str:
@@ -6,9 +6,9 @@
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.12.14 22:00:00 #
9
+ # Updated Date: 2025.06.26 18:00:00 #
10
10
  # ================================================== #
11
-
11
+ import base64
12
12
  import datetime
13
13
  import os
14
14
  from typing import Optional, Dict, Any
@@ -132,6 +132,7 @@ class ImageWorker(QObject, QRunnable):
132
132
  self.allowed_max_num = {
133
133
  "dall-e-2": 4,
134
134
  "dall-e-3": 1,
135
+ "gpt-image-1": 1,
135
136
  }
136
137
  self.allowed_resolutions = {
137
138
  "dall-e-2": [
@@ -144,6 +145,27 @@ class ImageWorker(QObject, QRunnable):
144
145
  "1024x1792",
145
146
  "1024x1024",
146
147
  ],
148
+ "gpt-image-1": [
149
+ "1536x1024",
150
+ "1024x1536",
151
+ "1024x1024",
152
+ "auto",
153
+ ],
154
+ }
155
+ self.allowed_quality = {
156
+ "dall-e-2": [
157
+ "standard",
158
+ ],
159
+ "dall-e-3": [
160
+ "standard",
161
+ "hd",
162
+ ],
163
+ "gpt-image-1": [
164
+ "auto",
165
+ "high",
166
+ "medium",
167
+ "low",
168
+ ],
147
169
  }
148
170
 
149
171
  @Slot()
@@ -188,6 +210,11 @@ class ImageWorker(QObject, QRunnable):
188
210
  if resolution not in self.allowed_resolutions[self.model]:
189
211
  resolution = self.allowed_resolutions[self.model][0]
190
212
 
213
+ quality = self.quality
214
+ if self.model in self.allowed_quality:
215
+ if quality not in self.allowed_quality[self.model]:
216
+ quality = self.allowed_quality[self.model][0]
217
+
191
218
  # send to API
192
219
  response = None
193
220
  if self.model == "dall-e-2":
@@ -197,12 +224,12 @@ class ImageWorker(QObject, QRunnable):
197
224
  n=self.num,
198
225
  size=resolution,
199
226
  )
200
- elif self.model == "dall-e-3":
227
+ elif self.model == "dall-e-3" or self.model == "gpt-image-1":
201
228
  response = self.client.images.generate(
202
229
  model=self.model,
203
230
  prompt=self.input_prompt,
204
231
  n=self.num,
205
- quality=self.quality,
232
+ quality=quality,
206
233
  size=resolution,
207
234
  )
208
235
 
@@ -215,20 +242,27 @@ class ImageWorker(QObject, QRunnable):
215
242
  for i in range(self.num):
216
243
  if i >= len(response.data):
217
244
  break
218
- url = response.data[i].url
219
- res = requests.get(url)
220
245
 
221
246
  # generate filename
222
247
  name = datetime.date.today().strftime(
223
248
  "%Y-%m-%d") + "_" + datetime.datetime.now().strftime("%H-%M-%S") + "-" \
224
- + self.window.core.image.make_safe_filename(self.input_prompt) + "-" + str(i + 1) + ".png"
249
+ + self.window.core.image.make_safe_filename(self.input_prompt) + "-" + str(i + 1) + ".png"
225
250
  path = os.path.join(self.window.core.config.get_user_dir("img"), name)
226
251
 
227
252
  msg = trans('img.status.downloading') + " (" + str(i + 1) + " / " + str(self.num) + ") -> " + str(path)
228
253
  self.signals.status.emit(msg)
229
254
 
255
+ if response.data[i] is None:
256
+ self.signals.error.emit("API Error: empty image data")
257
+ return
258
+ if response.data[i].url: # dall-e 2 and 3 returns URL
259
+ res = requests.get(response.data[i].url)
260
+ data = res.content
261
+ else: # gpt-image-1 returns base64 encoded image
262
+ data = base64.b64decode(response.data[i].b64_json)
263
+
230
264
  # save image
231
- if self.window.core.image.save_image(path, res.content):
265
+ if data and self.window.core.image.save_image(path, data):
232
266
  paths.append(path)
233
267
  else:
234
268
  self.signals.error.emit("Error saving image")