Skip to content

feat(tools): add function and tool calling helpers #127

@leehack

Description

@leehack

Feature description

Add first-party helpers for function/tool calling so apps can define tools, render model-family-specific prompts/templates, parse tool calls, and dispatch results safely.

Motivation

Tool calling is now a core local-agent capability. llamadart can provide a cleaner developer experience by standardizing common pieces instead of leaving every app to hand-roll templates and parsers.

Proposed scope

  • Define a small Dart representation for tools/functions, parameters, and tool-call results.
  • Render model-family-specific tool-use templates where feasible.
  • Parse tool-call output robustly, including whitespace and streaming edge cases.
  • Provide validation and safe error reporting for malformed calls.
  • Include an example that integrates with mcp_dart tools as a local-agent story.

Acceptance criteria

  • Docs include at least one complete local tool-calling example.
  • Tests cover parser behavior across well-formed and malformed outputs.
  • The API does not require a specific UI framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions