AS AgentScopeAPI 手册 / API Reference

JsonlTraceExporter

@Deprecated(forRemoval = true, since = "2.0.0") @SuppressWarnings("deprecation") public final class JsonlTraceExporter implements Hook, AutoCloseable
源码Source io/agentscope/core/hook/recorder/JsonlTraceExporter.java:85–548

Jsonl 追踪导出器,驱动智能体的推理、工具调用与会话执行。位于 io.agentscope.core.hook.recorder 包,实现 Hook、AutoCloseable。核心成员包括 builder、priority、onEvent、close。

A built-in, out-of-the-box JSONL trace exporter based on the Hook event system.

Each HookEvent is written as a single JSON object per line. This is designed for local debugging, offline troubleshooting, and attaching logs to issues.

Notes:

  • This exporter is best-effort by default: serialization / IO errors do not break agent execution unless Builder#failFast(boolean) is enabled.

  • This exporter performs blocking file IO on an internal single-threaded queue to keep file order, step IDs, and run IDs consistent.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.core.hook.recorder that drives agent reasoning, tool calls and conversation execution.

方法摘要Method Summary

方法Method说明Description
public static Builder builder(Path outputFile)
static
返回构建器实例。
Performs the builder operation.
public int priority()
返回优先级。
Returns the priority.
public T extends HookEvent Mono<T> onEvent(T event)
处理事件事件。
Performs the on event operation.
public void close() throws IOException
关闭连接并释放相关资源。
Releases resources and connections.

方法详情Method Detail

builder

public static Builder builder(Path outputFile)
static

返回构建器实例。

Performs the builder operation.

参数Parameters
名称Name类型Type说明Description
outputFilePath输出文件(类型 `Path`)。The output file.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/hook/recorder/JsonlTraceExporter.java:125–127

priority

public int priority()

返回优先级。

Returns the priority.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/hook/recorder/JsonlTraceExporter.java:129–132

onEvent

public T extends HookEvent Mono<T> onEvent(T event)

处理事件事件。

Performs the on event operation.

参数Parameters
名称Name类型Type说明Description
eventT事件(类型 `T`)。The event.
返回Returns Mono<T>
返回Mono。Returns mono.
源码Source io/agentscope/core/hook/recorder/JsonlTraceExporter.java:134–153

close

public void close() throws IOException

关闭连接并释放相关资源。

Releases resources and connections.

抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/hook/recorder/JsonlTraceExporter.java:302–336

嵌套类详情Nested Class Detail

Builder

public static final class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.core.hook.recorder 包。核心成员包括 append、flushEveryLine、failFast、priority、enabledEvents、includeReasoningChunks。

A class in io.agentscope.core.hook.recorder that drives agent reasoning, tool calls and conversation execution. Declared in io.agentscope.core.hook.recorder.

继承成员Inherited Members

继承自Methods inherited from Hook
基于官方固定版本源码静态生成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.