Skip to content

Release 0.4.0: Async tools

Choose a tag to compare

@frostming frostming released this 12 Feb 09:08
· 32 commits to main since this release
422a6e8

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 raises ErrorPayload for validation/input/tool lookup failures

Also removed/simplified:

  • ContextSelection removed (read_messages(...) returns list[dict[str, Any]])
  • QueryResult removed (TapeQuery.all() returns list[TapeEntry])

Migration pattern:

  • Replace .value / .error checks with try/except ErrorPayload.
  • Search old usage quickly with:
rg -n "StructuredOutput|\\.value\\b|\\.error\\b" src tests

For 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)

    • LLMCore now 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-commit to prek.
    • Updated related config/docs and lockfile.

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.