Repository navigation
v0.21.0
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()isagent_config()indecimalai,decimalai.openai_agents,
decimalai.pydantic_aianddecimalai.adk, with the same arguments and the same result.
load_agentstill imports; calling it raisesTypeErrornamingagent_config().decimalai.adk.DecimalaiPluginisDecimalAIPlugin; the old name raisesTypeError
naming the new one.- The neutral config starts a run per user message.
support.run(message, variables=...)
returns aRun(decimalai.Run) withsystem,tool_specandload_skill(name). They
replacesupport.system(message, context=...),support.tool_specand
support.load_skill(), which now raiseAttributeErrorsaying where they went. A run serves
its ownload_skillcalls from any thread or task; before, a load was served against the
latestsystem()of the thread or task that called it. variables=is the parameter for the prompt's{{name}}values, and a
MissingPromptVariablesays so. The framework modules keep their framework's own source:
Runner.run(context=...), Pydantic AI'sdeps, ADK's session state.prompt_source(and thedecimal.prompt.sourcetrace 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-aiandadkwrite 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 severalAssistantMessages, one per content block (thinking, text, each tool use),
all carrying the request'smessage_idand the sameusage. 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 theResultMessage, 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.