pygpt-net 2.6.1__py3-none-any.whl → 2.6.2__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 +4 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +15 -1
- pygpt_net/controller/chat/response.py +5 -3
- pygpt_net/controller/chat/stream.py +40 -2
- pygpt_net/controller/plugins/plugins.py +25 -0
- pygpt_net/controller/presets/editor.py +33 -88
- pygpt_net/controller/presets/experts.py +20 -1
- pygpt_net/controller/presets/presets.py +2 -2
- pygpt_net/controller/ui/mode.py +17 -66
- pygpt_net/core/agents/runner.py +15 -7
- pygpt_net/core/experts/experts.py +3 -3
- 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/plugin/base/plugin.py +35 -3
- pygpt_net/plugin/bitbucket/__init__.py +12 -0
- pygpt_net/plugin/bitbucket/config.py +267 -0
- pygpt_net/plugin/bitbucket/plugin.py +125 -0
- pygpt_net/plugin/bitbucket/worker.py +569 -0
- pygpt_net/plugin/facebook/__init__.py +12 -0
- pygpt_net/plugin/facebook/config.py +359 -0
- pygpt_net/plugin/facebook/plugin.py +114 -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 +124 -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/slack/__init__.py +12 -0
- pygpt_net/plugin/slack/config.py +349 -0
- pygpt_net/plugin/slack/plugin.py +116 -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 +118 -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 +126 -0
- pygpt_net/plugin/twitter/worker.py +837 -0
- pygpt_net/provider/agents/llama_index/legacy/openai_assistant.py +35 -3
- pygpt_net/ui/base/config_dialog.py +4 -0
- pygpt_net/ui/dialog/preset.py +34 -77
- pygpt_net/ui/layout/toolbox/presets.py +2 -2
- pygpt_net/ui/main.py +3 -1
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/METADATA +145 -2
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/RECORD +61 -33
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
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 00: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
|
+
from .worker import Worker
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Plugin(BasePlugin):
|
|
21
|
+
def __init__(self, *args, **kwargs):
|
|
22
|
+
super(Plugin, self).__init__(*args, **kwargs)
|
|
23
|
+
self.id = "bitbucket"
|
|
24
|
+
self.name = "Bitbucket"
|
|
25
|
+
self.description = "Access Bitbucket API to manage repositories, issues, and pull requests."
|
|
26
|
+
self.prefix = "API"
|
|
27
|
+
self.order = 100
|
|
28
|
+
self.allowed_cmds = [
|
|
29
|
+
"bb_auth_set_mode",
|
|
30
|
+
"bb_set_app_password",
|
|
31
|
+
"bb_set_bearer",
|
|
32
|
+
"bb_auth_check",
|
|
33
|
+
"bb_me",
|
|
34
|
+
"bb_user_get",
|
|
35
|
+
"bb_workspaces_list",
|
|
36
|
+
"bb_repos_list",
|
|
37
|
+
"bb_repo_get",
|
|
38
|
+
"bb_repo_create",
|
|
39
|
+
"bb_repo_delete",
|
|
40
|
+
"bb_contents_get",
|
|
41
|
+
"bb_file_put",
|
|
42
|
+
"bb_file_delete",
|
|
43
|
+
"bb_issues_list",
|
|
44
|
+
"bb_issue_create",
|
|
45
|
+
"bb_issue_comment",
|
|
46
|
+
"bb_issue_update",
|
|
47
|
+
"bb_prs_list",
|
|
48
|
+
"bb_pr_create",
|
|
49
|
+
"bb_pr_merge",
|
|
50
|
+
"bb_search_repos"
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
self.use_locale = False
|
|
54
|
+
self.worker = None
|
|
55
|
+
self.config = Config(self)
|
|
56
|
+
self.init_options()
|
|
57
|
+
|
|
58
|
+
def init_options(self):
|
|
59
|
+
"""Initialize options"""
|
|
60
|
+
self.config.from_defaults(self)
|
|
61
|
+
|
|
62
|
+
def handle(self, event: Event, *args, **kwargs):
|
|
63
|
+
"""
|
|
64
|
+
Handle dispatched event
|
|
65
|
+
|
|
66
|
+
:param event: event object
|
|
67
|
+
:param args: event args
|
|
68
|
+
:param kwargs: event kwargs
|
|
69
|
+
"""
|
|
70
|
+
name = event.name
|
|
71
|
+
data = event.data
|
|
72
|
+
ctx = event.ctx
|
|
73
|
+
|
|
74
|
+
if name == Event.CMD_SYNTAX:
|
|
75
|
+
self.cmd_syntax(data)
|
|
76
|
+
|
|
77
|
+
elif name == Event.CMD_EXECUTE:
|
|
78
|
+
self.cmd(
|
|
79
|
+
ctx,
|
|
80
|
+
data['commands'],
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
def cmd_syntax(self, data: dict):
|
|
84
|
+
"""
|
|
85
|
+
Event: CMD_SYNTAX
|
|
86
|
+
|
|
87
|
+
:param data: event data dict
|
|
88
|
+
"""
|
|
89
|
+
for option in self.allowed_cmds:
|
|
90
|
+
if self.has_cmd(option):
|
|
91
|
+
data['cmd'].append(self.get_cmd(option)) # append command
|
|
92
|
+
|
|
93
|
+
def cmd(self, ctx: CtxItem, cmds: list):
|
|
94
|
+
"""
|
|
95
|
+
Event: CMD_EXECUTE
|
|
96
|
+
|
|
97
|
+
:param ctx: CtxItem
|
|
98
|
+
:param cmds: commands dict
|
|
99
|
+
"""
|
|
100
|
+
is_cmd = False
|
|
101
|
+
my_commands = []
|
|
102
|
+
for item in cmds:
|
|
103
|
+
if item["cmd"] in self.allowed_cmds:
|
|
104
|
+
my_commands.append(item)
|
|
105
|
+
is_cmd = True
|
|
106
|
+
|
|
107
|
+
if not is_cmd:
|
|
108
|
+
return
|
|
109
|
+
|
|
110
|
+
# set state: busy
|
|
111
|
+
self.cmd_prepare(ctx, my_commands)
|
|
112
|
+
|
|
113
|
+
try:
|
|
114
|
+
worker = Worker()
|
|
115
|
+
worker.from_defaults(self)
|
|
116
|
+
worker.cmds = my_commands
|
|
117
|
+
worker.ctx = ctx
|
|
118
|
+
|
|
119
|
+
if not self.is_async(ctx):
|
|
120
|
+
worker.run()
|
|
121
|
+
return
|
|
122
|
+
worker.run_async()
|
|
123
|
+
|
|
124
|
+
except Exception as e:
|
|
125
|
+
self.error(e)
|