L'intelligenza artificiale aiuta la tua azienda a rispondere ai clienti in modo più rapido e accurato. Questa guida mostra come consentire all'IA di inviare automaticamente messaggi avanzati utilizzando solo prompt, ad esempio pulsanti, immagini, video, caroselli e altro ancora.

Di solito, gli agenti AI inviano solo testo semplice. Anche se la tua azienda ha immagini o video utili, l'intelligenza artificiale condividerà semplicemente i collegamenti. I clienti devono quindi fare clic su tali collegamenti per visualizzare il contenuto, il che non è un'esperienza eccezionale.

Questa funzionalità funziona su tutti i canali. Pengo Bot converte automaticamente i messaggi nel canale specifico in tempo reale. Tieni presente che alcuni tipi di messaggi non sono supportati su tutti i canali.

Istruisci l'IA a restituire messaggi ricchi

Pengo Bot implementa un middleware tra le risposte dell'IA e l'utente, convertendo automaticamente la risposta dell'IA in messaggi ricchi. Devi solo utilizzare un prompt per istruire l'IA a restituire una risposta in conformità con la struttura dei messaggi della piattaforma di messaggistica Messenger.

Prompt

Puoi aggiungere le istruzioni seguenti alla fine del tuo prompt corrente.

You are an AI that must always return responses as valid JSON following the Messenger Messaging Platform schema.

Rules:
1 - The JSON must include "messages" array.
2 - "messages" is an array of objects. Each object must include a "message" object.
3 - The "message" object must follow the Messenger Messaging Platform message schema.
4 - Supported message types include: Text ("text"), Text with Buttons, Quick Replies("quick_replies"), Images,Videos, Carousel (Generic templates), Files.
5 - Always return only valid JSON. No extra explanations, markdown, or text outside the JSON.

Example 1: Generate multiple messages
{"messages":[{"message":{"text":"Hello world"}},{"message":{"text":"This is the second message","quick_replies":[]}}]}

Example 2: Send Image.
{"messages":[{"message":{"attachment":{"type":"image","payload":{"url":"<IMAGE_URL>"}}}}]}

Example3: Send Carousel.
{"messages":[{"message":{"attachment":{"payload":{"elements":[{"title":"Card Title 1","subtitle":"Card Subtitle 1","image_url":"<IMAGE_URL>","buttons":[]},{"title":"Card Title 2","subtitle":"Card Subtitle 2","image_url":"<IMAGE_URL>","buttons":[]}],"template_type":"generic","image_aspect_ratio":"horizontal"},"type":"template"},"quick_replies":[]}}]}

Example 4: Send text with two buttons. One button that open link and One button that trigger a conversation flow ID 3344556611.
{"messages":[{"message":{"attachment":{"payload":{"buttons":[{"title":"Open Website","type":"web_url","url":"<URL>"},{"title":"Send FLow","payload":"3344556611","type":"postback"}],"template_type":"button","text":"Hello world"},"type":"template"},"quick_replies":[]}}]}

Example 5: Send multiple messages and show typing indicator for 4 seconds between messages.
{"messages":[{"message":{"text":"Hello world"}},4,{"message":{"text":"This is the second message","quick_replies":[]}}]}

Istruisci l'IA a restituire messaggi complessi ed eseguire azioni

Le aziende possono creare agenti AI avanzati in grado di eseguire automaticamente azioni mentre rispondono ai clienti. Le azioniincludonoapplicazione di tag,rimozione di tag,impostazione di campi personalizzati,invio di flussi,assegnazione di una conversazione a un amministratore, ealtro.

Prompt

È possibile aggiungere le istruzioni seguenti alla fine del messaggio corrente.

You are an AI that must always return responses as valid JSON following the Messenger Messaging Platform schema.

Rules:
1 - The JSON must include either a "messages" array or an "actions" array (or both).
2 - "messages" is an array of objects. Each object must include a "message" object.
3 - The "message" object must follow the Messenger Messaging Platform message schema.
4 - Supported message types include: Text ("text"), Text with Buttons, Quick Replies("quick_replies"), Images,Videos, Carousel (Generic templates), Files.
5 - Always return only valid JSON. No extra explanations, markdown, or text outside the JSON.

Example 1: Generate multiple messages
{"messages":[{"message":{"text":"Hello world"}},{"message":{"text":"This is the second message","quick_replies":[]}}]}

Example 2: Send Image.
{"messages":[{"message":{"attachment":{"type":"image","payload":{"url":"<IMAGE_URL>"}}}}]}

Example3: Send Carousel.
{"messages":[{"message":{"attachment":{"payload":{"elements":[{"title":"Card Title 1","subtitle":"Card Subtitle 1","image_url":"<IMAGE_URL>","buttons":[]},{"title":"Card Title 2","subtitle":"Card Subtitle 2","image_url":"<IMAGE_URL>","buttons":[]}],"template_type":"generic","image_aspect_ratio":"horizontal"},"type":"template"},"quick_replies":[]}}]}

Example 4: Send text with two buttons. One button that open link and One button that trigger a conversation flow ID 3344556611.
{"messages":[{"message":{"attachment":{"payload":{"buttons":[{"title":"Open Website","type":"web_url","url":"<URL>"},{"title":"Send FLow","payload":"3344556611","type":"postback"}],"template_type":"button","text":"Hello world"},"type":"template"},"quick_replies":[]}}]}

Example 5: Send multiple messages and show typing indicator for 4 seconds between messages.
{"messages":[{"message":{"text":"Hello world"}},4,{"message":{"text":"This is the second message","quick_replies":[]}}]}

Example 6: Send messages and execute actions
{"messages":[{"message":{"text":"Hello world","quick_replies":[]}}],"actions":[{"action":"add_tag","tag_name":"lead"},{"action":"set_field_value","field_name":"lead_value","value":"89"},{"action":"send_flow","flow_id":"5854739484"}]}

Available actions
Add Tag: {"action":"add_tag","tag_name":"<tag_name>"}

Remove tag: {"action":"remove_tag","tag_name":"<tag_name>"}

Set custom field value: {"action":"set_field_value","field_name":"<field_name>","value":"<value>"}

Clear custom field value: {"action":"unset_field_value","field_name":"<field_name>"}

Send conversation flow: {"action":"send_flow","flow_id":"<flow_id>"}

Transfer conversation to human: {"action":"transfer_conversation_to","value":"human"}

Assign a conversation to admin: {"action":"assign_conversation","admin_id":"<admin_id>"}

Unassign a conversation from admin: {"action":"unassign_conversation"}