PtcRunner.SubAgent.Namespace.SampleFormatter (PtcRunner v0.11.0)

Copy Markdown View Source

Shared sample-value formatting for namespace renderers.

Summary

Functions

Format a value as a Clojure-style sample string for namespace prompt sections.

Functions

format(value, opts)

@spec format(
  term(),
  keyword()
) :: String.t()

Format a value as a Clojure-style sample string for namespace prompt sections.

Reads :sample_limit (default 3) and :sample_printable_limit (default 80) from opts and delegates to PtcRunner.Lisp.Format.to_clojure/2.

Examples

iex> PtcRunner.SubAgent.Namespace.SampleFormatter.format(42, [])
"42"

iex> PtcRunner.SubAgent.Namespace.SampleFormatter.format([1, 2, 3, 4, 5], sample_limit: 2)
"[1 2 ...] (5 items, showing first 2)"