pygpt-net 2.6.1__py3-none-any.whl → 2.6.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pygpt_net/CHANGELOG.txt +23 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +20 -1
- pygpt_net/config.py +55 -65
- pygpt_net/controller/__init__.py +5 -2
- pygpt_net/controller/calendar/note.py +101 -126
- pygpt_net/controller/chat/chat.py +38 -35
- pygpt_net/controller/chat/render.py +154 -214
- pygpt_net/controller/chat/response.py +5 -3
- pygpt_net/controller/chat/stream.py +92 -27
- pygpt_net/controller/config/config.py +39 -42
- pygpt_net/controller/config/field/checkbox.py +16 -12
- pygpt_net/controller/config/field/checkbox_list.py +36 -31
- pygpt_net/controller/config/field/cmd.py +51 -57
- pygpt_net/controller/config/field/combo.py +33 -16
- pygpt_net/controller/config/field/dictionary.py +48 -55
- pygpt_net/controller/config/field/input.py +50 -32
- pygpt_net/controller/config/field/slider.py +40 -45
- pygpt_net/controller/config/field/textarea.py +20 -6
- pygpt_net/controller/config/placeholder.py +110 -231
- pygpt_net/controller/ctx/common.py +48 -48
- pygpt_net/controller/ctx/ctx.py +91 -132
- pygpt_net/controller/lang/mapping.py +57 -95
- pygpt_net/controller/lang/plugins.py +64 -55
- pygpt_net/controller/lang/settings.py +39 -38
- pygpt_net/controller/layout/layout.py +176 -109
- pygpt_net/controller/mode/mode.py +88 -85
- pygpt_net/controller/model/model.py +73 -73
- pygpt_net/controller/plugins/plugins.py +209 -223
- pygpt_net/controller/plugins/presets.py +54 -55
- pygpt_net/controller/plugins/settings.py +54 -69
- pygpt_net/controller/presets/editor.py +33 -88
- pygpt_net/controller/presets/experts.py +20 -1
- pygpt_net/controller/presets/presets.py +293 -298
- pygpt_net/controller/settings/profile.py +16 -4
- pygpt_net/controller/theme/theme.py +72 -81
- pygpt_net/controller/ui/mode.py +118 -186
- pygpt_net/controller/ui/tabs.py +69 -90
- pygpt_net/controller/ui/ui.py +47 -56
- pygpt_net/controller/ui/vision.py +24 -23
- pygpt_net/core/agents/runner.py +15 -7
- pygpt_net/core/bridge/bridge.py +5 -5
- pygpt_net/core/command/command.py +149 -219
- pygpt_net/core/ctx/ctx.py +94 -146
- pygpt_net/core/debug/debug.py +48 -58
- pygpt_net/core/experts/experts.py +3 -3
- pygpt_net/core/models/models.py +74 -112
- pygpt_net/core/modes/modes.py +13 -21
- pygpt_net/core/plugins/plugins.py +154 -177
- pygpt_net/core/presets/presets.py +103 -176
- pygpt_net/core/render/web/body.py +217 -215
- pygpt_net/core/render/web/renderer.py +330 -474
- pygpt_net/core/text/utils.py +28 -44
- pygpt_net/core/tokens/tokens.py +104 -203
- pygpt_net/data/config/config.json +3 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/locale/locale.de.ini +2 -0
- pygpt_net/data/locale/locale.en.ini +2 -0
- pygpt_net/data/locale/locale.es.ini +2 -0
- pygpt_net/data/locale/locale.fr.ini +2 -0
- pygpt_net/data/locale/locale.it.ini +2 -0
- pygpt_net/data/locale/locale.pl.ini +3 -1
- pygpt_net/data/locale/locale.uk.ini +2 -0
- pygpt_net/data/locale/locale.zh.ini +2 -0
- pygpt_net/item/ctx.py +141 -139
- pygpt_net/plugin/agent/plugin.py +2 -1
- pygpt_net/plugin/audio_output/plugin.py +5 -2
- pygpt_net/plugin/base/plugin.py +101 -85
- pygpt_net/plugin/bitbucket/__init__.py +12 -0
- pygpt_net/plugin/bitbucket/config.py +267 -0
- pygpt_net/plugin/bitbucket/plugin.py +126 -0
- pygpt_net/plugin/bitbucket/worker.py +569 -0
- pygpt_net/plugin/cmd_code_interpreter/plugin.py +3 -2
- pygpt_net/plugin/cmd_custom/plugin.py +3 -2
- pygpt_net/plugin/cmd_files/plugin.py +3 -2
- pygpt_net/plugin/cmd_history/plugin.py +3 -2
- pygpt_net/plugin/cmd_mouse_control/plugin.py +5 -2
- pygpt_net/plugin/cmd_serial/plugin.py +3 -2
- pygpt_net/plugin/cmd_system/plugin.py +3 -6
- pygpt_net/plugin/cmd_web/plugin.py +3 -2
- pygpt_net/plugin/experts/plugin.py +2 -2
- pygpt_net/plugin/facebook/__init__.py +12 -0
- pygpt_net/plugin/facebook/config.py +359 -0
- pygpt_net/plugin/facebook/plugin.py +113 -0
- pygpt_net/plugin/facebook/worker.py +698 -0
- pygpt_net/plugin/github/__init__.py +12 -0
- pygpt_net/plugin/github/config.py +441 -0
- pygpt_net/plugin/github/plugin.py +126 -0
- pygpt_net/plugin/github/worker.py +674 -0
- pygpt_net/plugin/google/__init__.py +12 -0
- pygpt_net/plugin/google/config.py +367 -0
- pygpt_net/plugin/google/plugin.py +126 -0
- pygpt_net/plugin/google/worker.py +826 -0
- pygpt_net/plugin/idx_llama_index/plugin.py +3 -2
- pygpt_net/plugin/mailer/plugin.py +3 -5
- pygpt_net/plugin/openai_vision/plugin.py +3 -2
- pygpt_net/plugin/real_time/plugin.py +52 -60
- pygpt_net/plugin/slack/__init__.py +12 -0
- pygpt_net/plugin/slack/config.py +349 -0
- pygpt_net/plugin/slack/plugin.py +115 -0
- pygpt_net/plugin/slack/worker.py +639 -0
- pygpt_net/plugin/telegram/__init__.py +12 -0
- pygpt_net/plugin/telegram/config.py +308 -0
- pygpt_net/plugin/telegram/plugin.py +117 -0
- pygpt_net/plugin/telegram/worker.py +563 -0
- pygpt_net/plugin/twitter/__init__.py +12 -0
- pygpt_net/plugin/twitter/config.py +491 -0
- pygpt_net/plugin/twitter/plugin.py +125 -0
- pygpt_net/plugin/twitter/worker.py +837 -0
- pygpt_net/provider/agents/llama_index/legacy/openai_assistant.py +35 -3
- pygpt_net/tools/code_interpreter/tool.py +0 -1
- pygpt_net/tools/translator/tool.py +1 -1
- pygpt_net/ui/base/config_dialog.py +86 -100
- pygpt_net/ui/base/context_menu.py +48 -46
- pygpt_net/ui/dialog/preset.py +34 -77
- pygpt_net/ui/layout/ctx/ctx_list.py +10 -6
- pygpt_net/ui/layout/toolbox/presets.py +41 -41
- pygpt_net/ui/main.py +49 -31
- pygpt_net/ui/tray.py +61 -60
- pygpt_net/ui/widget/calendar/select.py +86 -70
- pygpt_net/ui/widget/lists/attachment.py +86 -44
- pygpt_net/ui/widget/lists/base_list_combo.py +85 -33
- pygpt_net/ui/widget/lists/context.py +135 -188
- pygpt_net/ui/widget/lists/preset.py +59 -61
- pygpt_net/ui/widget/textarea/web.py +161 -48
- pygpt_net/utils.py +8 -1
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/METADATA +164 -2
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/RECORD +131 -103
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
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.08.15 23:00:00 #
|
|
10
|
+
# ================================================== #
|
|
11
|
+
|
|
12
|
+
from pygpt_net.plugin.base.plugin import BasePlugin
|
|
13
|
+
from pygpt_net.core.events import Event
|
|
14
|
+
from pygpt_net.item.ctx import CtxItem
|
|
15
|
+
|
|
16
|
+
from .config import Config
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Plugin(BasePlugin):
|
|
20
|
+
def __init__(self, *args, **kwargs):
|
|
21
|
+
super(Plugin, self).__init__(*args, **kwargs)
|
|
22
|
+
self.id = "slack"
|
|
23
|
+
self.name = "Slack"
|
|
24
|
+
self.description = "Handle users, conversations, messages, and files on Slack."
|
|
25
|
+
self.prefix = "API"
|
|
26
|
+
self.order = 100
|
|
27
|
+
self.allowed_cmds = [
|
|
28
|
+
"slack_oauth_begin",
|
|
29
|
+
"slack_oauth_exchange",
|
|
30
|
+
"slack_oauth_refresh",
|
|
31
|
+
"slack_auth_test",
|
|
32
|
+
"slack_users_list",
|
|
33
|
+
"slack_conversations_list",
|
|
34
|
+
"slack_conversations_history",
|
|
35
|
+
"slack_conversations_replies",
|
|
36
|
+
"slack_conversations_open",
|
|
37
|
+
"slack_chat_post_message",
|
|
38
|
+
"slack_chat_delete",
|
|
39
|
+
"slack_files_upload"
|
|
40
|
+
]
|
|
41
|
+
self.use_locale = False
|
|
42
|
+
self.worker = None
|
|
43
|
+
self.config = Config(self)
|
|
44
|
+
self.init_options()
|
|
45
|
+
|
|
46
|
+
def init_options(self):
|
|
47
|
+
"""Initialize options"""
|
|
48
|
+
self.config.from_defaults(self)
|
|
49
|
+
|
|
50
|
+
def handle(self, event: Event, *args, **kwargs):
|
|
51
|
+
"""
|
|
52
|
+
Handle dispatched event
|
|
53
|
+
|
|
54
|
+
:param event: event object
|
|
55
|
+
:param args: event args
|
|
56
|
+
:param kwargs: event kwargs
|
|
57
|
+
"""
|
|
58
|
+
name = event.name
|
|
59
|
+
data = event.data
|
|
60
|
+
ctx = event.ctx
|
|
61
|
+
|
|
62
|
+
if name == Event.CMD_SYNTAX:
|
|
63
|
+
self.cmd_syntax(data)
|
|
64
|
+
|
|
65
|
+
elif name == Event.CMD_EXECUTE:
|
|
66
|
+
self.cmd(
|
|
67
|
+
ctx,
|
|
68
|
+
data['commands'],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def cmd_syntax(self, data: dict):
|
|
72
|
+
"""
|
|
73
|
+
Event: CMD_SYNTAX
|
|
74
|
+
|
|
75
|
+
:param data: event data dict
|
|
76
|
+
"""
|
|
77
|
+
for option in self.allowed_cmds:
|
|
78
|
+
if self.has_cmd(option):
|
|
79
|
+
data['cmd'].append(self.get_cmd(option)) # append command
|
|
80
|
+
|
|
81
|
+
def cmd(self, ctx: CtxItem, cmds: list):
|
|
82
|
+
"""
|
|
83
|
+
Event: CMD_EXECUTE
|
|
84
|
+
|
|
85
|
+
:param ctx: CtxItem
|
|
86
|
+
:param cmds: commands dict
|
|
87
|
+
"""
|
|
88
|
+
from .worker import Worker
|
|
89
|
+
|
|
90
|
+
is_cmd = False
|
|
91
|
+
my_commands = []
|
|
92
|
+
for item in cmds:
|
|
93
|
+
if item["cmd"] in self.allowed_cmds:
|
|
94
|
+
my_commands.append(item)
|
|
95
|
+
is_cmd = True
|
|
96
|
+
|
|
97
|
+
if not is_cmd:
|
|
98
|
+
return
|
|
99
|
+
|
|
100
|
+
# set state: busy
|
|
101
|
+
self.cmd_prepare(ctx, my_commands)
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
worker = Worker()
|
|
105
|
+
worker.from_defaults(self)
|
|
106
|
+
worker.cmds = my_commands
|
|
107
|
+
worker.ctx = ctx
|
|
108
|
+
|
|
109
|
+
if not self.is_async(ctx):
|
|
110
|
+
worker.run()
|
|
111
|
+
return
|
|
112
|
+
worker.run_async()
|
|
113
|
+
|
|
114
|
+
except Exception as e:
|
|
115
|
+
self.error(e)
|