chore(agent): raise core LangChain dependency baseline (#6301)

This commit is contained in:
InfinityPacer
2026-08-13 17:59:14 +08:00
committed by GitHub
parent 8dc6774d47
commit dc9f8ef168
3 changed files with 22 additions and 13 deletions
+4 -3
View File
@@ -77,8 +77,8 @@ pympler~=1.1
smbprotocol~=1.16.1 smbprotocol~=1.16.1
setproctitle~=1.3.7 setproctitle~=1.3.7
httpx[socks,http2]~=0.28.1 httpx[socks,http2]~=0.28.1
langchain~=1.3.9 langchain~=1.3.15
langchain-core~=1.4.7 langchain-core~=1.5.4
langchain-community~=0.4.2 langchain-community~=0.4.2
langchain-anthropic~=1.4.6 langchain-anthropic~=1.4.6
langchain-aws~=1.6.2 langchain-aws~=1.6.2
@@ -86,7 +86,8 @@ boto3~=1.42.42
langchain-openai~=1.3.2 langchain-openai~=1.3.2
langchain-google-genai~=4.2.5 langchain-google-genai~=4.2.5
langchain-deepseek~=1.1.0 langchain-deepseek~=1.1.0
langgraph~=1.2.5 langgraph~=1.2.11
langgraph-checkpoint~=4.2.0
anthropic~=0.109.1 anthropic~=0.109.1
openai~=2.41.1 openai~=2.41.1
google-genai~=2.8.0 google-genai~=2.8.0
+14 -10
View File
@@ -42,6 +42,18 @@ class _EchoInput(BaseModel):
query: str = Field(description="待回显文本") query: str = Field(description="待回显文本")
class _AgentFactoryLLM:
"""满足 Agent 构建与摘要中间件所需合同的测试模型。"""
_llm_type = "openai-chat"
model = "fake"
profile = {"max_input_tokens": 64000}
def with_retry(self):
"""返回可供摘要中间件调用的 Runnable。"""
return self
class _EchoTool(MoviePilotTool): class _EchoTool(MoviePilotTool):
"""返回输入文本的测试工具。""" """返回输入文本的测试工具。"""
@@ -769,11 +781,7 @@ def test_agent_middleware_secret_setting_result_stays_out_of_receipt_logs() -> N
def test_main_agent_registers_policy_middleware_as_outermost() -> None: def test_main_agent_registers_policy_middleware_as_outermost() -> None:
"""主 Agent 必须把宿主策略中间件放在 middleware 链最外层。""" """主 Agent 必须把宿主策略中间件放在 middleware 链最外层。"""
agent = agent_module.MoviePilotAgent(session_id="session-1", user_id="user-1") agent = agent_module.MoviePilotAgent(session_id="session-1", user_id="user-1")
fake_llm = SimpleNamespace( fake_llm = _AgentFactoryLLM()
_llm_type="openai-chat",
model="fake",
profile={"max_input_tokens": 64000},
)
captured = {} captured = {}
def _fake_create_agent(**kwargs): def _fake_create_agent(**kwargs):
@@ -801,11 +809,7 @@ def test_main_agent_preserves_activity_log_middleware_order() -> None:
channel=MessageChannel.WebAgent.value, channel=MessageChannel.WebAgent.value,
source="web-agent", source="web-agent",
) )
fake_llm = SimpleNamespace( fake_llm = _AgentFactoryLLM()
_llm_type="openai-chat",
model="fake",
profile={"max_input_tokens": 64000},
)
captured = {} captured = {}
def _fake_create_agent(**kwargs): def _fake_create_agent(**kwargs):
+4
View File
@@ -394,6 +394,10 @@ class LlmHelperTestCallTest(unittest.TestCase):
self.model = kwargs["model"] self.model = kwargs["model"]
self.profile = {"tool_calling": True} self.profile = {"tool_calling": True}
def with_retry(self):
"""满足 LangChain 摘要模型的 Runnable 合同。"""
return self
with patch.dict( with patch.dict(
sys.modules, sys.modules,
{"langchain_openai": SimpleNamespace(ChatOpenAI=_FakeChatOpenAI)}, {"langchain_openai": SimpleNamespace(ChatOpenAI=_FakeChatOpenAI)},