Merge pull request #3464 from xinnan-tech/chore/bump-deps-20261023
chore(deps): 批量升级 15 个依赖,适配 mcp 2.x
This commit is contained in:
2 files changed
+34
-23
No files matched your search
@@ -10,12 +10,13 @@ import concurrent.futures
|
|||||||
from contextlib import AsyncExitStack
|
from contextlib import AsyncExitStack
|
||||||
from typing import Optional, List, Dict, Any
|
from typing import Optional, List, Dict, Any
|
||||||
|
|
||||||
|
import httpx2
|
||||||
from mcp import ClientSession, StdioServerParameters, Implementation
|
from mcp import ClientSession, StdioServerParameters, Implementation
|
||||||
from mcp.client.session import SamplingFnT, ElicitationFnT, ListRootsFnT, LoggingFnT, MessageHandlerFnT
|
from mcp.client.session import SamplingFnT, ElicitationFnT, ListRootsFnT, LoggingFnT, MessageHandlerFnT
|
||||||
from mcp.client.stdio import stdio_client
|
from mcp.client.stdio import stdio_client
|
||||||
from mcp.client.sse import sse_client
|
from mcp.client.sse import sse_client
|
||||||
from mcp.client.streamable_http import streamablehttp_client
|
from mcp.client.streamable_http import streamable_http_client
|
||||||
from mcp.shared.session import ProgressFnT
|
from mcp.shared.dispatcher import ProgressFnT # mcp 2.x:从 mcp.shared.session 移来
|
||||||
|
|
||||||
from config.logger import setup_logging
|
from config.logger import setup_logging
|
||||||
from core.utils.util import sanitize_tool_name
|
from core.utils.util import sanitize_tool_name
|
||||||
@@ -203,13 +204,21 @@ class ServerMCPClient:
|
|||||||
|
|
||||||
if transport_type == "streamable-http" or transport_type == "http":
|
if transport_type == "streamable-http" or transport_type == "http":
|
||||||
# 使用 Streamable HTTP 传输
|
# 使用 Streamable HTTP 传输
|
||||||
http_r, http_w, get_session_id = await stack.enter_async_context(
|
# mcp 2.x:headers/timeout 改由 http_client 承载,产出从 3 元组变为 2 元组
|
||||||
streamablehttp_client(
|
http_client = httpx2.AsyncClient(
|
||||||
|
headers=headers,
|
||||||
|
timeout=httpx2.Timeout(
|
||||||
|
self.config.get("timeout", 30),
|
||||||
|
read=self.config.get("sse_read_timeout", 60 * 5),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
stack.push_async_callback(http_client.aclose)
|
||||||
|
|
||||||
|
http_r, http_w = await stack.enter_async_context(
|
||||||
|
streamable_http_client(
|
||||||
url=self.config["url"],
|
url=self.config["url"],
|
||||||
headers=headers,
|
http_client=http_client,
|
||||||
timeout=self.config.get("timeout", 30),
|
terminate_on_close=self.config.get("terminate_on_close", True),
|
||||||
sse_read_timeout=self.config.get("sse_read_timeout", 60 * 5),
|
|
||||||
terminate_on_close=self.config.get("terminate_on_close", True)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
read_stream, write_stream = http_r, http_w
|
read_stream, write_stream = http_r, http_w
|
||||||
|
|||||||
@@ -7,36 +7,38 @@ numpy==1.26.4
|
|||||||
websockets==14.2
|
websockets==14.2
|
||||||
#--------- 以下是可升级的依赖
|
#--------- 以下是可升级的依赖
|
||||||
pyyml==0.0.2
|
pyyml==0.0.2
|
||||||
silero_vad==6.2.1
|
silero_vad==6.2.3
|
||||||
opuslib_next==1.3.1
|
opuslib_next==1.3.1
|
||||||
pydub==0.25.1
|
pydub==0.25.1
|
||||||
funasr==1.2.7
|
funasr==1.4.16
|
||||||
|
# transformers>=5 要求 torch>=2.6,与本项目 torch 2.2.2 冲突(会禁用 PyTorch,fun_local 加载不了模型)
|
||||||
|
transformers<5
|
||||||
openai==2.8.1
|
openai==2.8.1
|
||||||
google-generativeai==0.8.5
|
google-generativeai==0.8.6
|
||||||
edge_tts==7.3.1
|
edge_tts==7.3.1
|
||||||
httpx==0.28.1
|
httpx==0.28.1
|
||||||
aiohttp==3.13.2
|
aiohttp==3.14.5
|
||||||
aiohttp_cors==0.8.1
|
aiohttp_cors==0.8.1
|
||||||
ormsgpack==1.12.0
|
ormsgpack==1.12.2
|
||||||
ruamel.yaml==0.18.16
|
ruamel.yaml==0.18.16
|
||||||
loguru==0.7.3
|
loguru==0.7.3
|
||||||
requests==2.32.5
|
requests==2.34.2
|
||||||
cozepy==0.20.0
|
cozepy==0.20.0
|
||||||
mem0ai==1.0.0
|
mem0ai==2.2.1
|
||||||
powermem>=0.3.1
|
powermem>=0.3.1
|
||||||
bs4==0.0.2
|
bs4==0.0.2
|
||||||
modelscope==1.39.1
|
modelscope==1.40.2
|
||||||
sherpa_onnx==1.12.29
|
sherpa_onnx==1.13.8
|
||||||
mcp==1.22.0
|
mcp==2.3.0
|
||||||
cnlunar==0.2.4
|
cnlunar==0.2.5
|
||||||
PySocks==1.7.1
|
PySocks==1.7.1
|
||||||
dashscope==1.25.2
|
dashscope==1.27.7
|
||||||
baidu-aip==4.16.13
|
baidu-aip==4.16.13
|
||||||
aioconsole==0.8.2
|
aioconsole==0.8.2
|
||||||
markitdown==0.1.3
|
markitdown==0.1.8
|
||||||
mcp-proxy==0.12.0
|
mcp-proxy==0.12.0
|
||||||
PyJWT==2.10.1
|
PyJWT==2.15.1
|
||||||
psutil==7.1.3
|
psutil==7.2.2
|
||||||
portalocker==3.2.0 # 暂留 3.x:4.x 与 qdrant-client<1.20 的 portalocker<4.0 约束冲突 (PR #3360)
|
portalocker==3.2.0 # 暂留 3.x:4.x 与 qdrant-client<1.20 的 portalocker<4.0 约束冲突 (PR #3360)
|
||||||
Jinja2==3.1.6
|
Jinja2==3.1.6
|
||||||
vosk==0.3.45
|
vosk==0.3.45
|
||||||
Reference in new issue
Block a user