allMessagesContent property

  1. @Deprecated("Use userMessageContents instead")
List<String> get allMessagesContent

Returns a list of all messages content in the conversation It is a list of strings and switches from request to response Example:

final conversation = chat.allMessagesContent;
print(conversation.first); //prints the first message in the conversation
print(conversation[1]); //prints the first response in the conversation

Implementation

@Deprecated("Use userMessageContents instead")

///Returns a list of all messages content in the conversation
///It is a list of strings and switches from request to response
///Example:
///```dart
///final conversation = chat.allMessagesContent;
///print(conversation.first); //prints the first message in the conversation
///print(conversation[1]); //prints the first response in the conversation
///```
List<String> get allMessagesContent {
  List<String> messages = [];
  for (final item in _conversationItems) {
    messages.add(item.request.content);
    if (item.response != null) {
      messages.add(item.response!.choices.first.message);
    }
  }
  return messages;
}