entari-plugin-server 0.7.2__tar.gz → 0.7.4__tar.gz
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.
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/PKG-INFO +3 -2
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/pyproject.toml +9 -2
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/__init__.py +13 -4
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/config.py +1 -1
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/LICENSE +0 -0
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/README.md +0 -0
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/README.md +0 -0
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/_adapter.py +0 -0
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/patch.py +0 -0
- {entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/tests/__init__.py +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: entari-plugin-server
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
4
4
|
Summary: Entari plugin for running Satori Server
|
|
5
|
+
Keywords: server,adapters,satori,entari,plugin
|
|
5
6
|
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
6
7
|
License: MIT
|
|
7
8
|
Project-URL: homepage, https://github.com/ArcletProject/entari-plugin-server
|
|
8
9
|
Project-URL: repository, https://github.com/ArcletProject/entari-plugin-server
|
|
9
10
|
Requires-Python: >=3.10
|
|
10
|
-
Requires-Dist: arclet-entari<0.19.0,>=0.18.
|
|
11
|
+
Requires-Dist: arclet-entari<0.19.0,>=0.18.0
|
|
11
12
|
Requires-Dist: satori-python-server<1.4.0,>=1.3.0
|
|
12
13
|
Provides-Extra: fastapi
|
|
13
14
|
Requires-Dist: fastapi>=0.116.1; extra == "fastapi"
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "entari-plugin-server"
|
|
3
|
-
version = "0.7.
|
|
3
|
+
version = "0.7.4"
|
|
4
4
|
description = "Entari plugin for running Satori Server"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "RF-Tar-Railt", email = "rf_tar_railt@qq.com" },
|
|
7
7
|
]
|
|
8
8
|
dependencies = [
|
|
9
|
-
"arclet-entari<0.19.0,>=0.18.
|
|
9
|
+
"arclet-entari<0.19.0,>=0.18.0",
|
|
10
10
|
"satori-python-server<1.4.0,>=1.3.0",
|
|
11
11
|
]
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
readme = "README.md"
|
|
14
|
+
keywords = [
|
|
15
|
+
"server",
|
|
16
|
+
"adapters",
|
|
17
|
+
"satori",
|
|
18
|
+
"entari",
|
|
19
|
+
"plugin",
|
|
20
|
+
]
|
|
14
21
|
|
|
15
22
|
[project.license]
|
|
16
23
|
text = "MIT"
|
{entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/__init__.py
RENAMED
|
@@ -35,7 +35,7 @@ plugin.metadata(
|
|
|
35
35
|
"server",
|
|
36
36
|
PluginRole.LIBRARY,
|
|
37
37
|
[{"name": "RF-Tar-Railt", "email": "rf_tar_railt@qq.com"}],
|
|
38
|
-
"0.7.
|
|
38
|
+
"0.7.4",
|
|
39
39
|
description="为 Entari 提供 Satori 服务器支持,基于此为 Entari 提供 ASGI 服务、适配器连接等功能",
|
|
40
40
|
urls={
|
|
41
41
|
"homepage": "https://github.com/ArcletProject/entari-plugin-server",
|
|
@@ -48,9 +48,9 @@ plugin.metadata(
|
|
|
48
48
|
conf = plugin.get_config(Config)
|
|
49
49
|
|
|
50
50
|
if conf.direct_adapter:
|
|
51
|
-
server = DirectAdapterServer(conf.host, conf.port, conf.path, conf.version, conf.token, uvicorn_options=conf.options, stream_threshold=conf.stream_threshold, stream_chunk_size=conf.stream_chunk_size) # type: ignore
|
|
51
|
+
server = DirectAdapterServer(conf.host, int(conf.port), conf.path, conf.version, conf.token, uvicorn_options=conf.options, stream_threshold=conf.stream_threshold, stream_chunk_size=conf.stream_chunk_size) # type: ignore
|
|
52
52
|
else:
|
|
53
|
-
server = Server(conf.host, conf.port, conf.path, conf.version, conf.token, uvicorn_options=conf.options, stream_threshold=conf.stream_threshold, stream_chunk_size=conf.stream_chunk_size) # type: ignore
|
|
53
|
+
server = Server(conf.host, int(conf.port), conf.path, conf.version, conf.token, uvicorn_options=conf.options, stream_threshold=conf.stream_threshold, stream_chunk_size=conf.stream_chunk_size) # type: ignore
|
|
54
54
|
|
|
55
55
|
pattern = re.compile(r"(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$")
|
|
56
56
|
|
|
@@ -87,8 +87,17 @@ def _load_adapter(adapter_config: dict):
|
|
|
87
87
|
if isinstance(ext, type) and issubclass(ext, Adapter) and ext is not Adapter:
|
|
88
88
|
args: dict = {k: (log_m.logger_id if v == "$logger_id" else v) for k, v in adapter_config.items()}
|
|
89
89
|
sig = inspect.signature(ext.__init__)
|
|
90
|
-
filtered_args = {k: v for k, v in args.items() if k in sig.parameters}
|
|
91
90
|
annos = inspect.get_annotations(ext.__init__, globals=module.__dict__, locals=globals(), eval_str=True)
|
|
91
|
+
if len(annos) == 1 and "config" in annos:
|
|
92
|
+
config_cls = annos["config"]
|
|
93
|
+
dcls = make_dataclass(
|
|
94
|
+
"AdapterConfig",
|
|
95
|
+
[],
|
|
96
|
+
bases=(config_cls, BasicConfModel),
|
|
97
|
+
)
|
|
98
|
+
dcls_instance = config_model_validate(dcls, args)
|
|
99
|
+
return ext(dcls_instance) # type: ignore
|
|
100
|
+
filtered_args = {k: v for k, v in args.items() if k in sig.parameters}
|
|
92
101
|
dcls = make_dataclass(
|
|
93
102
|
"AdapterConfig",
|
|
94
103
|
[
|
|
File without changes
|
|
File without changes
|
{entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/README.md
RENAMED
|
File without changes
|
{entari_plugin_server-0.7.2 → entari_plugin_server-0.7.4}/src/entari_plugin_server/_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|