tool_schema_generator 0.4.0
tool_schema_generator: ^0.4.0 copied to clipboard
Generate provider-compatible LLM tool schemas and dispatchers from annotated Dart functions.
Example usage of tool_schema_generator #
This example demonstrates how to use the tool_schema_generator package to automatically generate provider-compatible LLM tool schemas for your Dart functions.
Setup #
- Add
tool_schema_generatorto yourdependencies. - Add
build_runnerto yourdev_dependencies.
dependencies:
tool_schema_generator: ^0.4.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
Check out lib/tools.dart in this example to see how the annotations are used!