sycommon-python-lib 0.2.3a2__py3-none-any.whl → 0.2.3a3__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.
- sycommon/middleware/tool_result_truncation.py +8 -11
- {sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/METADATA +9 -9
- {sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/RECORD +6 -6
- {sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/WHEEL +0 -0
- {sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/top_level.txt +0 -0
|
@@ -51,7 +51,7 @@ MAX_IMAGE_BASE64_CHARS = 500
|
|
|
51
51
|
def _convert_list_content_to_str(content: list, tool_name: str) -> str:
|
|
52
52
|
"""将 list 类型的 ToolMessage.content 转换为字符串。
|
|
53
53
|
|
|
54
|
-
对于图片类型(type=image 且含 base64
|
|
54
|
+
对于图片类型(type=image 且含 base64),转换为提示模型自行用 execute 处理的说明。
|
|
55
55
|
对于文本类型,保留完整文本。
|
|
56
56
|
"""
|
|
57
57
|
parts = []
|
|
@@ -61,16 +61,13 @@ def _convert_list_content_to_str(content: list, tool_name: str) -> str:
|
|
|
61
61
|
if item_type == "image" and "base64" in item:
|
|
62
62
|
b64 = item["base64"]
|
|
63
63
|
mime = item.get("mime_type", "image/unknown")
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
f"[图片文件 ({mime}, {len(b64)} 字符 base64 数据), "
|
|
72
|
-
f"数据: {b64}]"
|
|
73
|
-
)
|
|
64
|
+
size_kb = len(b64) * 3 // 4 // 1024 # base64 -> bytes -> KB
|
|
65
|
+
parts.append(
|
|
66
|
+
f"[图片文件 ({mime}, {size_kb}KB) — "
|
|
67
|
+
f"图片二进制数据无法直接发送给模型。"
|
|
68
|
+
f"请使用 execute 工具通过 Python (如 PIL/OpenCV) 读取并处理图片,"
|
|
69
|
+
f"例如 OCR 识别文字、分析图片内容等。]"
|
|
70
|
+
)
|
|
74
71
|
elif "text" in item:
|
|
75
72
|
parts.append(item["text"])
|
|
76
73
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sycommon-python-lib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3a3
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -9,16 +9,16 @@ Requires-Dist: aiohttp>=3.13.5
|
|
|
9
9
|
Requires-Dist: aiomysql>=0.3.2
|
|
10
10
|
Requires-Dist: anyio>=4.12.1
|
|
11
11
|
Requires-Dist: decorator>=5.2.1
|
|
12
|
-
Requires-Dist: deepagents>=0.5.
|
|
13
|
-
Requires-Dist: elasticsearch>=9.
|
|
12
|
+
Requires-Dist: deepagents>=0.5.7
|
|
13
|
+
Requires-Dist: elasticsearch>=9.4.0
|
|
14
14
|
Requires-Dist: fastapi>=0.136.1
|
|
15
15
|
Requires-Dist: jinja2>=3.1.6
|
|
16
16
|
Requires-Dist: kafka-python>=2.3.1
|
|
17
|
-
Requires-Dist: langchain>=1.2.
|
|
18
|
-
Requires-Dist: langchain-core>=1.3.
|
|
17
|
+
Requires-Dist: langchain>=1.2.17
|
|
18
|
+
Requires-Dist: langchain-core>=1.3.3
|
|
19
19
|
Requires-Dist: langchain-openai>=1.2.1
|
|
20
20
|
Requires-Dist: langfuse>=4.5.1
|
|
21
|
-
Requires-Dist: langgraph>=1.1.
|
|
21
|
+
Requires-Dist: langgraph>=1.1.10
|
|
22
22
|
Requires-Dist: langgraph-checkpoint-redis>=0.4.1
|
|
23
23
|
Requires-Dist: ldap3>=2.9.1
|
|
24
24
|
Requires-Dist: loguru>=0.7.3
|
|
@@ -26,12 +26,12 @@ Requires-Dist: mysql-connector-python>=9.6.0
|
|
|
26
26
|
Requires-Dist: nacos-sdk-python<3.0,>=2.0.11
|
|
27
27
|
Requires-Dist: psutil>=7.2.2
|
|
28
28
|
Requires-Dist: pyxxl>=0.4.6
|
|
29
|
-
Requires-Dist: pydantic>=2.13.
|
|
29
|
+
Requires-Dist: pydantic>=2.13.4
|
|
30
30
|
Requires-Dist: python-dotenv>=1.2.2
|
|
31
|
-
Requires-Dist: python-multipart>=0.0.
|
|
31
|
+
Requires-Dist: python-multipart>=0.0.27
|
|
32
32
|
Requires-Dist: pyyaml>=6.0.3
|
|
33
33
|
Requires-Dist: redis>=7.3.0
|
|
34
|
-
Requires-Dist: sentry-sdk[fastapi]>=2.
|
|
34
|
+
Requires-Dist: sentry-sdk[fastapi]>=2.59.0
|
|
35
35
|
Requires-Dist: sqlalchemy[asyncio]>=2.0.48
|
|
36
36
|
Requires-Dist: starlette[full]>=1.0.0
|
|
37
37
|
Requires-Dist: tiktoken>=0.12.0
|
|
@@ -201,7 +201,7 @@ sycommon/middleware/mq.py,sha256=9X6KKtadFjBXKS5L3kEKujYio9wwGfWgXwWOAHO-HDg,254
|
|
|
201
201
|
sycommon/middleware/sandbox.py,sha256=SQnUvVE0gvBo_YrP4fdA-6ZmJxAG9Po1zUynNFrgTI4,61109
|
|
202
202
|
sycommon/middleware/timeout.py,sha256=KlxOPa8xl2dg6yuRi_EzkVJG8bX4stb5ueYxctzzGM8,1433
|
|
203
203
|
sycommon/middleware/token_tracking.py,sha256=rEbgV1bgWMdzAERx4aq5XAvOIT6jTY_tK1P0xHJnL3o,6609
|
|
204
|
-
sycommon/middleware/tool_result_truncation.py,sha256=
|
|
204
|
+
sycommon/middleware/tool_result_truncation.py,sha256=1IfhEwrOHzeSS-MB-43EOts2V_KYAq4T_utvqkhTdbE,7005
|
|
205
205
|
sycommon/middleware/traceid.py,sha256=HX4zg7Tp_mPNr2eWDDvK3f7GFJ6eOSeW062Xcc-xshc,14340
|
|
206
206
|
sycommon/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
207
207
|
sycommon/models/base_http.py,sha256=EICAAibx3xhjBsLqm35Mi3DCqxp0FME4rD_3iQVjT_E,3051
|
|
@@ -257,8 +257,8 @@ sycommon/tools/syemail.py,sha256=BDFhgf7WDOQeTcjxJEQdu0dQhnHFPO_p3eI0-Ni3LhQ,561
|
|
|
257
257
|
sycommon/tools/timing.py,sha256=OiiE7P07lRoMzX9kzb8sZU9cDb0zNnqIlY5pWqHcnkY,2064
|
|
258
258
|
sycommon/xxljob/__init__.py,sha256=7eoBlQxv-B39IfRSCY2bkqdGYs1QRe1umAWd88VMEEM,86
|
|
259
259
|
sycommon/xxljob/xxljob_service.py,sha256=JIEJaGXhqrTLcyxlyynSrsHg9bBnDNzX-D4qIWLRPUE,6815
|
|
260
|
-
sycommon_python_lib-0.2.
|
|
261
|
-
sycommon_python_lib-0.2.
|
|
262
|
-
sycommon_python_lib-0.2.
|
|
263
|
-
sycommon_python_lib-0.2.
|
|
264
|
-
sycommon_python_lib-0.2.
|
|
260
|
+
sycommon_python_lib-0.2.3a3.dist-info/METADATA,sha256=VgbgOuVKym6ZUtH2Q4Ip9g0hiNbFiwzlPyqMdh_kFVo,7741
|
|
261
|
+
sycommon_python_lib-0.2.3a3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
262
|
+
sycommon_python_lib-0.2.3a3.dist-info/entry_points.txt,sha256=gsR4SssKxDWjRU8ggidzNcdMXDPRSKRS7UaGyNP84Qg,92
|
|
263
|
+
sycommon_python_lib-0.2.3a3.dist-info/top_level.txt,sha256=RgphKrg7nJyZ7irJqbxFr-5H2LUYTvI7ivoWZH2hcD0,29
|
|
264
|
+
sycommon_python_lib-0.2.3a3.dist-info/RECORD,,
|
|
File without changes
|
{sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{sycommon_python_lib-0.2.3a2.dist-info → sycommon_python_lib-0.2.3a3.dist-info}/top_level.txt
RENAMED
|
File without changes
|