llm_tool_calling 0.6.2
llm_tool_calling: ^0.6.2 copied to clipboard
Turn Dart functions into LLM tools for OpenAI, Gemini and Claude. Annotate with @Tool to generate the JSON schema, argument validation and type-safe dispatch.
0.6.2 #
- README: every "Use with your SDK" example now imports
package:llm_tool_calling/llm_tool_calling.dart.toOpenAiJson(),invoke()and the other list methods are extension methods, so a file that only imports yourtools.dartcan't see them. Added a troubleshooting entry for the resulting error. No code changes.
0.6.1 #
- Added the package homepage (https://amitgp.dev).
0.6.0 #
- Built-in support for every major SDK, with no extra packages:
toOpenAiJson(),toOpenAiResponsesJson(),toAnthropicJson(),toGeminiJson()andtoMcpJson()on a tool or a list of tools (e.g.allTools). Each format is tested against the real SDK (openai_dart,anthropic_sdk_dart,mcp_dart). tool.invoke(args, confirm: ...)andallTools.invoke(name, arguments)run a model's call and never throw: validation, confirmation forrequiresConfirmationtools, the run, and a JSON-safeToolResult(toText(),toJson(),isError). Arguments can be a map or a JSON string.ToolConfirmation, the callback that asks the user.- README: "Use with your SDK" with OpenAI, Claude, MCP and Firebase examples (compiled and run in the tests).
0.5.0 #
@Param(name: ...)sets the name the LLM sees and sends, e.g.@Param('A game id', name: 'game_id') int gameId.
0.4.0 #
withoutAdditionalProperties(schema): a copy of a schema for SDKs that send it to Gemini's olderparametersfield, which rejectsadditionalProperties.- Tool names are documented as up to 63 characters (the firebase_ai limit).
- README: "Use with your SDK" section, with the new
llm_tool_calling_firebase_aiadapter.
0.3.0 #
- No code changes. Released together with
llm_tool_calling_generator0.3.0, which generates a list of all tools in each file. - README: the list of all tools, and an author section.
0.2.0 #
validateArguments()checks nested objects (fields withproperties), reporting paths likebooking.passengers[0].age is required.validateArguments()checks every item of anarrayagainstitems, reporting paths liketags[2]andgrid[1][0].validateArguments()checksenumlists and reports the allowed values, e.g.unit must be one of "celsius", "fahrenheit", got "kelvin".
0.1.0 #
- Initial release.
@Tooland@Paramannotations.ToolDefinitionwith name, description, JSON schema,requiresConfirmationandcall(), which validates arguments before running the tool.validateArguments(): checks required, unknown and wrongly typed arguments and reports every problem at once. Whole numbers sent as5.0are accepted forinteger.ToolArgumentExceptionwith a message an LLM can use to fix its call.