turbo_promptable 0.3.0 copy "turbo_promptable: ^0.3.0" to clipboard
turbo_promptable: ^0.3.0 copied to clipboard

Object-Oriented Prompting framework for defining AI agent prompts, roles, workflows, and tools as type-safe Dart objects.

example/turbo_promptable_example.dart

// ignore_for_file: avoid_print

import 'package:turbo_promptable/turbo_promptable.dart';

void main() {
  const instruction = Instruction(
    name: 'Code Quality',
    rules: ['No unused imports', 'All public API must have dartdoc'],
    principles: ['Clarity over cleverness'],
  );

  const workflow = Workflow(
    name: 'Review Workflow',
    steps: [
      Step(
        name: 'Analyse',
        input: Input(
          name: 'Source Code',
          request: 'Analyse the provided source code for quality issues.',
        ),
        instructions: [instruction],
        output: Output(name: 'Analysis Report'),
      ),
    ],
  );

  const role = Role(
    name: 'Code Reviewer',
    expertise: 'Static analysis and code quality',
    instructions: [instruction],
    workflows: [workflow],
  );

  final agent = Agent.fromRole(
    role,
    identity: 'A meticulous reviewer focused on maintainability.',
  );

  print('Agent JSON:\n${agent.toJson()}');
}
2
likes
0
points
347
downloads

Publisher

unverified uploader

Weekly Downloads

Object-Oriented Prompting framework for defining AI agent prompts, roles, workflows, and tools as type-safe Dart objects.

Homepage
Repository (GitHub)
View/report issues

Topics

#prompts #agents #serialization

License

unknown (license)

Dependencies

json_annotation, meta, turbo_response, turbo_serializable

More

Packages that depend on turbo_promptable