function finiteStream(dataToStream, chunkTemplate) {
  const parts = dataToStream.split(' ')
  let i = 0
  return new Readable({
    read() {
      // This is how the data is streamed from openai
      // The message response only seems to change and mostly
      // a stream of content changes via the delta key
      if (i < parts.length) {
        const content = parts.length - 1 === i ? parts[i] : `${parts[i]} `
        chunkTemplate.choices[0].delta.content = content
        const chunk = JSON.stringify(chunkTemplate)
        this.push(`data: ${chunk}\n\n`)
        i += 1
      } else {
        this.push('data: [DONE]\n\n')
        this.push(null)
      }
    }
  }).pause()
}
Splits the provided `dataToStream` into chunks and returns a stream that
sends those chunks as OpenAI data stream messages. This stream has a finite
number of messages that will be sent.

@param {string} dataToStream A fairly long string to split on space chars.
@param {object} chunkTemplate An object that is shaped like an OpenAI stream
data object.
@returns {Readable} A paused stream.