function recordEmbeddingMessage({
  agent,
  shim,
  segment,
  transaction,
  bedrockCommand,
  bedrockResponse,
  err
}) {
  if (shouldSkipInstrumentation(agent.config) === true) {
    shim.logger.debug('skipping sending of ai data')
    return
  }

  const embeddings = bedrockCommand.prompt.map(prompt => new LlmEmbedding({
    agent,
    segment,
    transaction,
    bedrockCommand,
    input: prompt.content,
    bedrockResponse,
    isError: err !== null
  }))

  embeddings.forEach(embedding => {
    recordEvent({ agent, type: 'LlmEmbedding', msg: embedding })
  })

  if (err) {
    const llmError = new LlmError({ bedrockResponse, err, embedding: embeddings.length === 1 ? embeddings[0] : undefined })
    agent.errors.add(transaction, err, llmError)
  }
}
Creates and enqueues the LlmEmbedding event and adds an error to transaction
if it exists.

@param {object} params function params
@param {object} params.agent instance of agent
@param {object} params.shim current shim instance
@param {object} params.segment active segment
@param {BedrockCommand} params.bedrockCommand parsed input
@param {Error|null} params.err error from request if exists
@param {BedrockResponse} params.bedrockResponse parsed response
@param {Transaction} params.transaction active transaction