包package
agentscope.middlewareagentscope.middleware
module agentscope.middleware
用于AgentScope 智能体的中间件系统。 该包共收录 10 个公开类型。
Middleware system for AgentScope agents.
源码Source
agentscope/middleware/__init__.py:1类Classes
AgenticMemoryMiddleware类class | Agentic 记忆中间件,在智能体执行流程中提供横切扩展。 The agentic memory, where the LLM decides when and what to save, together with an asyncio retrieval task in each reply. The memory is stored and retrieval based on the Markdown files. |
ChatModelCandidate类class | 聊天模型 Candidate,驱动智能体的推理、工具调用与会话执行。 A named chat model and the criteria for selecting it. |
Mem0Middleware类class | Mem 0 中间件,在智能体执行流程中提供横切扩展。 AgentScope middleware that adds long-term memory backed by `mem0 <https://github.com/mem0ai/mem0>`_. |
MiddlewareBase类class | 中间件钩子基类 Base class for all middleware implementations. |
ModelRouterMiddleware类class | 模型路由器中间件,在智能体执行流程中提供横切扩展。 Select the chat model of each reply by classifying the user input. |
RAGMiddleware类class | RAG 中间件,在智能体执行流程中提供横切扩展。 Middleware that integrates knowledge-base search into the agent. |
ReMeMiddleware类class | Re Me 中间件,在智能体执行流程中提供横切扩展。 AgentScope middleware that adds long-term memory backed by `ReMe <https://github.com/agentscope-ai/ReMe>`_. |
ReplyBudgetControlMiddleware类class | 回复预算 Control 中间件,在智能体执行流程中提供横切扩展。 Middleware that enforces a weighted token budget per reply. |
TTSMiddleware类class | TTS 中间件,在智能体执行流程中提供横切扩展。 Synthesize speech for every text block produced during reasoning and inject the audio as ``DATA_BLOCK_*`` events into the stream. |
TracingMiddleware类class | 追踪中间件,在智能体执行流程中提供横切扩展。 Agent middleware that adds OpenTelemetry tracing to the reply, model-call and tool-execution lifecycles. |