opentool_dart

English · 中文

An OpenTool JSON Spec Parser for dart with ToolDrivers.

Inspired by OpenAPI, OpenRPC, and OpenAI function calling example.

Features

Usage

According to /example/opentool_dart_example.dart.

  • From JSON String
Future<void> main() async {
  String jsonString = "{...OpenTool String...}";
  OpenToolLoader openToolLoader = OpenToolLoader();
  OpenTool openTool = await openToolLoader.load(jsonString);
}
  • From JSON File
Future<void> main() async {
  String jsonPath = "$currentWorkingDirectory/example/json/$jsonFileName";
  OpenToolLoader openToolLoader = OpenToolLoader();
  OpenTool openTool = await openToolLoader.loadFromFile(jsonPath); 
}

Note

Serial Port

  • The lib libserialport need environmentVariable LIBSERIALPORT_PATH to be set to the path of the libs/serial_port/windows/libserialport.dll(Windows) or libs/serial_port/macos/libserialport.dylib(macOS)

Libraries

opentool_dart