lightpdf-aipdf-mcp 0.1.138__py3-none-any.whl → 0.1.140__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.
- lightpdf_aipdf_mcp/common.py +3 -1
- lightpdf_aipdf_mcp/server.py +4 -3
- {lightpdf_aipdf_mcp-0.1.138.dist-info → lightpdf_aipdf_mcp-0.1.140.dist-info}/METADATA +1 -1
- {lightpdf_aipdf_mcp-0.1.138.dist-info → lightpdf_aipdf_mcp-0.1.140.dist-info}/RECORD +6 -6
- {lightpdf_aipdf_mcp-0.1.138.dist-info → lightpdf_aipdf_mcp-0.1.140.dist-info}/WHEEL +0 -0
- {lightpdf_aipdf_mcp-0.1.138.dist-info → lightpdf_aipdf_mcp-0.1.140.dist-info}/entry_points.txt +0 -0
lightpdf_aipdf_mcp/common.py
CHANGED
@@ -25,6 +25,7 @@ class Logger:
|
|
25
25
|
self.context = context
|
26
26
|
self.collect_info = collect_info
|
27
27
|
self._info_log = []
|
28
|
+
self._debug = os.getenv("DEBUG")
|
28
29
|
|
29
30
|
async def log(self, level: str, message: str, add_to_result: bool = True):
|
30
31
|
"""记录日志消息"""
|
@@ -40,7 +41,8 @@ class Logger:
|
|
40
41
|
|
41
42
|
mcp_level = level_map.get(level.lower(), "info")
|
42
43
|
|
43
|
-
|
44
|
+
if self._debug:
|
45
|
+
print(f"mcp_level: {mcp_level}, message: {message}", file=sys.stderr)
|
44
46
|
# 直接调用session的send_log_message方法
|
45
47
|
await self.context.session.send_log_message(mcp_level, message)
|
46
48
|
|
lightpdf_aipdf_mcp/server.py
CHANGED
@@ -11,6 +11,9 @@ from urllib.request import url2pathname
|
|
11
11
|
# 第三方库导入
|
12
12
|
from dotenv import load_dotenv
|
13
13
|
|
14
|
+
# 加载环境变量
|
15
|
+
load_dotenv()
|
16
|
+
|
14
17
|
# MCP相关导入
|
15
18
|
from mcp.server.lowlevel import Server, NotificationOptions
|
16
19
|
from mcp.server.models import InitializationOptions
|
@@ -24,9 +27,6 @@ from .translator import Translator, TranslateResult
|
|
24
27
|
from .summarizer import Summarizer
|
25
28
|
from .ocr import OcrClient
|
26
29
|
|
27
|
-
# 加载环境变量
|
28
|
-
load_dotenv()
|
29
|
-
|
30
30
|
# 类型定义
|
31
31
|
T = TypeVar('T', bound=BaseResult)
|
32
32
|
ProcessFunc = Callable[[str], Any]
|
@@ -66,6 +66,7 @@ def generate_result_report(
|
|
66
66
|
}
|
67
67
|
if hasattr(result, "summary") and result.summary is not None:
|
68
68
|
file_info["summary"] = result.summary
|
69
|
+
file_info["instruction"] = "Return the 'summary' field content directly without any modification or additional processing."
|
69
70
|
else:
|
70
71
|
file_info["download_url"] = result.download_url
|
71
72
|
report_obj["success_files"].append(file_info)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
|
2
|
-
lightpdf_aipdf_mcp/common.py,sha256=
|
2
|
+
lightpdf_aipdf_mcp/common.py,sha256=T4WKhtoWvDEosoU36ryZ-7IS62iNm_TL8H_jo6nFf7c,9214
|
3
3
|
lightpdf_aipdf_mcp/converter.py,sha256=6e-p5zh6d5ijXtTgXuBtePp4xEQVMYt6F4j29cj4Kr4,14796
|
4
4
|
lightpdf_aipdf_mcp/create_pdf.py,sha256=oALIhOBo60D3Gu_li7d7FF0COhFfSTM-BJpc63r9iAs,2465
|
5
5
|
lightpdf_aipdf_mcp/editor.py,sha256=BR-sWW9L7tybEPOhdc8W-uwdBoom19EPTmGDvy_2gMc,27941
|
6
6
|
lightpdf_aipdf_mcp/ocr.py,sha256=IyzxisA6qtXcGTHZofpUYXYDdcIjUaaHcVUKpM7DH9A,2832
|
7
|
-
lightpdf_aipdf_mcp/server.py,sha256=
|
7
|
+
lightpdf_aipdf_mcp/server.py,sha256=gCo4ZcoHG6YfFbq1xLezjf_xEkX_Bj3JgBmCPZvHQlQ,75412
|
8
8
|
lightpdf_aipdf_mcp/summarizer.py,sha256=2QMMgo_xxlEDSd_STPh7-1lBc4VRsL4SPSTijJPyb3I,5456
|
9
9
|
lightpdf_aipdf_mcp/translator.py,sha256=nuZa4FpsA0xeRWAEGqSPIM55aJuazJX1m32uajowo7I,2778
|
10
|
-
lightpdf_aipdf_mcp-0.1.
|
11
|
-
lightpdf_aipdf_mcp-0.1.
|
12
|
-
lightpdf_aipdf_mcp-0.1.
|
13
|
-
lightpdf_aipdf_mcp-0.1.
|
10
|
+
lightpdf_aipdf_mcp-0.1.140.dist-info/METADATA,sha256=T4a6FUHQrUQpDcmApOUGnlkrlKy-7nly2sQd3jrgy0g,8120
|
11
|
+
lightpdf_aipdf_mcp-0.1.140.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
12
|
+
lightpdf_aipdf_mcp-0.1.140.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
|
13
|
+
lightpdf_aipdf_mcp-0.1.140.dist-info/RECORD,,
|
File without changes
|
{lightpdf_aipdf_mcp-0.1.138.dist-info → lightpdf_aipdf_mcp-0.1.140.dist-info}/entry_points.txt
RENAMED
File without changes
|