constructor({ response, bedrockCommand, isError = false }) {
    this.#innerResponse = isError ? response.$response : response.response
    this.#command = bedrockCommand
    this.isError = isError

    if (this.isError) {
      return
    }

    this.#innerOutput = response.output

    const json = new TextDecoder().decode(this.#innerOutput.body)
    this.#parsedBody = JSON.parse(json)

    const cmd = this.#command
    const body = this.#parsedBody
    if (cmd.isAi21() === true) {
      this.#completions = body.completions?.map((c) => c.data.text) ?? []
      this.#id = body.id
    } else if (cmd.isClaude() === true) {
      // TODO: can we make this thing give more than one completion?
      body.completion && this.#completions.push(body.completion)
    } else if (cmd.isClaude3() === true) {
      if (body?.type === 'message_stop') {
        // Streamed response
        this.#completions = body.completions
      } else {
        this.#completions = [stringifyClaudeChunkedMessage(body?.content)]
      }
      this.#id = body.id
    } else if (cmd.isCohere() === true) {
      this.#completions = body.generations?.map((g) => g.text) ?? []
      this.#id = body.id
    } else if (cmd.isLlama() === true) {
      body.generation && this.#completions.push(body.generation)
    } else if (cmd.isTitan() === true) {
      this.#completions = body.results?.map((r) => r.outputText) ?? []
    }
  }
@param {object} params
@param {AwsBedrockMiddlewareResponse} params.response
@param {BedrockCommand} params.bedrockCommand
@param params.isError