类 JsonlTraceExporter
java.lang.Object
io.agentscope.core.hook.recorder.JsonlTraceExporter
- 所有已实现的接口:
Hook,AutoCloseable
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
JsonlTraceExporter.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.
-
嵌套类概要
嵌套类 -
方法概要
-
方法详细资料
-
builder
-
priority
public int priority()从接口复制的说明:HookThe priority of this hook (lower value = higher priority).Hooks are executed in ascending priority order. Hooks with the same priority execute in their registration order.
Common Priority Ranges:
- 0-50: Critical system hooks (auth, security)
- 51-100: High priority hooks (validation, preprocessing)
- 101-500: Normal priority hooks (business logic)
- 501-1000: Low priority hooks (logging, metrics)
-
onEvent
从接口复制的说明:HookHandle a hook event.This method is called for all agent execution events. Use pattern matching to handle specific event types.
Modifiable Events: For events with setters, you can modify the context and the changes will affect agent execution:
PreReasoningEvent- Modify messages before LLM reasoningPostReasoningEvent- Modify reasoning resultsPreActingEvent- Modify tool parameters before executionPostActingEvent- Modify tool resultsPreCallEvent- Modify messages before agent startsPostCallEvent- Modify final agent response
Notification Events: Events without setters are read-only:
ReasoningChunkEvent- Streaming reasoning chunksActingChunkEvent- Streaming tool execution chunksErrorEvent- Errors during execution
-
close
- 指定者:
close在接口中AutoCloseable- 抛出:
IOException
-