llm_tool_generator 0.8.0
llm_tool_generator: ^0.8.0 copied to clipboard
Code generator for llm_tool. Turns @LlmTool-annotated Dart functions into LLM tools for OpenAI, Gemini, Claude and MCP, with JSON schemas and validation.
0.8.0 #
- Generates toolsets: for each
@LlmToolset()class, an extension with anllmToolsgetter listing its@LlmToolmethods (instance and static) as tools bound to that instance, typed by their common return type. @LlmToolon a method of a class without@LlmToolsetis still a build error, now suggesting@LlmToolset.- Writes
@Paramlimits into the schema (min→minimum,minLength,pattern,minItems, ...). On a list, value limits apply to its items. A limit that doesn't fit the type,minabovemax, a negative length or an invalid pattern is a build error. - Requires
llm_tool0.8.0.
0.7.0 #
- Renamed from
llm_tool_calling_generator(now discontinued), to go with the core package's new name,llm_tool. The builder is nowllm_tool_generator:llm_tool, and generated parts are.llm_tool.g.part. - Recognizes
@LlmTool(), and still the deprecated@Tool(). - Generated tools are typed by their function's return type (e.g.
ToolDefinition<String>), and the list of all tools by their common return type (e.g.List<ToolDefinition<Command>>), so calling a tool needs no cast. - Requires
llm_tool_calling0.7.0.
0.6.1 #
- Added the package homepage (https://amitgp.dev).
0.6.0 #
- No changes in the generated code. Requires
llm_tool_calling0.6.0, which adds built-in SDK formats andinvoke.
0.5.0 #
- Supports
@Param(name: ...): the schema,requiredand validation use the JSON name, while your function is still called with its Dart parameter names. Invalid or duplicate JSON names are build-time errors.
0.4.0 #
- The generated code uses your import prefix for
ToolDefinition, soimport 'package:llm_tool_calling/llm_tool_calling.dart' as ltc;works, and so does another package'sToolDefinitionin the same file (e.g.flutter_ai_core). - Tool names are limited to 63 characters, the firebase_ai limit.
0.3.0 #
- Generates a list of all tools in each file, named after the file:
allToolsfortools.dart,weatherToolsforweather_tools.dart. If you already declared a variable with that name in the file, rename it. - README: author section.
0.2.0 #
- Class parameters become nested object schemas, built through the class's
unnamed constructor. Descriptions from
@Paramor field doc comments; defaults, nested classes, lists of classes, freezed classes and prefixed imports are supported. - Generated code no longer causes analyzer warnings in your project.
- Tool names must start with a letter or
_, and parameter names may only use letters, digits and_, so every schema works with Gemini as well as OpenAI and Claude. Other names are a build-time error. List<T>parameters for every supportedT, including enums and nested lists.List<int>andList<double>accept any JSON number.- Enum parameters, sent to the LLM as their value names. Works with
nullable enums, defaults, enhanced enums and prefixed imports
(
import 'units.dart' as u;).
0.1.0 #
- Initial release.
- Generates a
<functionName>ToolToolDefinitionfor every@Tooltop-level function. - Parameter types:
String,int,double,num,bool, nullable or not, positional or named, with or without defaults. - Description from
@Tool(description:)or the doc comment (///or/** */). - Sync, async and
voidfunctions. - Build-time errors for unsupported types, missing descriptions, invalid tool
names, generic functions and
@Toolon methods.