Skip to content

v0.21.0

Choose a tag to compare

@basepointer basepointer released this 20 Oct 15:02

Changed (breaking): load_agent() is now agent_config(), and each message is a Run

The function never loaded an agent: you build your own, and it returns DecimalAI's half of
it. The names below are the ones the Anthropic and LangChain releases will use too.

  • load_agent() is agent_config() in decimalai, decimalai.openai_agents,
    decimalai.pydantic_ai and decimalai.adk, with the same arguments and the same result.
    load_agent still imports; calling it raises TypeError naming agent_config().
  • decimalai.adk.DecimalaiPlugin is DecimalAIPlugin; the old name raises TypeError
    naming the new one.
  • The neutral config starts a run per user message. support.run(message, variables=...)
    returns a Run (decimalai.Run) with system, tool_spec and load_skill(name). They
    replace support.system(message, context=...), support.tool_spec and
    support.load_skill(), which now raise AttributeError saying where they went. A run serves
    its own load_skill calls from any thread or task; before, a load was served against the
    latest system() of the thread or task that called it.
  • variables= is the parameter for the prompt's {{name}} values, and a
    MissingPromptVariable says so. The framework modules keep their framework's own source:
    Runner.run(context=...), Pydantic AI's deps, ADK's session state.
  • prompt_source (and the decimal.prompt.source trace attribute) says what happened:
    "decimalai", "decimalai (cached copy)", "fallback (unreachable)" and
    "fallback (none saved)", which were "decimal", "decimal (cached copy)", "fallback"
    and "code".
  • decimalai init --framework openai-agents, pydantic-ai and adk write the new names.

Migration:

# before
from decimalai.openai_agents import load_agent
from decimalai.adk import DecimalaiPlugin, load_agent
support = decimalai.load_agent("support", fallback=BASE)
system = support.system(question, context=customer)
tools = [*my_tools, support.tool_spec]
text = support.load_skill(name)

# after
from decimalai.openai_agents import agent_config
from decimalai.adk import DecimalAIPlugin, agent_config
support = decimalai.agent_config("support", fallback=BASE)
run = support.run(question, variables=customer)
system, tools = run.system, [*my_tools, run.tool_spec]
text = run.load_skill(name)

Fixed

  • Claude Agent SDK: one LLM call per model request. The Claude Code CLI streams one API
    request as several AssistantMessages, one per content block (thinking, text, each tool use),
    all carrying the request's message_id and the same usage. Each was recorded as its own LLM
    call, so a two-request tool-using run showed five calls, input and cache tokens repeated per
    message (46 input recorded against 18 used in the measured run), and output tokens
    under-reported (17 against 194: the stream reports a request's output count only as it starts). Messages sharing an id are now one
    call: input and cache counts are taken once, exactly as the request reported them; output is
    the run total from the ResultMessage, shared across the requests by how much each one
    generated, so the calls add up to the run. The platform estimates cost from these token
    counts, so Claude Agent SDK costs were understated too. When this ships, drop the "Known
    issue in SDK 0.20.0 and earlier" caveat from the docs' Claude Agent SDK page.