AS AgentScopeAPI 手册 / API Reference
包package agentscope.middleware

agentscope.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.
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.