tool_schema_generator 0.1.0
tool_schema_generator: ^0.1.0 copied to clipboard
Annotations for automatic LLM tool schema generation. Mark functions with @Tool() and parameters with @Describe() to generate JSON Schema Draft 2020-12 compatible tool definitions.
example/README.md
Example usage of tool_schema_generator #
This example demonstrates how to use the tool_schema_generator package to automatically generate JSON Schema definitions for your Dart functions.
Setup #
- Add
tool_schema_generatorto yourdependencies. - Add
build_runnerto yourdev_dependencies.
dependencies:
tool_schema_generator: ^0.1.0
dev_dependencies:
build_runner: ^2.4.0
Running the generator #
After adding your @Tool() annotations, run the build runner to generate the .g.dart file:
dart run build_runner build -d
Check out lib/tools.dart in this example to see how the annotations are used!