normalizeForAPI method

  1. @override
List<UserMessage> normalizeForAPI()
override

Normalize this attachment into user messages for the API.

Implementation

@override
List<UserMessage> normalizeForAPI() {
  final buf = StringBuffer();
  buf.writeln('<system-reminder>');
  buf.writeln('Current todo list ($itemCount items):');
  for (final item in content) {
    final status = item['status'] ?? 'pending';
    final text = item['content'] ?? '';
    buf.writeln('- [$status] $text');
  }
  buf.writeln('</system-reminder>');
  return [createUserMessage(content: buf.toString(), isMeta: true)];
}