flutter_agentic_tools 0.1.1
flutter_agentic_tools: ^0.1.1 copied to clipboard
Ready-made device tools for Flutter AI agents — clipboard, sandboxed files, HTTP, and system info tools that plug straight into flutter_agentic.
// Example: an agent equipped with device tools.
// ignore_for_file: avoid_print
import 'package:flutter_agentic/flutter_agentic.dart';
import 'package:flutter_agentic_tools/flutter_agentic_tools.dart';
Future<void> main() async {
// In a real app, use path_provider:
// final docsDir = await getApplicationDocumentsDirectory();
const sandboxPath = '/tmp/agent_files';
final agent = GenesisAgent(
provider: GeminiProvider(apiKey: 'YOUR_GEMINI_API_KEY'),
systemPrompt: 'You are a helpful assistant with device access.',
tools: [
...ClipboardTools.all,
...FileTools(sandboxPath).all,
...HttpTools(allowedHosts: ['api.github.com']).all,
...SystemTools.all,
],
);
final response = await agent.chat(
'Fetch my GitHub profile from api.github.com/users/octocat, '
'save a summary to profile.txt, and copy the name to my clipboard.',
onStep: (step) => print(step),
);
print(response);
}