Release 0.4.0: Async tools
Highlights
- Introduced async tool execution support.
- Simplified public error handling by removing
StructuredOutput. - Added provider-specific max token handling in
LLMCore. - Improved tool error responses by preserving tool arguments on failure.
Breaking Changes
StructuredOutput removed from public API
StructuredOutput(value, error) is no longer used for non-streaming APIs.
Success now returns plain values, and failures raise ErrorPayload.
Affected API families include:
LLM.chat*,LLM.tool_calls*,LLM.if_*,LLM.classify*,LLM.embed*Tape.chat*,Tape.tool_calls*ToolExecutor.execute(...)now raisesErrorPayloadfor validation/input/tool lookup failures
Also removed/simplified:
ContextSelectionremoved (read_messages(...)returnslist[dict[str, Any]])QueryResultremoved (TapeQuery.all()returnslist[TapeEntry])
Migration pattern:
- Replace
.value/.errorchecks withtry/except ErrorPayload. - Search old usage quickly with:
rg -n "StructuredOutput|\\.value\\b|\\.error\\b" src testsFor detailed migration examples, see docs/guides/breaking-changes.md.
Features
-
feat: implement async tool execution(86a5f43)- Added async execution path for tool calls.
- Updated chat client and tool executor integration.
- Expanded contract and UX test coverage around async behavior.
-
feat: add provider-specific max tokens handling in LLMCore(a79be07)LLMCorenow applies max token behavior with provider-specific handling.
Fixes
fix: return tool arguments on error in tool response handling(279a36e)- Tool execution error responses now preserve original tool arguments for better debugging and recovery.
Refactors and Tooling
refactor: Refactor error handling and remove StructuredOutput(025b045)- Aligned client/core error semantics to Python-style exceptions.
- Updated tape query/context/session return types.
- Refreshed tests for new behavior.
- CI/dev tooling updates:
- Switched workflow hooks from
pre-committoprek. - Updated related config/docs and lockfile.
- Switched workflow hooks from
Diff Summary
From 0.3.2 to 0.4.0:
- 5 commits
- 25 files changed
- 998 insertions, 696 deletions
Recommended Upgrade Checklist
- Update call sites that rely on
.value/.error. - Add/adjust exception handling for
ErrorPayload. - Re-run test suites covering chat/tool-call/tape flows.
- Validate provider-specific token limits in your production configs.