JsonlTraceExporter
@Deprecated(forRemoval = true, since = "2.0.0") @SuppressWarnings("deprecation") public final class JsonlTraceExporter implements Hook, AutoCloseable
io/agentscope/core/hook/recorder/JsonlTraceExporter.java:85–548Jsonl 追踪导出器,驱动智能体的推理、工具调用与会话执行。位于 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)
返回构建器实例。
Performs the builder operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
outputFile | Path | 输出文件(类型 `Path`)。The output file. |
Builderio/agentscope/core/hook/recorder/JsonlTraceExporter.java:125–127priority
public int priority()
返回优先级。
Returns the priority.
intio/agentscope/core/hook/recorder/JsonlTraceExporter.java:129–132onEvent
public T extends HookEvent Mono<T> onEvent(T event)
处理事件事件。
Performs the on event operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
event | T | 事件(类型 `T`)。The event. |
Mono<T>io/agentscope/core/hook/recorder/JsonlTraceExporter.java:134–153close
public void close() throws IOException
关闭连接并释放相关资源。
Releases resources and connections.
IOException可能抛出 `IOException`。Thrown when the operation cannot be completed.
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.