AIMessage constructor

AIMessage({
  1. required AIRole role,
  2. required String content,
  3. List<AIAttachment>? attachments,
  4. Map<String, dynamic>? metadata,
  5. List<AIToolCall>? toolCalls,
  6. String? toolCallId,
  7. DateTime? timestamp,
  8. String? id,
})

Implementation

AIMessage({
  required this.role,
  required this.content,
  this.attachments,
  this.metadata,
  this.toolCalls,
  this.toolCallId,
  DateTime? timestamp,
  String? id,
})  : timestamp = timestamp ?? DateTime.now(),
      id = id ?? _generateId();