pygpt-net 2.6.19.post1__py3-none-any.whl → 2.6.21__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 (96) hide show
  1. pygpt_net/CHANGELOG.txt +14 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +3 -1
  4. pygpt_net/controller/agent/agent.py +130 -2
  5. pygpt_net/controller/agent/experts.py +93 -96
  6. pygpt_net/controller/agent/llama.py +2 -1
  7. pygpt_net/controller/assistant/assistant.py +18 -1
  8. pygpt_net/controller/attachment/attachment.py +17 -1
  9. pygpt_net/controller/camera/camera.py +15 -7
  10. pygpt_net/controller/chat/chat.py +2 -2
  11. pygpt_net/controller/chat/common.py +50 -33
  12. pygpt_net/controller/chat/image.py +67 -77
  13. pygpt_net/controller/chat/input.py +94 -166
  14. pygpt_net/controller/chat/output.py +83 -140
  15. pygpt_net/controller/chat/response.py +83 -102
  16. pygpt_net/controller/chat/text.py +116 -149
  17. pygpt_net/controller/ctx/common.py +2 -1
  18. pygpt_net/controller/ctx/ctx.py +86 -6
  19. pygpt_net/controller/files/files.py +13 -1
  20. pygpt_net/controller/idx/idx.py +26 -2
  21. pygpt_net/controller/kernel/reply.py +53 -66
  22. pygpt_net/controller/kernel/stack.py +16 -16
  23. pygpt_net/controller/model/importer.py +2 -1
  24. pygpt_net/controller/model/model.py +62 -3
  25. pygpt_net/controller/settings/editor.py +4 -4
  26. pygpt_net/controller/ui/ui.py +16 -2
  27. pygpt_net/core/agents/observer/evaluation.py +3 -3
  28. pygpt_net/core/agents/provider.py +25 -3
  29. pygpt_net/core/agents/runner.py +4 -1
  30. pygpt_net/core/agents/runners/llama_workflow.py +19 -7
  31. pygpt_net/core/agents/runners/loop.py +3 -1
  32. pygpt_net/core/agents/runners/openai_workflow.py +17 -3
  33. pygpt_net/core/agents/tools.py +4 -1
  34. pygpt_net/core/bridge/context.py +34 -37
  35. pygpt_net/core/ctx/ctx.py +1 -1
  36. pygpt_net/core/db/database.py +2 -2
  37. pygpt_net/core/debug/debug.py +12 -1
  38. pygpt_net/core/dispatcher/dispatcher.py +24 -1
  39. pygpt_net/core/events/app.py +7 -7
  40. pygpt_net/core/events/control.py +26 -26
  41. pygpt_net/core/events/event.py +6 -3
  42. pygpt_net/core/events/kernel.py +2 -2
  43. pygpt_net/core/events/render.py +13 -13
  44. pygpt_net/core/experts/experts.py +76 -82
  45. pygpt_net/core/experts/worker.py +12 -12
  46. pygpt_net/core/models/models.py +5 -1
  47. pygpt_net/core/models/ollama.py +14 -5
  48. pygpt_net/core/render/web/helpers.py +2 -2
  49. pygpt_net/core/render/web/renderer.py +4 -4
  50. pygpt_net/core/types/__init__.py +2 -1
  51. pygpt_net/core/types/agent.py +4 -4
  52. pygpt_net/core/types/base.py +19 -0
  53. pygpt_net/core/types/console.py +6 -6
  54. pygpt_net/core/types/mode.py +8 -8
  55. pygpt_net/core/types/multimodal.py +3 -3
  56. pygpt_net/core/types/openai.py +2 -1
  57. pygpt_net/data/config/config.json +4 -4
  58. pygpt_net/data/config/models.json +19 -3
  59. pygpt_net/data/config/settings.json +14 -14
  60. pygpt_net/data/locale/locale.en.ini +2 -2
  61. pygpt_net/item/ctx.py +256 -240
  62. pygpt_net/item/model.py +59 -116
  63. pygpt_net/item/preset.py +122 -105
  64. pygpt_net/plugin/server/__init__.py +12 -0
  65. pygpt_net/plugin/server/config.py +301 -0
  66. pygpt_net/plugin/server/plugin.py +111 -0
  67. pygpt_net/plugin/server/worker.py +1057 -0
  68. pygpt_net/provider/agents/llama_index/workflow/planner.py +3 -3
  69. pygpt_net/provider/agents/openai/agent.py +4 -12
  70. pygpt_net/provider/agents/openai/agent_b2b.py +10 -15
  71. pygpt_net/provider/agents/openai/agent_planner.py +4 -4
  72. pygpt_net/provider/agents/openai/agent_with_experts.py +3 -7
  73. pygpt_net/provider/agents/openai/agent_with_experts_feedback.py +4 -8
  74. pygpt_net/provider/agents/openai/agent_with_feedback.py +4 -8
  75. pygpt_net/provider/agents/openai/bot_researcher.py +2 -18
  76. pygpt_net/provider/agents/openai/bots/__init__.py +0 -0
  77. pygpt_net/provider/agents/openai/bots/research_bot/__init__.py +0 -0
  78. pygpt_net/provider/agents/openai/bots/research_bot/agents/__init__.py +0 -0
  79. pygpt_net/provider/agents/openai/bots/research_bot/agents/planner_agent.py +1 -1
  80. pygpt_net/provider/agents/openai/bots/research_bot/agents/search_agent.py +1 -0
  81. pygpt_net/provider/agents/openai/bots/research_bot/agents/writer_agent.py +1 -1
  82. pygpt_net/provider/agents/openai/bots/research_bot/manager.py +1 -10
  83. pygpt_net/provider/agents/openai/evolve.py +5 -9
  84. pygpt_net/provider/agents/openai/supervisor.py +4 -8
  85. pygpt_net/provider/core/config/patch.py +10 -3
  86. pygpt_net/provider/core/ctx/db_sqlite/utils.py +43 -43
  87. pygpt_net/provider/core/model/patch.py +11 -1
  88. pygpt_net/provider/core/preset/json_file.py +47 -49
  89. pygpt_net/provider/gpt/agents/experts.py +2 -2
  90. pygpt_net/ui/base/config_dialog.py +17 -3
  91. pygpt_net/ui/widget/option/checkbox.py +16 -2
  92. {pygpt_net-2.6.19.post1.dist-info → pygpt_net-2.6.21.dist-info}/METADATA +30 -6
  93. {pygpt_net-2.6.19.post1.dist-info → pygpt_net-2.6.21.dist-info}/RECORD +93 -88
  94. {pygpt_net-2.6.19.post1.dist-info → pygpt_net-2.6.21.dist-info}/LICENSE +0 -0
  95. {pygpt_net-2.6.19.post1.dist-info → pygpt_net-2.6.21.dist-info}/WHEEL +0 -0
  96. {pygpt_net-2.6.19.post1.dist-info → pygpt_net-2.6.21.dist-info}/entry_points.txt +0 -0
pygpt_net/item/model.py CHANGED
@@ -6,10 +6,11 @@
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.08.08 19:00:00 #
9
+ # Updated Date: 2025.08.23 15:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
13
+ from typing import Optional
13
14
 
14
15
  from pygpt_net.core.types import (
15
16
  MODE_CHAT,
@@ -22,27 +23,27 @@ from pygpt_net.core.types import (
22
23
 
23
24
  class ModelItem:
24
25
 
25
- def __init__(self, id=None):
26
+ def __init__(self, id: Optional[str] = None):
26
27
  """
27
28
  Model data item
28
29
 
29
30
  :param id: Model ID
30
31
  """
32
+ self.ctx = 0
33
+ self.default = False
34
+ self.extra = {}
31
35
  self.id = id
32
- self.name = None
33
- self.mode = ["chat"]
36
+ self.imported = False
37
+ self.input = ["text"] # multimodal support: image, audio, etc.
34
38
  self.langchain = {}
35
39
  self.llama_index = {}
40
+ self.mode = ["chat"]
36
41
  self.multimodal = ["text"] # multimodal support: image, audio, etc.
37
- self.input = ["text"] # multimodal support: image, audio, etc.
42
+ self.name = None
38
43
  self.output = ["text"] # multimodal support: image, audio, etc.
39
- self.ctx = 0
40
- self.tokens = 0
41
- self.default = False
42
- self.imported = False
43
44
  self.provider = "openai" # default provider
45
+ self.tokens = 0
44
46
  self.tool_calls = False # native tool calls available
45
- self.extra = {}
46
47
 
47
48
  def from_dict(self, data: dict):
48
49
  """
@@ -50,61 +51,37 @@ class ModelItem:
50
51
 
51
52
  :param data: dict
52
53
  """
53
- if 'id' in data:
54
- self.id = data['id']
55
- if 'name' in data:
56
- self.name = data['name']
57
- if 'mode' in data:
58
- mode = data['mode'].replace(' ', '')
59
- self.mode = mode.split(',')
60
- if 'input' in data:
61
- input = data['input'].replace(' ', '')
62
- self.input = input.split(',')
63
- if 'output' in data:
64
- output = data['output'].replace(' ', '')
65
- self.output = output.split(',')
66
54
  if 'ctx' in data:
67
55
  self.ctx = data['ctx']
68
- if 'tokens' in data:
69
- self.tokens = data['tokens']
70
56
  if 'default' in data:
71
57
  self.default = data['default']
72
58
  if 'extra' in data:
73
59
  self.extra = data['extra']
60
+ if 'id' in data:
61
+ self.id = data['id']
74
62
  if 'imported' in data:
75
63
  self.imported = data['imported']
64
+ if 'input' in data:
65
+ input = data['input'].replace(' ', '')
66
+ self.input = input.split(',')
67
+ if 'mode' in data:
68
+ mode = data['mode'].replace(' ', '')
69
+ self.mode = mode.split(',')
70
+ if 'name' in data:
71
+ self.name = data['name']
72
+ if 'output' in data:
73
+ output = data['output'].replace(' ', '')
74
+ self.output = output.split(',')
76
75
  if 'provider' in data:
77
76
  self.provider = data['provider']
77
+ if 'tokens' in data:
78
+ self.tokens = data['tokens']
78
79
  if 'tool_calls' in data:
79
80
  self.tool_calls = data['tool_calls']
80
-
81
- # langchain
82
- """
83
- if 'langchain.provider' in data:
84
- self.langchain['provider'] = data['langchain.provider']
85
- if 'langchain.mode' in data:
86
- if data['langchain.mode'] is None or data['langchain.mode'] == "":
87
- self.langchain['mode'] = []
88
- else:
89
- mode = data['langchain.mode'].replace(' ', '')
90
- self.langchain['mode'] = mode.split(',')
91
- if 'langchain.args' in data:
92
- self.langchain['args'] = data['langchain.args']
93
- if 'langchain.env' in data:
94
- self.langchain['env'] = data['langchain.env']
95
- """
96
81
 
97
82
  # llama index
98
83
  if 'llama_index.provider' in data:
99
84
  self.llama_index['provider'] = data['llama_index.provider'] # backward compatibility < v2.5.20
100
- """
101
- if 'llama_index.mode' in data:
102
- if data['llama_index.mode'] is None or data['llama_index.mode'] == "":
103
- self.llama_index['mode'] = []
104
- else:
105
- mode = data['llama_index.mode'].replace(' ', '')
106
- self.llama_index['mode'] = mode.split(',')
107
- """
108
85
  if 'llama_index.args' in data:
109
86
  self.llama_index['args'] = data['llama_index.args']
110
87
  if 'llama_index.env' in data:
@@ -116,83 +93,44 @@ class ModelItem:
116
93
 
117
94
  :return: dict
118
95
  """
119
- data = {}
120
- data['id'] = self.id
121
- data['name'] = self.name
122
- data['mode'] = ','.join(self.mode)
123
- data['input'] = ','.join(self.input)
124
- data['output'] = ','.join(self.output)
125
- # data['langchain'] = self.langchain
126
- data['ctx'] = self.ctx
127
- data['tokens'] = self.tokens
128
- data['default'] = self.default
129
- data['extra'] = self.extra
130
- data['imported'] = self.imported
131
- data['provider'] = self.provider
132
- data['tool_calls'] = self.tool_calls
133
-
134
- # data['langchain.provider'] = None
135
- # data['langchain.mode'] = ""
136
- # data['langchain.args'] = []
137
- # data['langchain.env'] = []
138
- # data['llama_index.provider'] = None
139
- # data['llama_index.mode'] = ""
140
- data['llama_index.args'] = []
141
- data['llama_index.env'] = []
142
-
143
-
144
- # langchain
145
- """
146
- if 'provider' in self.langchain:
147
- data['langchain.provider'] = self.langchain['provider']
148
- if 'mode' in self.langchain:
149
- data['langchain.mode'] = ",".join(self.langchain['mode'])
150
- if 'args' in self.langchain:
151
- # old versions support
152
- if isinstance(self.langchain['args'], dict):
153
- for key, value in self.langchain['args'].items():
154
- item = {}
155
- item['name'] = key
156
- item['value'] = value
157
- item['type'] = 'str'
158
- data['langchain.args'].append(item)
159
- elif isinstance(self.langchain['args'], list):
160
- data['langchain.args'] = self.langchain['args']
161
- if 'env' in self.langchain:
162
- # old versions support
163
- if isinstance(self.langchain['env'], dict):
164
- for key, value in self.langchain['env'].items():
165
- item = {}
166
- item['name'] = key
167
- item['value'] = value
168
- data['langchain.env'].append(item)
169
- elif isinstance(self.langchain['env'], list):
170
- data['langchain.env'] = self.langchain['env']
171
- """
172
-
173
- # llama_index
174
- # if 'provider' in self.llama_index:
175
- # data['llama_index.provider'] = self.llama_index['provider']
176
- # if 'mode' in self.llama_index:
177
- # data['llama_index.mode'] = ",".join(self.llama_index['mode'])
96
+ data = {
97
+ 'id': self.id,
98
+ 'name': self.name,
99
+ 'mode': ','.join(self.mode),
100
+ 'input': ','.join(self.input),
101
+ 'output': ','.join(self.output),
102
+ 'ctx': self.ctx,
103
+ 'tokens': self.tokens,
104
+ 'default': self.default,
105
+ 'extra': self.extra,
106
+ 'imported': self.imported,
107
+ 'provider': self.provider,
108
+ 'tool_calls': self.tool_calls,
109
+ 'llama_index.args': [],
110
+ 'llama_index.env': []
111
+ }
112
+
178
113
  if 'args' in self.llama_index:
179
114
  # old versions support
180
115
  if isinstance(self.llama_index['args'], dict):
181
116
  for key, value in self.llama_index['args'].items():
182
- item = {}
183
- item['name'] = key
184
- item['value'] = value
185
- item['type'] = 'str'
117
+ item = {
118
+ 'name': key,
119
+ 'value': value,
120
+ 'type': 'str'
121
+ }
186
122
  data['llama_index.args'].append(item)
187
123
  elif isinstance(self.llama_index['args'], list):
188
124
  data['llama_index.args'] = self.llama_index['args']
125
+
189
126
  if 'env' in self.llama_index:
190
127
  # old versions support
191
128
  if isinstance(self.llama_index['env'], dict):
192
129
  for key, value in self.llama_index['env'].items():
193
- item = {}
194
- item['name'] = key
195
- item['value'] = value
130
+ item = {
131
+ 'name': key,
132
+ 'value': value
133
+ }
196
134
  data['llama_index.env'].append(item)
197
135
  elif isinstance(self.llama_index['env'], list):
198
136
  data['llama_index.env'] = self.llama_index['env']
@@ -262,7 +200,12 @@ class ModelItem:
262
200
  return False
263
201
  return "ollama" in self.llama_index.get("provider", "")
264
202
 
265
- def get_provider(self):
203
+ def get_provider(self) -> str:
204
+ """
205
+ Get model provider
206
+
207
+ :return: Provider name
208
+ """
266
209
  return self.provider
267
210
 
268
211
  def get_ollama_model(self) -> str:
pygpt_net/item/preset.py CHANGED
@@ -6,165 +6,178 @@
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.08.09 19:00:00 #
9
+ # Updated Date: 2025.08.23 15:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
13
13
  import uuid
14
14
 
15
-
16
15
  class PresetItem:
17
-
18
-
19
16
  def __init__(self):
20
- self.uuid = None
21
- self.name = "*"
22
- self.ai_name = ""
17
+ self.agent = False
18
+ self.agent_llama = False
19
+ self.agent_openai = False
20
+ self.agent_provider = None
21
+ self.agent_provider_openai = None
23
22
  self.ai_avatar = ""
23
+ self.ai_name = ""
24
24
  self.ai_personalize = False
25
- self.user_name = ""
26
- self.prompt = ""
25
+ self.assistant = False
26
+ self.assistant_id = ""
27
+ self.audio = False
27
28
  self.chat = False
28
29
  self.completion = False
30
+ self.computer = False
31
+ self.description = ""
32
+ self.enabled = True
33
+ self.expert = False
34
+ self.experts = [] # agent mode
35
+ self.extra = {}
36
+ self.filename = None
29
37
  self.img = False
30
- self.vision = False
38
+ self.idx = None
31
39
  self.langchain = False
32
- self.assistant = False
33
40
  self.llama_index = False
34
- self.agent = False
35
- self.agent_llama = False
36
- self.agent_openai = False
37
- self.expert = False
38
- self.audio = False
41
+ self.model = None
42
+ self.name = "*"
43
+ self.prompt = ""
39
44
  self.research = False
40
- self.computer = False
45
+ self.remote_tools = []
41
46
  self.temperature = 1.0
42
- self.filename = None
43
- self.model = None
44
- self.version = None
45
- self.experts = [] # agent mode
46
- self.idx = None
47
- self.agent_provider = None
48
- self.agent_provider_openai = None
49
- self.assistant_id = ""
50
- self.description = ""
51
- self.enabled = True
52
47
  self.tools = {
53
48
  "function": [],
54
49
  }
55
- self.remote_tools = []
56
- self.extra = {}
50
+ self.uuid = None
51
+ self.user_name = ""
52
+ self.version = None
53
+ self.vision = False
57
54
 
58
55
  def get_id(self) -> str:
56
+ """
57
+ Get preset ID
58
+
59
+ :return: ID of the preset
60
+ """
59
61
  return self.filename
60
62
 
61
- def to_dict(self):
63
+ def to_dict(self) -> dict:
64
+ """
65
+ Convert preset item to dict
66
+
67
+ :return: dict representation of the preset item
68
+ """
62
69
  return {
63
- "uuid": str(self.uuid),
64
- "name": self.name,
65
- "ai_name": self.ai_name,
70
+ "agent": self.agent,
71
+ "agent_llama": self.agent_llama,
72
+ "agent_openai": self.agent_openai,
73
+ "agent_provider": self.agent_provider,
74
+ "agent_provider_openai": self.agent_provider_openai,
66
75
  "ai_avatar": self.ai_avatar,
76
+ "ai_name": self.ai_name,
67
77
  "ai_personalize": self.ai_personalize,
68
- "user_name": self.user_name,
69
- "prompt": self.prompt,
78
+ "assistant": self.assistant,
79
+ "assistant_id": self.assistant_id,
80
+ "audio": self.audio,
70
81
  "chat": self.chat,
71
82
  "completion": self.completion,
83
+ "computer": self.computer,
84
+ "description": self.description,
85
+ "enabled": self.enabled,
86
+ "expert": self.expert,
87
+ "experts": self.experts,
88
+ "extra": self.extra,
89
+ "filename": self.filename,
72
90
  "img": self.img,
73
- "vision": self.vision,
91
+ "idx": self.idx,
74
92
  "langchain": self.langchain,
75
- "assistant": self.assistant,
76
93
  "llama_index": self.llama_index,
77
- "agent": self.agent,
78
- "agent_llama": self.agent_llama,
79
- "agent_openai": self.agent_openai,
80
- "expert": self.expert,
81
- "audio": self.audio,
94
+ "model": self.model,
95
+ "name": self.name,
96
+ "prompt": self.prompt,
97
+ "remote_tools": self.remote_tools,
82
98
  "research": self.research,
83
- "computer": self.computer,
84
99
  "temperature": self.temperature,
85
- "filename": self.filename,
86
- "model": self.model,
87
100
  "tool.function": self.tools["function"],
88
- "experts": self.experts,
89
- "idx": self.idx,
90
- "agent_provider": self.agent_provider,
91
- "agent_provider_openai": self.agent_provider_openai,
92
- "assistant_id": self.assistant_id,
93
- "enabled": self.enabled,
94
- "description": self.description,
95
- "remote_tools": self.remote_tools,
96
- "extra": self.extra,
101
+ "user_name": self.user_name,
102
+ "uuid": str(self.uuid),
103
+ "version": self.version,
104
+ "vision": self.vision,
97
105
  }
98
106
 
99
- def from_dict(self, data):
100
- if "uuid" in data:
101
- self.uuid = uuid.UUID(data["uuid"])
102
- if "name" in data:
103
- self.name = data["name"]
104
- if "ai_name" in data:
105
- self.ai_name = data["ai_name"]
107
+ def from_dict(self, data: dict):
108
+ """
109
+ Load data from dict
110
+
111
+ :param data: data dict
112
+ """
113
+ if "agent" in data:
114
+ self.agent = data["agent"]
115
+ if "agent_llama" in data:
116
+ self.agent_llama = data["agent_llama"]
117
+ if "agent_openai" in data:
118
+ self.agent_openai = data["agent_openai"]
119
+ if "agent_provider" in data:
120
+ self.agent_provider = data["agent_provider"]
121
+ if "agent_provider_openai" in data:
122
+ self.agent_provider_openai = data["agent_provider_openai"]
106
123
  if "ai_avatar" in data:
107
124
  self.ai_avatar = data["ai_avatar"]
125
+ if "ai_name" in data:
126
+ self.ai_name = data["ai_name"]
108
127
  if "ai_personalize" in data:
109
128
  self.ai_personalize = data["ai_personalize"]
110
- if "user_name" in data:
111
- self.user_name = data["user_name"]
112
- if "prompt" in data:
113
- self.prompt = data["prompt"]
129
+ if "assistant" in data:
130
+ self.assistant = data["assistant"]
131
+ if "assistant_id" in data:
132
+ self.assistant_id = data["assistant_id"]
133
+ if "audio" in data:
134
+ self.audio = data["audio"]
114
135
  if "chat" in data:
115
136
  self.chat = data["chat"]
116
137
  if "completion" in data:
117
138
  self.completion = data["completion"]
139
+ if "computer" in data:
140
+ self.computer = data["computer"]
141
+ if "description" in data:
142
+ self.description = data["description"]
143
+ if "enabled" in data:
144
+ self.enabled = data["enabled"]
145
+ if "expert" in data:
146
+ self.expert = data["expert"]
147
+ if "experts" in data:
148
+ self.experts = data["experts"]
149
+ if "extra" in data:
150
+ self.extra = data["extra"]
151
+ if "filename" in data:
152
+ self.filename = data["filename"]
118
153
  if "img" in data:
119
154
  self.img = data["img"]
120
- if "vision" in data:
121
- self.vision = data["vision"]
155
+ if "idx" in data:
156
+ self.idx = data["idx"]
122
157
  if "langchain" in data:
123
158
  self.langchain = data["langchain"]
124
- if "assistant" in data:
125
- self.assistant = data["assistant"]
126
159
  if "llama_index" in data:
127
160
  self.llama_index = data["llama_index"]
128
- if "agent" in data:
129
- self.agent = data["agent"]
130
- if "agent_llama" in data:
131
- self.agent_llama = data["agent_llama"]
132
- if "agent_openai" in data:
133
- self.agent_openai = data["agent_openai"]
134
- if "expert" in data:
135
- self.expert = data["expert"]
136
- if "audio" in data:
137
- self.audio = data["audio"]
161
+ if "model" in data:
162
+ self.model = data["model"]
163
+ if "name" in data:
164
+ self.name = data["name"]
165
+ if "prompt" in data:
166
+ self.prompt = data["prompt"]
167
+ if "remote_tools" in data:
168
+ self.remote_tools = data["remote_tools"]
138
169
  if "research" in data:
139
170
  self.research = data["research"]
140
- if "computer" in data:
141
- self.computer = data["computer"]
142
171
  if "temperature" in data:
143
172
  self.temperature = data["temperature"]
144
- if "filename" in data:
145
- self.filename = data["filename"]
146
- if "model" in data:
147
- self.model = data["model"]
148
173
  if "tool.function" in data:
149
174
  self.tools["function"] = data["tool.function"]
150
- if "experts" in data:
151
- self.experts = data["experts"]
152
- if "idx" in data:
153
- self.idx = data["idx"]
154
- if "agent_provider" in data:
155
- self.agent_provider = data["agent_provider"]
156
- if "agent_provider_openai" in data:
157
- self.agent_provider_openai = data["agent_provider_openai"]
158
- if "assistant_id" in data:
159
- self.assistant_id = data["assistant_id"]
160
- if "enabled" in data:
161
- self.enabled = data["enabled"]
162
- if "description" in data:
163
- self.description = data["description"]
164
- if "remote_tools" in data:
165
- self.remote_tools = data["remote_tools"]
166
- if "extra" in data:
167
- self.extra = data["extra"]
175
+ if "user_name" in data:
176
+ self.user_name = data["user_name"]
177
+ if "uuid" in data:
178
+ self.uuid = uuid.UUID(data["uuid"])
179
+ if "vision" in data:
180
+ self.vision = data["vision"]
168
181
  return self
169
182
 
170
183
  def add_function(self, name: str, parameters: str, desc: str):
@@ -211,6 +224,10 @@ class PresetItem:
211
224
  pass
212
225
  return ""
213
226
 
214
- def __str__(self):
215
- """To string"""
227
+ def __str__(self) -> str:
228
+ """
229
+ To string
230
+
231
+ :return: serialized item
232
+ """
216
233
  return self.dump()
@@ -0,0 +1,12 @@
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.22 10:00:00 #
10
+ # ================================================== #
11
+
12
+ from .plugin import *