AS AgentScopeAPI 手册 / API Reference

TranscriptMiddleware

public class TranscriptMiddleware implements HarnessRuntimeMiddleware
源码Source io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:42–113

Transcript 中间件,在智能体执行流程中提供横切扩展。位于 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

构造器Constructor说明Description
public TranscriptMiddleware(WorkspaceManager workspaceManager)
初始化 `TranscriptMiddleware` 实例。
Creates a new instance.
public TranscriptMiddleware(WorkspaceManager workspaceManager, TranscriptStore transcriptStore, String tenant)
初始化 `TranscriptMiddleware` 实例。
Creates a new instance.

方法摘要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
workspaceManagerWorkspaceManager工作区管理器(类型 `WorkspaceManager`)。The workspace manager.
源码Source io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:50–52

TranscriptMiddleware

public TranscriptMiddleware(WorkspaceManager workspaceManager, TranscriptStore transcriptStore, String tenant)

初始化 TranscriptMiddleware 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
workspaceManagerWorkspaceManager工作区管理器(类型 `WorkspaceManager`)。The workspace manager.
transcriptStoreTranscriptStoretranscript 存储(类型 `TranscriptStore`)。The transcript store.
tenantString租户(类型 `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
agentAgent智能体(类型 `Agent`)。The agent.
ctxRuntimeContext运行时上下文(类型 `RuntimeContext`)。The ctx.
inputAgentInput输入消息(类型 `AgentInput`)。The input.
nextFunction<AgentInput, Flux<AgentEvent>>下一个(类型 `Function >`)。The next.
返回Returns Flux<AgentEvent>
返回Flux。Returns flux.
源码Source io/agentscope/harness/agent/middleware/TranscriptMiddleware.java:61–79

继承成员Inherited Members

基于官方固定版本源码静态生成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.