pygpt-net 2.6.59__py3-none-any.whl → 2.6.61__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 (91) hide show
  1. pygpt_net/CHANGELOG.txt +11 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +9 -5
  4. pygpt_net/controller/__init__.py +1 -0
  5. pygpt_net/controller/chat/common.py +115 -6
  6. pygpt_net/controller/chat/input.py +4 -1
  7. pygpt_net/controller/presets/editor.py +442 -39
  8. pygpt_net/controller/presets/presets.py +121 -6
  9. pygpt_net/controller/settings/editor.py +0 -15
  10. pygpt_net/controller/theme/markdown.py +2 -5
  11. pygpt_net/controller/ui/ui.py +4 -7
  12. pygpt_net/core/agents/custom/__init__.py +281 -0
  13. pygpt_net/core/agents/custom/debug.py +64 -0
  14. pygpt_net/core/agents/custom/factory.py +109 -0
  15. pygpt_net/core/agents/custom/graph.py +71 -0
  16. pygpt_net/core/agents/custom/llama_index/__init__.py +10 -0
  17. pygpt_net/core/agents/custom/llama_index/factory.py +100 -0
  18. pygpt_net/core/agents/custom/llama_index/router_streamer.py +106 -0
  19. pygpt_net/core/agents/custom/llama_index/runner.py +562 -0
  20. pygpt_net/core/agents/custom/llama_index/stream.py +56 -0
  21. pygpt_net/core/agents/custom/llama_index/utils.py +253 -0
  22. pygpt_net/core/agents/custom/logging.py +50 -0
  23. pygpt_net/core/agents/custom/memory.py +51 -0
  24. pygpt_net/core/agents/custom/router.py +155 -0
  25. pygpt_net/core/agents/custom/router_streamer.py +187 -0
  26. pygpt_net/core/agents/custom/runner.py +455 -0
  27. pygpt_net/core/agents/custom/schema.py +127 -0
  28. pygpt_net/core/agents/custom/utils.py +193 -0
  29. pygpt_net/core/agents/provider.py +72 -7
  30. pygpt_net/core/agents/runner.py +7 -4
  31. pygpt_net/core/agents/runners/helpers.py +1 -1
  32. pygpt_net/core/agents/runners/llama_workflow.py +3 -0
  33. pygpt_net/core/agents/runners/openai_workflow.py +8 -1
  34. pygpt_net/core/db/viewer.py +11 -5
  35. pygpt_net/{ui/widget/builder → core/node_editor}/__init__.py +2 -2
  36. pygpt_net/core/{builder → node_editor}/graph.py +28 -226
  37. pygpt_net/core/node_editor/models.py +118 -0
  38. pygpt_net/core/node_editor/types.py +78 -0
  39. pygpt_net/core/node_editor/utils.py +17 -0
  40. pygpt_net/core/presets/presets.py +216 -29
  41. pygpt_net/core/render/markdown/parser.py +0 -2
  42. pygpt_net/core/render/web/renderer.py +10 -8
  43. pygpt_net/data/config/config.json +5 -6
  44. pygpt_net/data/config/models.json +3 -3
  45. pygpt_net/data/config/settings.json +2 -38
  46. pygpt_net/data/locale/locale.de.ini +64 -1
  47. pygpt_net/data/locale/locale.en.ini +63 -4
  48. pygpt_net/data/locale/locale.es.ini +64 -1
  49. pygpt_net/data/locale/locale.fr.ini +64 -1
  50. pygpt_net/data/locale/locale.it.ini +64 -1
  51. pygpt_net/data/locale/locale.pl.ini +65 -2
  52. pygpt_net/data/locale/locale.uk.ini +64 -1
  53. pygpt_net/data/locale/locale.zh.ini +64 -1
  54. pygpt_net/data/locale/plugin.cmd_system.en.ini +62 -66
  55. pygpt_net/item/agent.py +5 -1
  56. pygpt_net/item/preset.py +19 -1
  57. pygpt_net/provider/agents/base.py +33 -2
  58. pygpt_net/provider/agents/llama_index/flow_from_schema.py +92 -0
  59. pygpt_net/provider/agents/openai/flow_from_schema.py +96 -0
  60. pygpt_net/provider/core/agent/json_file.py +11 -5
  61. pygpt_net/provider/core/config/patch.py +10 -1
  62. pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +0 -6
  63. pygpt_net/tools/agent_builder/tool.py +233 -52
  64. pygpt_net/tools/agent_builder/ui/dialogs.py +172 -28
  65. pygpt_net/tools/agent_builder/ui/list.py +37 -10
  66. pygpt_net/ui/__init__.py +2 -4
  67. pygpt_net/ui/dialog/about.py +58 -38
  68. pygpt_net/ui/dialog/db.py +142 -3
  69. pygpt_net/ui/dialog/preset.py +62 -8
  70. pygpt_net/ui/layout/toolbox/presets.py +52 -16
  71. pygpt_net/ui/main.py +1 -1
  72. pygpt_net/ui/widget/dialog/db.py +0 -0
  73. pygpt_net/ui/widget/lists/preset.py +644 -60
  74. pygpt_net/{core/builder → ui/widget/node_editor}/__init__.py +2 -2
  75. pygpt_net/ui/widget/node_editor/command.py +373 -0
  76. pygpt_net/ui/widget/node_editor/config.py +157 -0
  77. pygpt_net/ui/widget/node_editor/editor.py +2070 -0
  78. pygpt_net/ui/widget/node_editor/item.py +493 -0
  79. pygpt_net/ui/widget/node_editor/node.py +1460 -0
  80. pygpt_net/ui/widget/node_editor/utils.py +17 -0
  81. pygpt_net/ui/widget/node_editor/view.py +364 -0
  82. pygpt_net/ui/widget/tabs/output.py +1 -1
  83. pygpt_net/ui/widget/textarea/input.py +2 -2
  84. pygpt_net/utils.py +114 -2
  85. {pygpt_net-2.6.59.dist-info → pygpt_net-2.6.61.dist-info}/METADATA +80 -93
  86. {pygpt_net-2.6.59.dist-info → pygpt_net-2.6.61.dist-info}/RECORD +88 -61
  87. pygpt_net/core/agents/custom.py +0 -150
  88. pygpt_net/ui/widget/builder/editor.py +0 -2001
  89. {pygpt_net-2.6.59.dist-info → pygpt_net-2.6.61.dist-info}/LICENSE +0 -0
  90. {pygpt_net-2.6.59.dist-info → pygpt_net-2.6.61.dist-info}/WHEEL +0 -0
  91. {pygpt_net-2.6.59.dist-info → pygpt_net-2.6.61.dist-info}/entry_points.txt +0 -0
@@ -43,6 +43,7 @@ action.profile.delete = Видалити профіль (лише зі спис
43
43
  action.profile.delete_all = Видалити профіль (і всі файли користувача)
44
44
  action.redo = Повторити
45
45
  action.refresh = Оновити
46
+ action.reload: Перезавантажити
46
47
  action.rename = Перейменувати
47
48
  action.reset = Скинути
48
49
  action.restore = Відновити
@@ -50,7 +51,8 @@ action.save = Зберегти
50
51
  action.save_as = Зберегти як...
51
52
  action.save_selection_as = Зберегти вибір як...
52
53
  action.select_all = Вибрати все
53
- action.tab.add.chat = Додати новий чат
54
+ action.tab.add.chat: Додати новий чат
55
+ action.tab.add.chat.tooltip: Додати новий чат (ПКМ для більше опцій...)
54
56
  action.tab.add.notepad = Додати новий блокнот
55
57
  action.tab.add.tool = Додати новий інструмент
56
58
  action.tab.close = Закрити
@@ -72,6 +74,8 @@ action.use.read_cmd = Попросіть прочитати цей файл...
72
74
  action.video.open = Відкрити відео або аудіо...
73
75
  action.video.play = Відтворити відео або аудіо...
74
76
  action.video.transcribe = Транскрибувати аудіо...
77
+ agent.builder.title = Редактор Агентів
78
+ agent.builder.tooltip = Відкрити Редактор Агентів
75
79
  agent.coder.additional.label = Додаткова підказка
76
80
  agent.coder.additional.prompt.desc = Додаткова підказка для агента (буде додано до базової підказки)
77
81
  agent.coder.base.label = Базова підказка
@@ -101,6 +105,7 @@ agent.option.prompt.planner.desc = Підказка для планувальн
101
105
  agent.option.prompt.search.desc = Підказка для пошукового агента
102
106
  agent.option.prompt.supervisor.desc = Підказка для супервізора
103
107
  agent.option.prompt.worker.desc = Підказка для працівника
108
+ agent.option.role = Короткий опис роботи агента для інструкцій моделі (необов'язково)
104
109
  agent.option.section.base = Базовий агент
105
110
  agent.option.section.chooser = Вибирач
106
111
  agent.option.section.feedback = Відгук
@@ -239,6 +244,8 @@ clipboard.copied_to = Скопійовано до буфера обміну:
239
244
  cmd.enabled = + Інструменти
240
245
  cmd.tip = Порада: Щоб увімкнути виконання інструментів із плагінів, ви повинні увімкнути опцію "+ Інструменти".
241
246
  coming_soon = Незабаром...
247
+ common.down = Перемістити вниз
248
+ common.up = Перемістити вгору
242
249
  confirm.assistant.delete = Видалити помічника?
243
250
  confirm.assistant.files.clear = Очистити файли (лише локально)?
244
251
  confirm.assistant.files.truncate = Ви впевнені, що хочете видалити усі файли з усіх баз?
@@ -678,6 +685,8 @@ html_canvas.clear.confirm = Очистити вихідні дані HTML-кан
678
685
  icon.audio.input = Увімкнути/вимкнути аудіовхід
679
686
  icon.audio.output = Увімкнути/вимкнути аудіовихід
680
687
  icon.remote_tool.web = Пошук у мережі (віддалений інструмент, не локальний інструмент)
688
+ icon.remote_tool.web.disabled: Пошук в Інтернеті (віддалений інструмент, не локальний) - вимкнено
689
+ icon.remote_tool.web.enabled: Пошук в Інтернеті (віддалений інструмент, не локальний) - увімкнено
681
690
  icon.video.capture = Увімкнути/вимкнути захоплення відео з камери
682
691
  idx.btn.clear = Очистити індекс
683
692
  idx.btn.index_all = Індексувати все
@@ -773,6 +782,7 @@ menu.config.save = Зберегти конфігурацію
773
782
  menu.config.settings = Налаштування...
774
783
  menu.debug = Відладка
775
784
  menu.debug.agent = Агент...
785
+ menu.debug.agent_builder = Редактор Агентів
776
786
  menu.debug.app.log = Переглянути файл логів (app.log)
777
787
  menu.debug.assistants = Помічники...
778
788
  menu.debug.attachments = Файли / вкладення...
@@ -826,6 +836,7 @@ menu.theme.style = Стиль...
826
836
  menu.theme.syntax = Підсвітка синтаксису коду...
827
837
  menu.theme.tooltips = Показувати підказки
828
838
  menu.tools = Інструменти
839
+ menu.tools.agent.builder = Редактор Агентів
829
840
  menu.tools.audio.transcribe = Транскрибувати аудіо/відео файли
830
841
  menu.tools.html_canvas = HTML/JS Canvas
831
842
  menu.tools.image.viewer = Переглядач зображень
@@ -933,6 +944,57 @@ multimodal.audio = Аудіо
933
944
  multimodal.image = Зображення
934
945
  multimodal.text = Текст
935
946
  multimodal.video = Відео
947
+ node.editor.bottom.tip: Правий клік: додати вузол / скасувати / повторити • Середній клік: панорамування • Ctrl + колесо миші: зум; Лівий клік на порт: створити з'єднання • Ctrl + лівий клік на порт: перепід'єднати або від'єднати • Правий клік або DEL вузол/з'єднання: видалити
948
+ node.editor.cap.na: н/д
949
+ node.editor.cap.unlimited: необмежено (∞)
950
+ node.editor.cmd.add: Додати
951
+ node.editor.cmd.clear: Очистити
952
+ node.editor.cmd.connect: Підключити
953
+ node.editor.cmd.delete_connection: Видалити з'єднання
954
+ node.editor.cmd.delete_node: Видалити вузол
955
+ node.editor.cmd.move_node: Перемістити вузол
956
+ node.editor.cmd.resize_node: Змінити розмір вузла
957
+ node.editor.cmd.rewire_connection: Перепід'єднати
958
+ node.editor.edge.delete: Видалити з'єднання
959
+ node.editor.hint.click_start: Клік: почати нове з'єднання
960
+ node.editor.hint.ctrl_rewire: Ctrl+Клік: перепід'єднати/від'єднати існуюче
961
+ node.editor.label.id: ID
962
+ node.editor.lbl.allowed: Дозволені з'єднання:
963
+ node.editor.lbl.node: Вузол:
964
+ node.editor.lbl.port: Порт:
965
+ node.editor.list.tip: Список доданих користувацьких агентів
966
+ node.editor.macro.delete_selection: Видалити вибране
967
+ node.editor.menu.add: Додати
968
+ node.editor.menu.clear: Очистити
969
+ node.editor.menu.redo: Повторити
970
+ node.editor.menu.undo: Скасувати
971
+ node.editor.node.delete: Видалити
972
+ node.editor.node.rename: Перейменувати
973
+ node.editor.overlay.grab: Схопити: перемикнути глобальне панорамування з ЛКМ
974
+ node.editor.overlay.zoom_in: Збільшити
975
+ node.editor.overlay.zoom_out: Зменшити
976
+ node.editor.property.agent.name = Агент
977
+ node.editor.property.input.name = Вхід
978
+ node.editor.property.instruction.name = Інструкція
979
+ node.editor.property.instruction.placeholder = Системна інструкція для агента
980
+ node.editor.property.local_tools.name = Локальні інструменти
981
+ node.editor.property.memory.name = Пам'ять
982
+ node.editor.property.name.name = Ім'я
983
+ node.editor.property.name.placeholder = Ім'я агента
984
+ node.editor.property.output.name = Вивід
985
+ node.editor.property.remote_tools.name = Віддалені інструменти
986
+ node.editor.property.role.name = Роль
987
+ node.editor.property.role.placeholder = Необов'язковий короткий опис призначення агента
988
+ node.editor.rename.label: Ім'я:
989
+ node.editor.rename.title: Перейменувати вузол
990
+ node.editor.side.input: Вхід
991
+ node.editor.side.output: Вихід
992
+ node.editor.spec.agent.title = Агент
993
+ node.editor.spec.end.title = Кінець
994
+ node.editor.spec.memory.title = Пам'ять (Контекст)
995
+ node.editor.spec.start.title = Початок
996
+ node.editor.status.no_nodes: Немає вузлів
997
+ node.editor.type.unknown: Невідомо
936
998
  notify.agent.goal.content = Агент: мету досягнуто.
937
999
  notify.agent.goal.title = Мету досягнуто
938
1000
  notify.agent.stop.content = Агент: зупинено
@@ -1418,6 +1480,7 @@ settings.vision.capture.idx = Пристрій Камери
1418
1480
  settings.vision.capture.idx.desc = Виберіть пристрій камери для відеозйомки в реальному часі
1419
1481
  settings.vision.capture.quality = Якість зйомки (%)
1420
1482
  settings.vision.capture.width = Ширина зйомки (у пікселях)
1483
+ settings.zero.limit.desc: Встановіть 0, щоб вимкнути обмеження.
1421
1484
  settings.zoom = Збільшення вікна виводу чату
1422
1485
  speech.enable = Говоріть
1423
1486
  speech.listening = Говоріть зараз...
@@ -43,6 +43,7 @@ action.profile.delete = 删除个人资料(仅从列表中删除)
43
43
  action.profile.delete_all = 删除个人资料(及所有用户文件)
44
44
  action.redo = 重做
45
45
  action.refresh = 刷新
46
+ action.reload: 重新加载
46
47
  action.rename = 重命名
47
48
  action.reset = 重置
48
49
  action.restore = 恢復
@@ -50,7 +51,8 @@ action.save = 保存
50
51
  action.save_as = 另存為...
51
52
  action.save_selection_as = 将选择保存为...
52
53
  action.select_all = 选择全部
53
- action.tab.add.chat = 添加新聊天
54
+ action.tab.add.chat: 添加新聊天
55
+ action.tab.add.chat.tooltip: 添加新聊天(右键单击获取更多选项...)
54
56
  action.tab.add.notepad = 添加新记事本
55
57
  action.tab.add.tool = 添加新工具
56
58
  action.tab.close = 关闭
@@ -72,6 +74,8 @@ action.use.read_cmd = 請求讀取此文件...
72
74
  action.video.open = 打开视频或音频...
73
75
  action.video.play = 播放视频或音频...
74
76
  action.video.transcribe = 转录音频...
77
+ agent.builder.title = 代理编辑器
78
+ agent.builder.tooltip = 打开代理编辑器
75
79
  agent.coder.additional.label = 额外提示
76
80
  agent.coder.additional.prompt.desc = 代理的额外提示(将添加到基础提示)
77
81
  agent.coder.base.label = 基础提示
@@ -101,6 +105,7 @@ agent.option.prompt.planner.desc = 规划代理的提示
101
105
  agent.option.prompt.search.desc = 搜索代理的提示
102
106
  agent.option.prompt.supervisor.desc = 监督者的提示
103
107
  agent.option.prompt.worker.desc = 工作者的提示
108
+ agent.option.role = 用于指导模型的代理操作简要说明(可选)
104
109
  agent.option.section.base = 基础代理
105
110
  agent.option.section.chooser = 选择器
106
111
  agent.option.section.feedback = 反馈
@@ -239,6 +244,8 @@ clipboard.copied_to = 已複製到剪貼板:
239
244
  cmd.enabled = + 工具
240
245
  cmd.tip = 提示:要启用从插件中执行工具,您必须启用“+ 工具”选项。
241
246
  coming_soon = 即將推出...
247
+ common.down = 下移
248
+ common.up = 上移
242
249
  confirm.assistant.delete = 删除助手?
243
250
  confirm.assistant.files.clear = 清除文件(仅本地)?
244
251
  confirm.assistant.files.truncate = 确定要从所有存储中移除所有文件吗?
@@ -678,6 +685,8 @@ html_canvas.clear.confirm = 清除HTML画布输出?
678
685
  icon.audio.input = 啟用/禁用音頻輸入
679
686
  icon.audio.output = 啟用/禁用音頻輸出
680
687
  icon.remote_tool.web = 网页搜索(远程工具,非本地工具)
688
+ icon.remote_tool.web.disabled: 网络搜索(远程工具,非本地工具)- 禁用
689
+ icon.remote_tool.web.enabled: 网络搜索(远程工具,非本地工具)- 启用
681
690
  icon.video.capture = 啟用/禁用相機捕捉
682
691
  idx.btn.clear = 清除索引
683
692
  idx.btn.index_all = 全部索引
@@ -773,6 +782,7 @@ menu.config.save = 保存配置
773
782
  menu.config.settings = 設置...
774
783
  menu.debug = 調試
775
784
  menu.debug.agent = 代理...
785
+ menu.debug.agent_builder = 代理编辑器
776
786
  menu.debug.app.log = 查看日誌文件(app.log)
777
787
  menu.debug.assistants = 助手...
778
788
  menu.debug.attachments = 文件/附件...
@@ -826,6 +836,7 @@ menu.theme.style = 风格...
826
836
  menu.theme.syntax = 代码语法高亮显示...
827
837
  menu.theme.tooltips = 顯示工具提示
828
838
  menu.tools = 工具
839
+ menu.tools.agent.builder = 代理编辑器
829
840
  menu.tools.audio.transcribe = 转录音频/视频文件
830
841
  menu.tools.html_canvas = HTML/JS 画布
831
842
  menu.tools.image.viewer = 图片查看器
@@ -933,6 +944,57 @@ multimodal.audio = 音频
933
944
  multimodal.image = 图像
934
945
  multimodal.text = 文本
935
946
  multimodal.video = 视频
947
+ node.editor.bottom.tip: 右键单击: 添加节点 / 撤销 / 重做 • 中键单击: 平移视图 • Ctrl + 滚轮: 缩放; 左键单击一个端口: 创建连接 • Ctrl + 左键单击一个端口: 重新连接或断开 • 右键单击或删除键删除节点/连接
948
+ node.editor.cap.na: 不适用
949
+ node.editor.cap.unlimited: 无限 (∞)
950
+ node.editor.cmd.add: 添加
951
+ node.editor.cmd.clear: 清除
952
+ node.editor.cmd.connect: 连接
953
+ node.editor.cmd.delete_connection: 删除连接
954
+ node.editor.cmd.delete_node: 删除节点
955
+ node.editor.cmd.move_node: 移动节点
956
+ node.editor.cmd.resize_node: 调整节点大小
957
+ node.editor.cmd.rewire_connection: 重新连接
958
+ node.editor.edge.delete: 删除连接
959
+ node.editor.hint.click_start: 点击: 开始新的连接
960
+ node.editor.hint.ctrl_rewire: Ctrl+点击: 重新连接/断开现有
961
+ node.editor.label.id: ID
962
+ node.editor.lbl.allowed: 允许连接:
963
+ node.editor.lbl.node: 节点:
964
+ node.editor.lbl.port: 端口:
965
+ node.editor.list.tip: 添加的自定义代理工作流列表
966
+ node.editor.macro.delete_selection: 删除选择
967
+ node.editor.menu.add: 添加
968
+ node.editor.menu.clear: 清除
969
+ node.editor.menu.redo: 重做
970
+ node.editor.menu.undo: 撤销
971
+ node.editor.node.delete: 删除
972
+ node.editor.node.rename: 重命名
973
+ node.editor.overlay.grab: 抓取: 用鼠标左键切换全局平移
974
+ node.editor.overlay.zoom_in: 放大
975
+ node.editor.overlay.zoom_out: 缩小
976
+ node.editor.property.agent.name = 代理
977
+ node.editor.property.input.name = 输入
978
+ node.editor.property.instruction.name = 指令
979
+ node.editor.property.instruction.placeholder = 系统为代理提供的指令
980
+ node.editor.property.local_tools.name = 本地工具
981
+ node.editor.property.memory.name = 内存
982
+ node.editor.property.name.name = 名称
983
+ node.editor.property.name.placeholder = 代理的名称
984
+ node.editor.property.output.name = 输出
985
+ node.editor.property.remote_tools.name = 远程工具
986
+ node.editor.property.role.name = 角色
987
+ node.editor.property.role.placeholder = 代理的目的的可选简短描述
988
+ node.editor.rename.label: 名称:
989
+ node.editor.rename.title: 重命名节点
990
+ node.editor.side.input: 输入
991
+ node.editor.side.output: 输出
992
+ node.editor.spec.agent.title = 代理
993
+ node.editor.spec.end.title = 结束
994
+ node.editor.spec.memory.title = 内存(上下文)
995
+ node.editor.spec.start.title = 开始
996
+ node.editor.status.no_nodes: 无节点
997
+ node.editor.type.unknown: 未知
936
998
  notify.agent.goal.content = 代理:目標已達成。
937
999
  notify.agent.goal.title = 目標達成
938
1000
  notify.agent.stop.content = 代理:已停止
@@ -1418,6 +1480,7 @@ settings.vision.capture.idx = 摄像设备
1418
1480
  settings.vision.capture.idx.desc = 选择实时视频捕捉的摄像设备
1419
1481
  settings.vision.capture.quality = 拍摄质量(%)
1420
1482
  settings.vision.capture.width = 拍摄宽度(像素)
1483
+ settings.zero.limit.desc: 设为0以禁用限制。
1421
1484
  settings.zoom = 聊天输出窗口缩放
1422
1485
  speech.enable = 启用语音
1423
1486
  speech.listening = 现在说话...
@@ -3,6 +3,60 @@ auto_cwd.description = Automatically append the current working directory to the
3
3
  auto_cwd.label = Auto-append CWD to sys_exec
4
4
  cmd.sys_exec.description = Enable the execution of system commands via sys_exec. When enabled, allows the execution of system commands.
5
5
  cmd.sys_exec.label = Enable: System Command Execution
6
+ cmd.win_always_on_top.description = Toggles topmost flag of a window.
7
+ cmd.win_always_on_top.label = Enable: Always On Top
8
+ cmd.win_area_screenshot.description = Captures a rectangular area of the screen to PNG file.
9
+ cmd.win_area_screenshot.label = Enable: Area Screenshot
10
+ cmd.win_children.description = Lists child windows for a parent HWND.
11
+ cmd.win_children.label = Enable: List Child Windows
12
+ cmd.win_click.description = Sends a mouse click at given coordinates.
13
+ cmd.win_click.label = Enable: Mouse Click
14
+ cmd.win_clipboard_get.description = Gets text from clipboard.
15
+ cmd.win_clipboard_get.label = Enable: Clipboard Get
16
+ cmd.win_clipboard_set.description = Sets text to clipboard.
17
+ cmd.win_clipboard_set.label = Enable: Clipboard Set
18
+ cmd.win_close.description = Closes a window using WM_CLOSE.
19
+ cmd.win_close.label = Enable: Close Window
20
+ cmd.win_cursor_get.description = Gets the cursor position.
21
+ cmd.win_cursor_get.label = Enable: Cursor Get
22
+ cmd.win_cursor_set.description = Sets the cursor position.
23
+ cmd.win_cursor_set.label = Enable: Cursor Set
24
+ cmd.win_drag.description = Performs a mouse drag from one point to another.
25
+ cmd.win_drag.label = Enable: Mouse Drag
26
+ cmd.win_find.description = Finds windows by title/class/exe/pid.
27
+ cmd.win_find.label = Enable: Find Windows
28
+ cmd.win_focus.description = Brings a selected window to the foreground.
29
+ cmd.win_focus.label = Enable: Focus Window
30
+ cmd.win_foreground.description = Returns information about the current foreground window.
31
+ cmd.win_foreground.label = Enable: Foreground Window Info
32
+ cmd.win_get_state.description = Returns window metadata and flags.
33
+ cmd.win_get_state.label = Enable: Get Window State
34
+ cmd.win_hide.description = Hides a window.
35
+ cmd.win_hide.label = Enable: Hide Window
36
+ cmd.win_keys_send.description = Sends key combinations to active window.
37
+ cmd.win_keys_send.label = Enable: Send Key Combos
38
+ cmd.win_keys_text.description = Types Unicode text into active window.
39
+ cmd.win_keys_text.label = Enable: Type Text
40
+ cmd.win_list.description = Lists top-level windows (HWND, title, class, PID, EXE, rect, etc.)
41
+ cmd.win_list.label = Enable: List Windows
42
+ cmd.win_maximize.description = Maximizes a window.
43
+ cmd.win_maximize.label = Enable: Maximize Window
44
+ cmd.win_minimize.description = Minimizes a window.
45
+ cmd.win_minimize.label = Enable: Minimize Window
46
+ cmd.win_monitors.description = Lists monitors/screens and their geometry.
47
+ cmd.win_monitors.label = Enable: List Monitors
48
+ cmd.win_move_resize.description = Moves and resizes a window.
49
+ cmd.win_move_resize.label = Enable: Move/Resize Window
50
+ cmd.win_rect.description = Returns window rectangle (geometry).
51
+ cmd.win_rect.label = Enable: Get Window Rect
52
+ cmd.win_restore.description = Restores a window to normal state.
53
+ cmd.win_restore.label = Enable: Restore Window
54
+ cmd.win_screenshot.description = Captures a window to PNG file.
55
+ cmd.win_screenshot.label = Enable: Window Screenshot
56
+ cmd.win_set_opacity.description = Sets window opacity via layered window attributes.
57
+ cmd.win_set_opacity.label = Enable: Set Opacity
58
+ cmd.win_show.description = Shows a window.
59
+ cmd.win_show.label = Enable: Show Window
6
60
  container_name.description = Custom container name
7
61
  container_name.label = Docker container name
8
62
  docker_entrypoint.description = Command to run when starting the container
@@ -21,71 +75,13 @@ sandbox_docker.description = Executes all system commands within a sandbox envir
21
75
  sandbox_docker_image.description = Specifies the Docker image to use for the sandbox.
22
76
  sandbox_docker_image.label = Docker Image
23
77
  sandbox_docker.label = Sandbox (Docker Container)
24
-
25
- # WinAPI tab/options
26
- winapi_enabled.label = Enable WinAPI
27
78
  winapi_enabled.description = Enable Windows API features on Microsoft Windows.
28
- win_keys_per_char_delay_ms.label = Keys: per-char delay (ms)
29
- win_keys_per_char_delay_ms.description = Delay between characters for win_keys_text.
30
- win_keys_hold_ms.label = Keys: hold (ms)
31
- win_keys_hold_ms.description = Hold duration for modifiers in win_keys_send.
32
- win_keys_gap_ms.label = Keys: gap (ms)
33
- win_keys_gap_ms.description = Gap between normal key taps in win_keys_send.
34
- win_drag_step_delay_ms.label = Drag: step delay (ms)
79
+ winapi_enabled.label = Enable WinAPI
35
80
  win_drag_step_delay_ms.description = Delay between intermediate drag steps in win_drag.
36
-
37
- # WinAPI commands labels/descriptions
38
- cmd.win_list.label = Enable: List Windows
39
- cmd.win_list.description = Lists top-level windows (HWND, title, class, PID, EXE, rect, etc.)
40
- cmd.win_find.label = Enable: Find Windows
41
- cmd.win_find.description = Finds windows by title/class/exe/pid.
42
- cmd.win_children.label = Enable: List Child Windows
43
- cmd.win_children.description = Lists child windows for a parent HWND.
44
- cmd.win_foreground.label = Enable: Foreground Window Info
45
- cmd.win_foreground.description = Returns information about the current foreground window.
46
- cmd.win_rect.label = Enable: Get Window Rect
47
- cmd.win_rect.description = Returns window rectangle (geometry).
48
- cmd.win_get_state.label = Enable: Get Window State
49
- cmd.win_get_state.description = Returns window metadata and flags.
50
- cmd.win_focus.label = Enable: Focus Window
51
- cmd.win_focus.description = Brings a selected window to the foreground.
52
- cmd.win_move_resize.label = Enable: Move/Resize Window
53
- cmd.win_move_resize.description = Moves and resizes a window.
54
- cmd.win_minimize.label = Enable: Minimize Window
55
- cmd.win_minimize.description = Minimizes a window.
56
- cmd.win_maximize.label = Enable: Maximize Window
57
- cmd.win_maximize.description = Maximizes a window.
58
- cmd.win_restore.label = Enable: Restore Window
59
- cmd.win_restore.description = Restores a window to normal state.
60
- cmd.win_close.label = Enable: Close Window
61
- cmd.win_close.description = Closes a window using WM_CLOSE.
62
- cmd.win_show.label = Enable: Show Window
63
- cmd.win_show.description = Shows a window.
64
- cmd.win_hide.label = Enable: Hide Window
65
- cmd.win_hide.description = Hides a window.
66
- cmd.win_always_on_top.label = Enable: Always On Top
67
- cmd.win_always_on_top.description = Toggles topmost flag of a window.
68
- cmd.win_set_opacity.label = Enable: Set Opacity
69
- cmd.win_set_opacity.description = Sets window opacity via layered window attributes.
70
- cmd.win_screenshot.label = Enable: Window Screenshot
71
- cmd.win_screenshot.description = Captures a window to PNG file.
72
- cmd.win_area_screenshot.label = Enable: Area Screenshot
73
- cmd.win_area_screenshot.description = Captures a rectangular area of the screen to PNG file.
74
- cmd.win_clipboard_get.label = Enable: Clipboard Get
75
- cmd.win_clipboard_get.description = Gets text from clipboard.
76
- cmd.win_clipboard_set.label = Enable: Clipboard Set
77
- cmd.win_clipboard_set.description = Sets text to clipboard.
78
- cmd.win_cursor_get.label = Enable: Cursor Get
79
- cmd.win_cursor_get.description = Gets the cursor position.
80
- cmd.win_cursor_set.label = Enable: Cursor Set
81
- cmd.win_cursor_set.description = Sets the cursor position.
82
- cmd.win_keys_text.label = Enable: Type Text
83
- cmd.win_keys_text.description = Types Unicode text into active window.
84
- cmd.win_keys_send.label = Enable: Send Key Combos
85
- cmd.win_keys_send.description = Sends key combinations to active window.
86
- cmd.win_click.label = Enable: Mouse Click
87
- cmd.win_click.description = Sends a mouse click at given coordinates.
88
- cmd.win_drag.label = Enable: Mouse Drag
89
- cmd.win_drag.description = Performs a mouse drag from one point to another.
90
- cmd.win_monitors.label = Enable: List Monitors
91
- cmd.win_monitors.description = Lists monitors/screens and their geometry.
81
+ win_drag_step_delay_ms.label = Drag: step delay (ms)
82
+ win_keys_gap_ms.description = Gap between normal key taps in win_keys_send.
83
+ win_keys_gap_ms.label = Keys: gap (ms)
84
+ win_keys_hold_ms.description = Hold duration for modifiers in win_keys_send.
85
+ win_keys_hold_ms.label = Keys: hold (ms)
86
+ win_keys_per_char_delay_ms.description = Delay between characters for win_keys_text.
87
+ win_keys_per_char_delay_ms.label = Keys: per-char delay (ms)
pygpt_net/item/agent.py CHANGED
@@ -20,18 +20,21 @@ class AgentItem:
20
20
  id: Optional[object] = None
21
21
  name: Optional[object] = None
22
22
  layout: dict = field(default_factory=dict)
23
+ schema: list = field(default_factory=list)
23
24
 
24
25
  def __init__(self):
25
26
  """Custom agent item"""
26
27
  self.id = None
27
28
  self.name = None
28
29
  self.layout = {}
30
+ self.schema = []
29
31
 
30
32
  def reset(self):
31
33
  """Reset"""
32
34
  self.id = None
33
35
  self.name = None
34
36
  self.layout = {}
37
+ self.schema = {}
35
38
 
36
39
  def to_dict(self) -> dict:
37
40
  """
@@ -42,7 +45,8 @@ class AgentItem:
42
45
  return {
43
46
  "id": self.id,
44
47
  "name": self.name,
45
- "layout": self.layout
48
+ "layout": self.layout,
49
+ "schema": self.schema,
46
50
  }
47
51
 
48
52
  def dump(self) -> str:
pygpt_net/item/preset.py CHANGED
@@ -215,11 +215,29 @@ class PresetItem:
215
215
  if "user_name" in data:
216
216
  self.user_name = data["user_name"]
217
217
  if "uuid" in data:
218
- self.uuid = uuid.UUID(data["uuid"])
218
+ self.uuid = str(uuid.UUID(data["uuid"]))
219
219
  if "vision" in data:
220
220
  self.vision = data["vision"]
221
221
  return self
222
222
 
223
+ def reset_modes(self):
224
+ """
225
+ Reset modes
226
+ """
227
+ self.agent = False
228
+ self.agent_llama = False
229
+ self.agent_openai = False
230
+ self.audio = False
231
+ self.assistant = False
232
+ self.chat = False
233
+ self.completion = False
234
+ self.computer = False
235
+ self.expert = False
236
+ self.langchain = False
237
+ self.llama_index = False
238
+ self.research = False
239
+ self.vision = False
240
+
223
241
  def add_function(self, name: str, parameters: str, desc: str):
224
242
  """
225
243
  Add function to preset
@@ -21,6 +21,9 @@ class BaseAgent:
21
21
  self.type = ""
22
22
  self.mode = ""
23
23
  self.name = ""
24
+ self.custom_id = None
25
+ self.custom_options = None
26
+ self.custom_schema = None
24
27
 
25
28
  def get_mode(self) -> str:
26
29
  """
@@ -44,12 +47,39 @@ class BaseAgent:
44
47
  """
45
48
  pass
46
49
 
50
+ def set_id(self, id: str):
51
+ """
52
+ Set custom ID for the agent
53
+
54
+ :param id: Custom ID
55
+ """
56
+ self.custom_id = id
57
+
58
+ def set_schema(self, schema: list):
59
+ """
60
+ Set custom schema for the agent
61
+
62
+ :param schema: Custom schema
63
+ """
64
+ self.custom_schema = schema
65
+
66
+
67
+ def set_options(self, options: dict):
68
+ """
69
+ Set custom options for the agent
70
+
71
+ :param options: Custom options
72
+ """
73
+ self.custom_options = options
74
+
47
75
  def get_options(self) -> dict:
48
76
  """
49
77
  Return Agent options
50
78
 
51
79
  :return: Agent options
52
80
  """
81
+ if self.custom_options is not None:
82
+ return self.custom_options
53
83
  return {}
54
84
 
55
85
  async def run(
@@ -89,9 +119,10 @@ class BaseAgent:
89
119
  print("No preset provided, returning default option value")
90
120
  return None
91
121
  extra = preset.extra
92
- if not isinstance(extra, dict) or self.id not in extra:
122
+ agent_id = self.custom_id if self.custom_id is not None else self.id
123
+ if not isinstance(extra, dict) or agent_id not in extra:
93
124
  return self.get_default(section, key)
94
- options = extra[self.id]
125
+ options = extra[agent_id]
95
126
  if section not in options:
96
127
  return self.get_default(section, key)
97
128
  if key not in options[section]:
@@ -0,0 +1,92 @@
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: 2025.09.25 14:00:00 #
10
+ # ================================================== #
11
+
12
+ from __future__ import annotations
13
+ from typing import Any, Dict, Optional, List, Tuple
14
+
15
+ from pygpt_net.core.agents.custom.logging import StdLogger, NullLogger
16
+ from pygpt_net.core.types import AGENT_MODE_WORKFLOW, AGENT_TYPE_LLAMA
17
+ from pygpt_net.item.model import ModelItem
18
+ from pygpt_net.item.preset import PresetItem
19
+ from pygpt_net.core.bridge import BridgeContext
20
+
21
+ from agents import TResponseInputItem
22
+
23
+ from ..base import BaseAgent
24
+ from pygpt_net.core.agents.custom.llama_index.runner import DynamicFlowWorkflowLI
25
+ from pygpt_net.core.agents.custom.llama_index.utils import make_option_getter
26
+
27
+
28
+ class Agent(BaseAgent):
29
+ """
30
+ Dynamic Flow (LlamaIndex 0.13) – provider that returns a workflow-like object
31
+ compatible with predefined LlamaWorkflow runner (run() -> handler.stream_events()).
32
+ """
33
+ def __init__(self, *args, **kwargs):
34
+ super(Agent, self).__init__(*args, **kwargs)
35
+ self.id = "llama_custom"
36
+ self.type = AGENT_TYPE_LLAMA
37
+ self.mode = AGENT_MODE_WORKFLOW
38
+ self.name = "Custom"
39
+
40
+ def get_agent(self, window, kwargs: Dict[str, Any]):
41
+ """
42
+ Build and return DynamicFlowWorkflowLI.
43
+ Expected kwargs from your app:
44
+ - schema: List[dict]
45
+ - llm: LlamaIndex LLM (base) – użyty gdy brak per-node modelu
46
+ - tools: List[BaseTool] (LI)
47
+ - messages: Optional[List[TResponseInputItem]] – initial, dla pierwszego agenta
48
+ - context: BridgeContext (preset do get_option)
49
+ - router_stream_mode / max_iterations / stream / logger / model (default ModelItem)
50
+ """
51
+ schema: List[Dict[str, Any]] = kwargs.get("schema") or []
52
+ llm = kwargs.get("llm")
53
+ tools = kwargs.get("tools", []) or []
54
+ initial_messages: Optional[List[TResponseInputItem]] = kwargs.get("chat_history")
55
+ verbose = bool(kwargs.get("verbose", False))
56
+
57
+ context: BridgeContext = kwargs.get("context", BridgeContext())
58
+ preset: Optional[PresetItem] = context.preset
59
+ default_model: ModelItem = kwargs.get("model", ModelItem())
60
+
61
+ base_prompt = self.get_option(preset, "base", "prompt")
62
+ allow_local_tools_default = bool(self.get_option(preset, "base", "allow_local_tools"))
63
+ allow_remote_tools_default = bool(self.get_option(preset, "base", "allow_remote_tools"))
64
+ max_iterations = int(self.get_option(preset, "base", "max_iterations") or kwargs.get("max_iterations", 20))
65
+ router_stream_mode = self.get_option(preset, "router", "stream_mode") or kwargs.get("router_stream_mode", "realtime")
66
+
67
+ option_get = make_option_getter(self, preset)
68
+ stream = bool(kwargs.get("stream", False))
69
+ logger = StdLogger(prefix="[flow]") if verbose else NullLogger()
70
+
71
+ return DynamicFlowWorkflowLI(
72
+ window=window,
73
+ logger=logger,
74
+ schema=schema,
75
+ initial_messages=initial_messages,
76
+ preset=preset,
77
+ default_model=default_model,
78
+ option_get=option_get,
79
+ router_stream_mode=str(router_stream_mode).lower(),
80
+ allow_local_tools_default=allow_local_tools_default,
81
+ allow_remote_tools_default=allow_remote_tools_default,
82
+ max_iterations=max_iterations,
83
+ llm=llm,
84
+ tools=tools,
85
+ stream=stream,
86
+ base_prompt=base_prompt,
87
+ timeout=120,
88
+ verbose=verbose,
89
+ )
90
+
91
+ async def run(self, *args, **kwargs) -> Tuple[Any, str, str]:
92
+ raise NotImplementedError("Use get_agent() and run it via LlamaWorkflow runner.")