glchat-plugin 0.2.10__py3-none-any.whl → 0.2.12__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.
- glchat_plugin/config/constant.py +24 -1
- glchat_plugin/pipeline/pipeline_handler.py +23 -1
- glchat_plugin/pipeline/pipeline_plugin.py +6 -2
- {glchat_plugin-0.2.10.dist-info → glchat_plugin-0.2.12.dist-info}/METADATA +1 -1
- {glchat_plugin-0.2.10.dist-info → glchat_plugin-0.2.12.dist-info}/RECORD +7 -7
- {glchat_plugin-0.2.10.dist-info → glchat_plugin-0.2.12.dist-info}/WHEEL +0 -0
- {glchat_plugin-0.2.10.dist-info → glchat_plugin-0.2.12.dist-info}/top_level.txt +0 -0
glchat_plugin/config/constant.py
CHANGED
|
@@ -20,12 +20,21 @@ class SearchType(StrEnum):
|
|
|
20
20
|
WEB: Get more relevant information from the web. (DEPRECATED)
|
|
21
21
|
Web Search uses real-time data. Agent selection isn't available in this mode.
|
|
22
22
|
DEEP_RESEARCH: Get answer from Deep Research Agent.
|
|
23
|
+
ESSENTIALS_DEEP_RESEARCH: Get answer from Deep Research with Essentials mode.
|
|
24
|
+
Provides key points and core insights without noise, optimized for speed and clarity.
|
|
25
|
+
Ideal for quick decision-making support and fast orientation.
|
|
26
|
+
COMPREHENSIVE_DEEP_RESEARCH: Get answer from Deep Research with Comprehensive mode.
|
|
27
|
+
Delivers the full picture with depth and thoroughness, covering all relevant angles,
|
|
28
|
+
details, and supporting data. Suitable for professional research tasks where
|
|
29
|
+
precision matters more than speed.
|
|
23
30
|
"""
|
|
24
31
|
|
|
25
32
|
NORMAL = "normal"
|
|
26
33
|
SEARCH = "search"
|
|
27
34
|
_WEB = "web" # Underscore to hide it from normal use
|
|
28
|
-
|
|
35
|
+
_DEEP_RESEARCH = "deep_research"
|
|
36
|
+
ESSENTIALS_DEEP_RESEARCH = "essentials_deep_research"
|
|
37
|
+
COMPREHENSIVE_DEEP_RESEARCH = "comprehensive_deep_research"
|
|
29
38
|
|
|
30
39
|
@property
|
|
31
40
|
def WEB(cls) -> "SearchType":
|
|
@@ -39,3 +48,17 @@ class SearchType(StrEnum):
|
|
|
39
48
|
stacklevel=2,
|
|
40
49
|
)
|
|
41
50
|
return cls._WEB
|
|
51
|
+
|
|
52
|
+
# ruff: noqa: E501
|
|
53
|
+
@property
|
|
54
|
+
def DEEP_RESEARCH(cls) -> "SearchType":
|
|
55
|
+
"""Deprecated: Use ESSENTIALS_DEEP_RESEARCH or COMPREHENSIVE_DEEP_RESEARCH instead.
|
|
56
|
+
|
|
57
|
+
Will be removed in version 0.3.0
|
|
58
|
+
"""
|
|
59
|
+
warnings.warn(
|
|
60
|
+
"SearchType.DEEP_RESEARCH is deprecated and will be removed in a future version. Use SearchType.ESSENTIALS_DEEP_RESEARCH or SearchType.COMPREHENSIVE_DEEP_RESEARCH instead.",
|
|
61
|
+
DeprecationWarning,
|
|
62
|
+
stacklevel=2,
|
|
63
|
+
)
|
|
64
|
+
return cls._DEEP_RESEARCH
|
|
@@ -66,6 +66,9 @@ class ChatbotPresetMapping(BaseModel):
|
|
|
66
66
|
logger = LoggerManager().get_logger(__name__)
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
INTERNAL_PIPELINES = ["preprocessing", "postprocessing"]
|
|
70
|
+
|
|
71
|
+
|
|
69
72
|
class PipelineHandler(PluginHandler):
|
|
70
73
|
"""Handler for pipeline builder plugins.
|
|
71
74
|
|
|
@@ -186,6 +189,25 @@ class PipelineHandler(PluginHandler):
|
|
|
186
189
|
plugin.lmrp_catalogs = instance._chatbot_configs[chatbot_id].lmrp_catalogs
|
|
187
190
|
instance._builders[chatbot_id] = plugin
|
|
188
191
|
|
|
192
|
+
for pipeline_type in INTERNAL_PIPELINES:
|
|
193
|
+
internal_plugin = instance._plugins.get(pipeline_type)
|
|
194
|
+
if internal_plugin:
|
|
195
|
+
try:
|
|
196
|
+
internal_plugin.prompt_builder_catalogs = instance._chatbot_configs[
|
|
197
|
+
chatbot_id
|
|
198
|
+
].prompt_builder_catalogs
|
|
199
|
+
internal_plugin.lmrp_catalogs = instance._chatbot_configs[chatbot_id].lmrp_catalogs
|
|
200
|
+
pipeline_config = instance._chatbot_configs[chatbot_id].pipeline_config.copy()
|
|
201
|
+
pipeline = await internal_plugin.build(pipeline_config)
|
|
202
|
+
pipeline_key = (chatbot_id, f"__{pipeline_type}__")
|
|
203
|
+
instance._chatbot_pipeline_keys.setdefault(chatbot_id, set()).add(pipeline_key)
|
|
204
|
+
instance._pipeline_cache[pipeline_key] = pipeline
|
|
205
|
+
except Exception as e:
|
|
206
|
+
logger.warning(f"Failed when ainit plugin {traceback.format_exc()}")
|
|
207
|
+
logger.warning(
|
|
208
|
+
f"Error building internal pipeline `{pipeline_type}` for chatbot `{chatbot_id}`: {e}"
|
|
209
|
+
)
|
|
210
|
+
|
|
189
211
|
for model in supported_models:
|
|
190
212
|
try:
|
|
191
213
|
model_id = model.get("model_id", model.get("name"))
|
|
@@ -206,7 +228,7 @@ class PipelineHandler(PluginHandler):
|
|
|
206
228
|
instance._chatbot_pipeline_keys.setdefault(chatbot_id, set()).add(pipeline_key)
|
|
207
229
|
instance._pipeline_cache[pipeline_key] = pipeline
|
|
208
230
|
except Exception as e:
|
|
209
|
-
logger.warning(f"Failed when ainit
|
|
231
|
+
logger.warning(f"Failed when ainit plugin {traceback.format_exc()}")
|
|
210
232
|
logger.warning(f"Error building pipeline for chatbot `{chatbot_id}` model `{model_id}`: {e}")
|
|
211
233
|
|
|
212
234
|
def get_pipeline_builder(self, chatbot_id: str) -> Plugin:
|
|
@@ -31,7 +31,8 @@ class PipelineBuilderPlugin(Plugin, Generic[PipelineState, PipelinePresetConfig]
|
|
|
31
31
|
name (str): The name of the plugin.
|
|
32
32
|
description (str): The description of the plugin.
|
|
33
33
|
version (str): The version of the plugin.
|
|
34
|
-
|
|
34
|
+
lmrp_catalogs (dict[str, BaseCatalog[Any]] | None): The LM request processor catalogs.
|
|
35
|
+
prompt_builder_catalogs (dict[str, BaseCatalog[Any]] | None): The prompt builder catalogs.
|
|
35
36
|
additional_config_class (Type[PipelineRuntimeConfig] | None): The additional runtime configuration class.
|
|
36
37
|
preset_config_class (Type[PipelinePresetConfig] | None): The preset configuration class.
|
|
37
38
|
"""
|
|
@@ -40,7 +41,8 @@ class PipelineBuilderPlugin(Plugin, Generic[PipelineState, PipelinePresetConfig]
|
|
|
40
41
|
description: str = "Pipeline builder plugin"
|
|
41
42
|
version: str = "0.0.0"
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
lmrp_catalogs: dict[str, BaseCatalog[Any]] | None = None
|
|
45
|
+
prompt_builder_catalogs: dict[str, BaseCatalog[Any]] | None = None
|
|
44
46
|
|
|
45
47
|
additional_config_class: Type[PipelineRuntimeConfig] | None = None
|
|
46
48
|
preset_config_class: Type[PipelinePresetConfig] | None = None
|
|
@@ -64,6 +66,7 @@ class PipelineBuilderPlugin(Plugin, Generic[PipelineState, PipelinePresetConfig]
|
|
|
64
66
|
self,
|
|
65
67
|
request_config: dict[str, Any],
|
|
66
68
|
pipeline_config: dict[str, Any],
|
|
69
|
+
previous_state: dict[str, Any] | None = None,
|
|
67
70
|
**kwargs: Any,
|
|
68
71
|
) -> PipelineState:
|
|
69
72
|
"""Build the initial pipeline state.
|
|
@@ -71,6 +74,7 @@ class PipelineBuilderPlugin(Plugin, Generic[PipelineState, PipelinePresetConfig]
|
|
|
71
74
|
Args:
|
|
72
75
|
request_config (dict[str, Any]): Request configuration.
|
|
73
76
|
pipeline_config (dict[str, Any]): Pipeline configuration.
|
|
77
|
+
previous_state (dict[str, Any] | None): Previous state.
|
|
74
78
|
kwargs (Any): Additional state arguments.
|
|
75
79
|
|
|
76
80
|
Returns:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
glchat_plugin/__init__.py,sha256=SHSBMz7JDU6MecyIrhHu5-3NVs89JkXhyvD3ZGOkWOE,37
|
|
2
2
|
glchat_plugin/config/__init__.py,sha256=DNnX8B_TvAN89oyMgq32zG1DeaezODrihiAXTwOPT5o,39
|
|
3
3
|
glchat_plugin/config/app_config.py,sha256=9_ShYtaQ7Rp14sSkrIFLoOAMlbwVlm13EuCxzOn4NCI,426
|
|
4
|
-
glchat_plugin/config/constant.py,sha256=
|
|
4
|
+
glchat_plugin/config/constant.py,sha256=D8BCSkwL7AbXUT_zdsXEdLmmuSlLThSJn7-02niZeXI,2340
|
|
5
5
|
glchat_plugin/context/__init__.py,sha256=3Wx_apMIS6z-m6eRs6hoyOsJFLJfKmMFOkrPDkPQfJI,40
|
|
6
6
|
glchat_plugin/context/context_manager.py,sha256=0lhO0w_hd5dUdIEJQ2LOJFZsgpzitQU_aPZfTfQK3vw,1302
|
|
7
7
|
glchat_plugin/handler/__init__.py,sha256=H5DJaAfwwtRsvMcOaEzHfGMQk25H7la0E7uPfksWtoQ,40
|
|
8
8
|
glchat_plugin/handler/base_post_login_handler.py,sha256=48xSbe_LwTCjRY-lCuzWXqbnEr1ql8bAhQih1Xeh8f8,2835
|
|
9
9
|
glchat_plugin/pipeline/__init__.py,sha256=Sk-NfIGyA9VKIg0Bt5OHatNUYyWVPh9i5xhE5DFAfbo,41
|
|
10
10
|
glchat_plugin/pipeline/base_pipeline_preset_config.py,sha256=2DxJlroZ_tvVO6DYo1R07cjhWgKQJpysw1GsJ3BNRnw,1100
|
|
11
|
-
glchat_plugin/pipeline/pipeline_handler.py,sha256=
|
|
12
|
-
glchat_plugin/pipeline/pipeline_plugin.py,sha256=
|
|
11
|
+
glchat_plugin/pipeline/pipeline_handler.py,sha256=aCRvhS6Dkhmqsx_Ya-2t2PbMseacw1VI6PUEOQq0RsM,25620
|
|
12
|
+
glchat_plugin/pipeline/pipeline_plugin.py,sha256=fozvxVrOphgwLIF7uPrEkF8ZQcu8xgifYAQyuxj9628,4393
|
|
13
13
|
glchat_plugin/service/__init__.py,sha256=9T4qzyYL052qLqva5el1F575OTRNaaf9tb9UvW-leTc,47
|
|
14
14
|
glchat_plugin/service/base_rate_limiter_service.py,sha256=tgKwdr4EqnGo5iDRVJPnlg8W9q0hiUzfeewAtdW4IjU,1232
|
|
15
15
|
glchat_plugin/service/base_tenant_service.py,sha256=CB-jJWXi87nTcjO1XhPoSgNMf2YA_LfXoHr30ye0VtI,734
|
|
@@ -19,7 +19,7 @@ glchat_plugin/storage/base_anonymizer_storage.py,sha256=oFwovWrsjM7v1YjeN-4p-M3O
|
|
|
19
19
|
glchat_plugin/storage/base_chat_history_storage.py,sha256=JvUUFMu_9jRBQ9yug_x7S4rQjZEA1vM5ombDvz-7zCE,11095
|
|
20
20
|
glchat_plugin/tools/__init__.py,sha256=OFotHbgQ8mZEbdlvlv5aVMdxfubPvkVWAcTwhIPdIqQ,542
|
|
21
21
|
glchat_plugin/tools/decorators.py,sha256=AvQBV18wzXWdC483RSSmpfh92zsqTyp8SzDLIkreIGU,3925
|
|
22
|
-
glchat_plugin-0.2.
|
|
23
|
-
glchat_plugin-0.2.
|
|
24
|
-
glchat_plugin-0.2.
|
|
25
|
-
glchat_plugin-0.2.
|
|
22
|
+
glchat_plugin-0.2.12.dist-info/METADATA,sha256=h6yydWtgi_jo81TY5ghsCrT0GgNdjrOD_4dimxcZi7Q,2064
|
|
23
|
+
glchat_plugin-0.2.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
glchat_plugin-0.2.12.dist-info/top_level.txt,sha256=fzKSXmct5dY4CAKku4-mkdHX-QPAyQVvo8vpQj8qizY,14
|
|
25
|
+
glchat_plugin-0.2.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|