Error 400 API call with model gpt4-1106-preview

Hi,

I’m doing a call with the OpenAI model to transform a markdown text to a JSON.
I’m getting this error:

400 '$.messages[3].content' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.

Error: 400 '$.messages[3].content' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.
    at Function.generate (/Users/jeremy/Topo/Capsule/node_modules/.pnpm/openai@4.24.7/node_modules/openai/src/error.ts:67:14)
    at OpenAI.makeStatusError (/Users/jeremy/Topo/Capsule/node_modules/.pnpm/openai@4.24.7/node_modules/openai/src/core.ts:371:21)
    at OpenAI.makeRequest (/Users/jeremy/Topo/Capsule/node_modules/.pnpm/openai@4.24.7/node_modules/openai/src/core.ts:429:24)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /Users/jeremy/Topo/Capsule/node_modules/.pnpm/@langchain+openai@0.0.12/node_modules/@langchain/openai/dist/chat_models.cjs:650:29
    at RetryOperation._fn (/Users/jeremy/Topo/Capsule/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js:50:12)

The messages[3].content is :

tool_calls:
  - id: call_zCnGNJdDgw1lYn95CS6Oe7DH
    type: function
    function:
      name: markdown_results_to_json
      arguments: "{\"input\":\"# Welcome \\n\\nHello, XXX,\\n\\nWe are thrilled to extend this customized experience to you. Please feel free to explore at your convenience and reach out should any questions arise.\\n\\nBest regards,\\nThe XXX Team\"}"

Do you have any idea how to fix that please?

Cheers