MimirAnalytics.Row.ToolCall (mimir_analytics v0.8.1)

Copy Markdown View Source

One row of tool_calls — a single custom/server tool use from a Capture session result, or one occurrence of a RunRecord name/count roll-up. new/1 owns extracting id/name/input off the tool-use map (formerly positional digs at the mapper call site) and defaulting input to %{} when the tool use carried none.

A RunRecord carries no per-invocation tool-use data — only %{name, count} roll-ups (the content boundary that struct enforces: arguments never leave the producer). Mappers.Session expands each roll-up into count occurrences, kind "rollup", tool_use_id and input both absent — this is the one place a tool_calls row carries no invocation identity.

Summary

Functions

Build a t() from run_id, seq, the raw tool_use map (%{"id" => ..., "name" => ..., "input" => ...}), its kind ("custom"/"server"/"rollup"), and source_file.

Types

kind()

@type kind() :: String.t()

t()

@type t() :: %MimirAnalytics.Row.ToolCall{
  input: map(),
  kind: kind(),
  name: String.t() | nil,
  run_id: String.t(),
  seq: integer(),
  source_file: String.t(),
  tool_use_id: String.t() | nil,
  turn: integer() | nil
}

Functions

new(map)

@spec new(%{
  run_id: String.t(),
  turn: integer() | nil,
  seq: integer(),
  tool_use: map(),
  kind: kind(),
  source_file: String.t()
}) :: t()

Build a t() from run_id, seq, the raw tool_use map (%{"id" => ..., "name" => ..., "input" => ...}), its kind ("custom"/"server"/"rollup"), and source_file.