TranscriptMiddleware
public class TranscriptMiddleware implements HarnessRuntimeMiddleware
源码Source
io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:42–113Transcript 中间件,在智能体执行流程中提供横切扩展。位于 io.agentscope.harness.agent.middleware 包,实现 HarnessRuntimeMiddleware。核心成员包括 onAgent、TranscriptMiddleware。
Persists the conversation transcript at the end of every agent call.
Independent of memory flush: wired even when disableMemoryHooks is set, so session
history stays complete for Operate / SessionSearchTool / resumption.
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Flux<AgentEvent> onAgent(Agent agent, RuntimeContext ctx, AgentInput input, Function<AgentInput, Flux<AgentEvent>> next) | 处理智能体事件。 Performs the on agent operation. |
构造器详情Constructor Detail
TranscriptMiddleware
public TranscriptMiddleware(WorkspaceManager workspaceManager)
初始化 TranscriptMiddleware 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceManager | WorkspaceManager | 工作区管理器(类型 `WorkspaceManager`)。The workspace manager. |
源码Source
io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:50–52TranscriptMiddleware
public TranscriptMiddleware(WorkspaceManager workspaceManager, TranscriptStore transcriptStore, String tenant)
初始化 TranscriptMiddleware 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceManager | WorkspaceManager | 工作区管理器(类型 `WorkspaceManager`)。The workspace manager. |
transcriptStore | TranscriptStore | transcript 存储(类型 `TranscriptStore`)。The transcript store. |
tenant | String | 租户(类型 `String`)。The tenant. |
源码Source
io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:54–59方法详情Method Detail
onAgent
public Flux<AgentEvent> onAgent(Agent agent, RuntimeContext ctx, AgentInput input, Function<AgentInput, Flux<AgentEvent>> next)
处理智能体事件。
Performs the on agent operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。The agent. |
ctx | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The ctx. |
input | AgentInput | 输入消息(类型 `AgentInput`)。The input. |
next | Function<AgentInput, Flux<AgentEvent>> | 下一个(类型 `Function >`)。The next. |
Flux<AgentEvent>返回Flux。Returns flux.
源码Source
io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:61–79