generateCompletion = async ({
  prompt,
}) => {
  if (config.APP_ENV !== 'production') return new Completion({ text: MOCK_TEXT_OK });
  const { data } = await createChatCompletion({ messages: prompt.messages });
  const [choice] = data.choices;
  return new Completion({
    text: choice.message.content.trim(),
    finishReason: choice.finish_reason,
  });
}
@param {Object} param
@param {Prompt} param.prompt
@returns {Promise<Completion>}