pygpt-net 2.5.19__py3-none-any.whl → 2.5.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 (71) hide show
  1. pygpt_net/CHANGELOG.txt +13 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +8 -4
  4. pygpt_net/container.py +3 -3
  5. pygpt_net/controller/chat/command.py +4 -4
  6. pygpt_net/controller/chat/input.py +2 -2
  7. pygpt_net/controller/chat/stream.py +6 -2
  8. pygpt_net/controller/config/placeholder.py +28 -14
  9. pygpt_net/controller/lang/custom.py +2 -2
  10. pygpt_net/controller/mode/__init__.py +22 -1
  11. pygpt_net/controller/model/__init__.py +2 -2
  12. pygpt_net/controller/model/editor.py +6 -63
  13. pygpt_net/controller/model/importer.py +9 -7
  14. pygpt_net/controller/presets/editor.py +8 -8
  15. pygpt_net/core/agents/legacy.py +2 -2
  16. pygpt_net/core/bridge/__init__.py +5 -4
  17. pygpt_net/core/bridge/worker.py +5 -2
  18. pygpt_net/core/command/__init__.py +10 -8
  19. pygpt_net/core/debug/presets.py +2 -2
  20. pygpt_net/core/experts/__init__.py +2 -2
  21. pygpt_net/core/idx/chat.py +7 -20
  22. pygpt_net/core/idx/llm.py +27 -28
  23. pygpt_net/core/llm/__init__.py +25 -3
  24. pygpt_net/core/models/__init__.py +83 -9
  25. pygpt_net/core/modes/__init__.py +2 -2
  26. pygpt_net/core/presets/__init__.py +3 -3
  27. pygpt_net/core/prompt/__init__.py +5 -5
  28. pygpt_net/core/render/web/renderer.py +16 -16
  29. pygpt_net/core/tokens/__init__.py +3 -3
  30. pygpt_net/core/updater/__init__.py +5 -3
  31. pygpt_net/data/config/config.json +5 -3
  32. pygpt_net/data/config/models.json +1302 -3088
  33. pygpt_net/data/config/modes.json +1 -7
  34. pygpt_net/data/config/settings.json +60 -0
  35. pygpt_net/data/css/web-chatgpt.css +2 -2
  36. pygpt_net/data/locale/locale.de.ini +2 -2
  37. pygpt_net/data/locale/locale.en.ini +12 -4
  38. pygpt_net/data/locale/locale.es.ini +2 -2
  39. pygpt_net/data/locale/locale.fr.ini +2 -2
  40. pygpt_net/data/locale/locale.it.ini +2 -2
  41. pygpt_net/data/locale/locale.pl.ini +2 -2
  42. pygpt_net/data/locale/locale.uk.ini +2 -2
  43. pygpt_net/data/locale/locale.zh.ini +2 -2
  44. pygpt_net/item/model.py +49 -34
  45. pygpt_net/plugin/base/plugin.py +6 -5
  46. pygpt_net/provider/core/config/patch.py +18 -1
  47. pygpt_net/provider/core/model/json_file.py +7 -7
  48. pygpt_net/provider/core/model/patch.py +56 -7
  49. pygpt_net/provider/core/preset/json_file.py +4 -4
  50. pygpt_net/provider/gpt/__init__.py +9 -17
  51. pygpt_net/provider/gpt/chat.py +90 -20
  52. pygpt_net/provider/gpt/responses.py +58 -21
  53. pygpt_net/provider/llms/anthropic.py +2 -1
  54. pygpt_net/provider/llms/azure_openai.py +11 -7
  55. pygpt_net/provider/llms/base.py +3 -2
  56. pygpt_net/provider/llms/deepseek_api.py +3 -1
  57. pygpt_net/provider/llms/google.py +2 -1
  58. pygpt_net/provider/llms/hugging_face.py +8 -5
  59. pygpt_net/provider/llms/hugging_face_api.py +3 -1
  60. pygpt_net/provider/llms/local.py +2 -1
  61. pygpt_net/provider/llms/ollama.py +8 -6
  62. pygpt_net/provider/llms/openai.py +11 -7
  63. pygpt_net/provider/llms/perplexity.py +109 -0
  64. pygpt_net/provider/llms/x_ai.py +108 -0
  65. pygpt_net/ui/dialog/about.py +5 -5
  66. pygpt_net/ui/dialog/preset.py +5 -5
  67. {pygpt_net-2.5.19.dist-info → pygpt_net-2.5.21.dist-info}/METADATA +173 -285
  68. {pygpt_net-2.5.19.dist-info → pygpt_net-2.5.21.dist-info}/RECORD +71 -69
  69. {pygpt_net-2.5.19.dist-info → pygpt_net-2.5.21.dist-info}/LICENSE +0 -0
  70. {pygpt_net-2.5.19.dist-info → pygpt_net-2.5.21.dist-info}/WHEEL +0 -0
  71. {pygpt_net-2.5.19.dist-info → pygpt_net-2.5.21.dist-info}/entry_points.txt +0 -0
@@ -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.26 16:00:00 #
9
+ # Updated Date: 2025.06.28 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -19,6 +19,7 @@ from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
19
19
  from llama_index.embeddings.huggingface_api import HuggingFaceInferenceAPIEmbedding as HuggingFaceAPIEmbedding
20
20
  from llama_index.core.llms.llm import BaseLLM as LlamaBaseLLM
21
21
  from llama_index.core.base.embeddings.base import BaseEmbedding
22
+
22
23
  from pygpt_net.provider.llms.base import BaseLLM
23
24
  from pygpt_net.item.model import ModelItem
24
25
 
@@ -27,6 +28,7 @@ class HuggingFaceApiLLM(BaseLLM):
27
28
  def __init__(self, *args, **kwargs):
28
29
  super(HuggingFaceApiLLM, self).__init__(*args, **kwargs)
29
30
  self.id = "huggingface_api"
31
+ self.name = "HuggingFace API"
30
32
  self.type = [MODE_LLAMA_INDEX, "embeddings"]
31
33
 
32
34
  def llama(
@@ -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: 2024.12.14 22:00:00 #
9
+ # Updated Date: 2025.06.28 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from llama_index.llms.openai_like import OpenAILike
@@ -23,6 +23,7 @@ class LocalLLM(BaseLLM):
23
23
  def __init__(self, *args, **kwargs):
24
24
  super(LocalLLM, self).__init__(*args, **kwargs)
25
25
  self.id = "local_ai"
26
+ self.name = "Local model (OpenAI API compatible)"
26
27
  self.type = [MODE_LLAMA_INDEX]
27
28
 
28
29
  def llama(
@@ -6,13 +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.26 16:00:00 #
9
+ # Updated Date: 2025.06.28 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
13
13
  from typing import Optional, List, Dict
14
14
 
15
- from langchain_community.chat_models import ChatOllama
15
+ # from langchain_community.chat_models import ChatOllama
16
16
 
17
17
  from .ollama_custom import Ollama
18
18
 
@@ -21,7 +21,6 @@ from llama_index.core.base.embeddings.base import BaseEmbedding
21
21
  from llama_index.embeddings.ollama import OllamaEmbedding
22
22
 
23
23
  from pygpt_net.core.types import (
24
- MODE_LANGCHAIN,
25
24
  MODE_LLAMA_INDEX,
26
25
  )
27
26
  from pygpt_net.provider.llms.base import BaseLLM
@@ -33,7 +32,8 @@ class OllamaLLM(BaseLLM):
33
32
  def __init__(self, *args, **kwargs):
34
33
  super(OllamaLLM, self).__init__(*args, **kwargs)
35
34
  self.id = "ollama"
36
- self.type = [MODE_LANGCHAIN, MODE_LLAMA_INDEX, "embeddings"]
35
+ self.name = "Ollama"
36
+ self.type = [MODE_LLAMA_INDEX, "embeddings"]
37
37
 
38
38
  def completion(
39
39
  self,
@@ -49,7 +49,7 @@ class OllamaLLM(BaseLLM):
49
49
  :param stream: stream mode
50
50
  :return: LLM provider instance
51
51
  """
52
- return None
52
+ pass
53
53
 
54
54
  def chat(
55
55
  self,
@@ -64,11 +64,13 @@ class OllamaLLM(BaseLLM):
64
64
  :param model: model instance
65
65
  :param stream: stream mode
66
66
  :return: LLM provider instance
67
- """
67
+
68
68
  args = self.parse_args(model.langchain)
69
69
  if "model" not in args:
70
70
  args["model"] = model.id
71
71
  return ChatOllama(**args)
72
+ """
73
+ pass
72
74
 
73
75
  def llama(
74
76
  self,
@@ -6,13 +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.26 16:00:00 #
9
+ # Updated Date: 2025.06.28 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from typing import Optional, List, Dict
13
13
 
14
- from langchain_openai import OpenAI
15
- from langchain_openai import ChatOpenAI
14
+ # from langchain_openai import OpenAI
15
+ # from langchain_openai import ChatOpenAI
16
16
 
17
17
  from llama_index.core.llms.llm import BaseLLM as LlamaBaseLLM
18
18
  from llama_index.core.multi_modal_llms import MultiModalLLM as LlamaMultiModalLLM
@@ -22,7 +22,6 @@ from llama_index.multi_modal_llms.openai import OpenAIMultiModal as LlamaOpenAIM
22
22
  from llama_index.embeddings.openai import OpenAIEmbedding
23
23
 
24
24
  from pygpt_net.core.types import (
25
- MODE_LANGCHAIN,
26
25
  MODE_LLAMA_INDEX,
27
26
  )
28
27
  from pygpt_net.provider.llms.base import BaseLLM
@@ -33,7 +32,8 @@ class OpenAILLM(BaseLLM):
33
32
  def __init__(self, *args, **kwargs):
34
33
  super(OpenAILLM, self).__init__(*args, **kwargs)
35
34
  self.id = "openai"
36
- self.type = [MODE_LANGCHAIN, MODE_LLAMA_INDEX, "embeddings"]
35
+ self.name = "OpenAI"
36
+ self.type = [MODE_LLAMA_INDEX, "embeddings"]
37
37
 
38
38
  def completion(
39
39
  self,
@@ -48,11 +48,13 @@ class OpenAILLM(BaseLLM):
48
48
  :param model: model instance
49
49
  :param stream: stream mode
50
50
  :return: LLM provider instance
51
- """
51
+
52
52
  args = self.parse_args(model.langchain)
53
53
  if "model" not in args:
54
54
  args["model"] = model.id
55
55
  return OpenAI(**args)
56
+ """
57
+ pass
56
58
 
57
59
  def chat(
58
60
  self,
@@ -67,9 +69,11 @@ class OpenAILLM(BaseLLM):
67
69
  :param model: model instance
68
70
  :param stream: stream mode
69
71
  :return: LLM provider instance
70
- """
72
+
71
73
  args = self.parse_args(model.langchain)
72
74
  return ChatOpenAI(**args)
75
+ """
76
+ pass
73
77
 
74
78
  def llama(
75
79
  self,
@@ -0,0 +1,109 @@
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.06.28 16:00:00 #
10
+ # ================================================== #
11
+
12
+ from typing import Optional, List, Dict
13
+
14
+ from llama_index.core.llms.llm import BaseLLM as LlamaBaseLLM
15
+ from llama_index.core.multi_modal_llms import MultiModalLLM as LlamaMultiModalLLM
16
+ from llama_index.core.base.embeddings.base import BaseEmbedding
17
+
18
+ from pygpt_net.core.types import (
19
+ MODE_CHAT,
20
+ MODE_RESEARCH,
21
+ )
22
+ from pygpt_net.provider.llms.base import BaseLLM
23
+ from pygpt_net.item.model import ModelItem
24
+
25
+
26
+ class PerplexityLLM(BaseLLM):
27
+ def __init__(self, *args, **kwargs):
28
+ super(PerplexityLLM, self).__init__(*args, **kwargs)
29
+ self.id = "perplexity"
30
+ self.name = "Perplexity"
31
+ self.type = [MODE_CHAT, MODE_RESEARCH]
32
+
33
+ def completion(
34
+ self,
35
+ window,
36
+ model: ModelItem,
37
+ stream: bool = False
38
+ ):
39
+ """
40
+ Return LLM provider instance for completion
41
+
42
+ :param window: window instance
43
+ :param model: model instance
44
+ :param stream: stream mode
45
+ :return: LLM provider instance
46
+ """
47
+ pass
48
+
49
+ def chat(
50
+ self,
51
+ window,
52
+ model: ModelItem,
53
+ stream: bool = False
54
+ ):
55
+ """
56
+ Return LLM provider instance for chat
57
+
58
+ :param window: window instance
59
+ :param model: model instance
60
+ :param stream: stream mode
61
+ :return: LLM provider instance
62
+ """
63
+ pass
64
+
65
+ def llama(
66
+ self,
67
+ window,
68
+ model: ModelItem,
69
+ stream: bool = False
70
+ ) -> LlamaBaseLLM:
71
+ """
72
+ Return LLM provider instance for llama
73
+
74
+ :param window: window instance
75
+ :param model: model instance
76
+ :param stream: stream mode
77
+ :return: LLM provider instance
78
+ """
79
+ pass
80
+
81
+ def llama_multimodal(
82
+ self,
83
+ window,
84
+ model: ModelItem,
85
+ stream: bool = False
86
+ ) -> LlamaMultiModalLLM:
87
+ """
88
+ Return multimodal LLM provider instance for llama
89
+
90
+ :param window: window instance
91
+ :param model: model instance
92
+ :param stream: stream mode
93
+ :return: LLM provider instance
94
+ """
95
+ pass
96
+
97
+ def get_embeddings_model(
98
+ self,
99
+ window,
100
+ config: Optional[List[Dict]] = None
101
+ ) -> BaseEmbedding:
102
+ """
103
+ Return provider instance for embeddings
104
+
105
+ :param window: window instance
106
+ :param config: config keyword arguments list
107
+ :return: Embedding provider instance
108
+ """
109
+ pass
@@ -0,0 +1,108 @@
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.06.28 16:00:00 #
10
+ # ================================================== #
11
+
12
+ from typing import Optional, List, Dict
13
+
14
+ from llama_index.core.llms.llm import BaseLLM as LlamaBaseLLM
15
+ from llama_index.core.multi_modal_llms import MultiModalLLM as LlamaMultiModalLLM
16
+ from llama_index.core.base.embeddings.base import BaseEmbedding
17
+
18
+ from pygpt_net.core.types import (
19
+ MODE_CHAT,
20
+ )
21
+ from pygpt_net.provider.llms.base import BaseLLM
22
+ from pygpt_net.item.model import ModelItem
23
+
24
+
25
+ class xAILLM(BaseLLM):
26
+ def __init__(self, *args, **kwargs):
27
+ super(xAILLM, self).__init__(*args, **kwargs)
28
+ self.id = "x_ai"
29
+ self.name = "xAI"
30
+ self.type = [MODE_CHAT]
31
+
32
+ def completion(
33
+ self,
34
+ window,
35
+ model: ModelItem,
36
+ stream: bool = False
37
+ ):
38
+ """
39
+ Return LLM provider instance for completion
40
+
41
+ :param window: window instance
42
+ :param model: model instance
43
+ :param stream: stream mode
44
+ :return: LLM provider instance
45
+ """
46
+ pass
47
+
48
+ def chat(
49
+ self,
50
+ window,
51
+ model: ModelItem,
52
+ stream: bool = False
53
+ ):
54
+ """
55
+ Return LLM provider instance for chat
56
+
57
+ :param window: window instance
58
+ :param model: model instance
59
+ :param stream: stream mode
60
+ :return: LLM provider instance
61
+ """
62
+ pass
63
+
64
+ def llama(
65
+ self,
66
+ window,
67
+ model: ModelItem,
68
+ stream: bool = False
69
+ ) -> LlamaBaseLLM:
70
+ """
71
+ Return LLM provider instance for llama
72
+
73
+ :param window: window instance
74
+ :param model: model instance
75
+ :param stream: stream mode
76
+ :return: LLM provider instance
77
+ """
78
+ pass
79
+
80
+ def llama_multimodal(
81
+ self,
82
+ window,
83
+ model: ModelItem,
84
+ stream: bool = False
85
+ ) -> LlamaMultiModalLLM:
86
+ """
87
+ Return multimodal LLM provider instance for llama
88
+
89
+ :param window: window instance
90
+ :param model: model instance
91
+ :param stream: stream mode
92
+ :return: LLM provider instance
93
+ """
94
+ pass
95
+
96
+ def get_embeddings_model(
97
+ self,
98
+ window,
99
+ config: Optional[List[Dict]] = None
100
+ ) -> BaseEmbedding:
101
+ """
102
+ Return provider instance for embeddings
103
+
104
+ :param window: window instance
105
+ :param config: config keyword arguments list
106
+ :return: Embedding provider instance
107
+ """
108
+ pass
@@ -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: 2024.11.17 03:00:00 #
9
+ # Updated Date: 2025.06.28 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -49,19 +49,19 @@ class About:
49
49
 
50
50
  try:
51
51
  from llama_index.core import __version__ as llama_index_version
52
- from langchain import __version__ as langchain_version
52
+ # from langchain import __version__ as langchain_version
53
53
  from openai.version import VERSION as openai_version
54
54
  except ImportError:
55
55
  pass
56
56
 
57
57
  lib_versions = ""
58
- if llama_index_version is None or langchain_version is None or openai_version is None:
58
+ if llama_index_version is None or openai_version is None:
59
59
  versions = False
60
60
 
61
61
  if versions:
62
- lib_versions = "OpenAI API: {}, LangChain: {}, LlamaIndex: {}\n\n".format(
62
+ lib_versions = "OpenAI API: {}, LlamaIndex: {}\n\n".format(
63
63
  openai_version,
64
- langchain_version,
64
+ # langchain_version,
65
65
  llama_index_version,
66
66
  )
67
67
 
@@ -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.03.02 19:00:00 #
9
+ # Updated Date: 2025.06.28 16:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtCore import Qt
@@ -103,16 +103,16 @@ class Preset(BaseConfigDialog):
103
103
  # modes
104
104
  mode_keys = [
105
105
  MODE_CHAT,
106
- MODE_LLAMA_INDEX,
107
- MODE_AUDIO,
106
+ MODE_LLAMA_INDEX,
107
+ MODE_AUDIO,
108
+ MODE_RESEARCH,
108
109
  MODE_COMPLETION,
109
110
  MODE_IMAGE,
110
111
  MODE_VISION,
111
- MODE_LANGCHAIN,
112
+ # MODE_LANGCHAIN,
112
113
  MODE_AGENT_LLAMA,
113
114
  MODE_AGENT,
114
115
  MODE_EXPERT,
115
- MODE_RESEARCH,
116
116
  ]
117
117
  rows_mode = QVBoxLayout()
118
118
  rows_mode.addStretch()