OpenAI result with double ** on WhatsApp

Describe the problem/error/question

Hi people, I need your help I’ve a node for OpenAI to send a message on WhatsApp, my problem is, OpenAI result display a extra * on WhatsApp Message, how can I delete double * and only mark a text normaly with a * start and * end the text

What is the error message (if any)?

Te ofrezco las siguientes opciones para agendar tu evaluación:\n\n- 22 de marzo a las 8:00 AM\n- 22 de marzo a las 9:15 AM\n- 22 de marzo a las 10:30 AM\n- 22 de marzo a las 12:00 PM\n- 22 de marzo a la 1:15 PM\n- 22 de marzo a las 2:30 PM\n- 22 de marzo a las 3:45 PM\n- 22 de marzo a las 5:00 PM\n\nPor favor, indícame si alguna de estas opciones se ajusta a tu agenda. ¡Estoy aquí para ayudarte! :sparkles:

Please share your workflow

{
“nodes”: [
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-4o-mini”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
2380,
1000
],
“id”: “2385ceef-0afe-48a3-a620-21f7539b6de3”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “gDh5JpOBjTgvv8Fg”,
“name”: “OpenAi account”
}
}
}
],
“connections”: {
“OpenAI Chat Model”: {
“ai_languageModel”: [

]
}
},
“pinData”: {},
“meta”: {
“templateId”: “2466”,
“templateCredsSetupCompleted”: true,
“instanceId”: “3ac55492cba2f4780ef3b37649d6e64b6a0b80b0b8dfefc084ef07871162a3ab”
}
}

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

expected output
22 de marzo a las 9:15 AM*\n- 22 de marzo a las 10:30 AM*\n- 22 de marzo a las 12:00 PM*\n- 22 de marzo a la 1:15 PM*\n- 22 de marzo a las 2:30 PM*\n- 22 de marzo a las 3:45 PM\n- 22 de marzo a las 5:00 PM\

Two options:

  1. Instruct AI to use only single * for bold.
  2. Use function {{ $json["text"].replace(/\*\*/g, '*') }} to replace all double ** from the message string

:point_right: If my reply answers your question please remember to mark it as the solution

1 Like

Thanks a lot, option 2 was my solution

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.