function bedrockMiddleware(shim, config, next, context) {
  const { commandName } = context
  if (
    commandName === 'InvokeModelCommand' ||
    commandName === 'InvokeModelWithResponseStreamCommand'
  ) {
    return shim.record(next, getBedrockSpec.bind(null, { commandName }))
  }

  shim.logger.debug(`Not instrumenting command ${commandName}`)
  return next
}
Middleware function that either instruments when InvokeModelCommand or
InvokeModelWithResponseStreamCommand or returns existing middleware chain

@param {Shim} shim instance of shim
@param {object} config AWS configuration object
@param {function} next the next middleware function in stack
@param {object} context AWS client context info