Skip to main content

Built-in formatters

DefaultLLMFormatter formats:
  • PromptEvent
  • LLMEvent
  • ToolEvent
  • (optionally) StepEvent end/error events for compact logs
It truncates long text and argument blobs to keep console output manageable.

Custom formatting

You can create your own formatter by implementing:
def format(self, event) -> str | None:
    ...
Then plug it into a sink (or into the base PerTypeFormatter pattern) as part of your tracer configuration.

Next steps