MimirAnalytics.Row.ModelCall (mimir_analytics v0.8.1)

Copy Markdown View Source

One row of model_calls — a gateway "request_log" line. new/1 owns the rename off the wire shape (request_id → mimir_request_id, inserted_at → ts) and the usage/fallback defaults. run_id starts nil; GatewayExport.resolve_run_ids/1 backfills it via (workflow_id, step_id) against runs after ingest.

Summary

Functions

Build a t() from a decoded "request_log" line plus "source_file".

Types

t()

@type t() :: %MimirAnalytics.Row.ModelCall{
  cost_microdollars: integer(),
  error_class: String.t() | nil,
  fallback: boolean(),
  finish_reason: String.t() | nil,
  input_tokens: integer(),
  lane: String.t() | nil,
  latency_ms: integer() | nil,
  mimir_request_id: String.t(),
  model_id: String.t() | nil,
  output_tokens: integer(),
  parent_key_id: String.t() | nil,
  parent_step_id: String.t() | nil,
  provider: String.t() | nil,
  run_id: String.t() | nil,
  source_file: String.t(),
  status: String.t() | nil,
  step_id: String.t() | nil,
  tenant_id: String.t() | nil,
  ts: String.t() | nil,
  virtual_key_id: String.t() | nil,
  workflow_id: String.t() | nil
}

Functions

new(l)

@spec new(map()) :: t()

Build a t() from a decoded "request_log" line plus "source_file".