Packages
Elixir framework for building production-ready AI agents and LLM applications: type-safe schemas with JSON Schema generation, tool calling, streaming, multi-agent coordination, guardrails, and distributed fault-tolerant sessions, with first-class Anthropic Claude support.
Current section
Files
Jump to
Current section
Files
lib/normandy/metadata.ex
defmodule Normandy.Metadata do
@moduledoc """
Metadata attached to schema structs.
Tracks the state, source, and context information for schema instances.
Used internally by the Schema system to manage struct lifecycle.
"""
defstruct [:state, :source, :context, :schema]
@type state :: :built | :loaded | :deleted
@type context :: any
@type t(schema) :: %__MODULE__{
context: context,
schema: schema,
state: state
}
@type t :: t(module)
defimpl Inspect do
import Inspect.Algebra
def inspect(metadata, opts) do
%{source: source, state: state, context: context} = metadata
entries =
for entry <- [state, source, context],
entry != nil,
do: to_doc(entry, opts)
concat(["#Normandy.Metadata<"] ++ Enum.intersperse(entries, ", ") ++ [">"])
end
end
end