transformToChatPrompt method

String transformToChatPrompt({
  1. int contextLength = 4,
})

Implementation

String transformToChatPrompt({
  int contextLength = 4,
}) =>
    skip(length <= contextLength ? 0 : length - contextLength)
        .map((e) => '$startTurn${e.isUser ? userPrefix : modelPrefix}\n${e.text}$endTurn')
        .join('\n');