बॉट से लाइव एजेंट के लिए हैंडऑफ़

जब उपयोगकर्ता एजेंट से बातचीत करते हैं, तो उनकी उम्मीदें इस बात पर आधारित होती हैं कि एजेंट खुद को कैसे प्रज़ेंट करे और उन्हें मिलने वाले मैसेज को कौन लिखता है. जब भी कोई एजेंट मैसेज भेजता है, तो यह पहचान कर सकता है कि ऑटोमेटेड (BOT) या लाइव एजेंट (HUMAN) प्रतिनिधि है. उपयोगकर्ताओं को यह जानकारी बातचीत में दिखती है. इससे उपयोगकर्ताओं को यह समझने में मदद मिलती है कि किसी भी समय वे किस तरह के इंटरैक्शन कर सकते हैं.

अगर कोई एजेंट BOT और HUMAN, दोनों प्रतिनिधियों के साथ काम करता है, तो दोनों के बीच स्विच करते समय संदर्भ देना ज़रूरी होता है. BOT से HUMAN प्रतिनिधि पर स्विच करते समय, HUMAN प्रतिनिधि के मैसेज भेजने से पहले, REPRESENTATIVE_JOINEDइवेंट भेजें. साथ ही, लाइव एजेंट के फ़ॉलो किए जा रहे सभी मैसेज को, HUMAN प्रतिनिधि से मैसेज के तौर पर लेबल करें. जब लाइव एजेंट बातचीत छोड़ देता है, तब REPRESENTATIVE_LEFT इवेंट भेजें. ये फ़्रेमिंग इवेंट, उपयोगकर्ताओं को जानकारी देते हैं कि वे ज़्यादा मुश्किल सवाल पूछ सकते हैं. साथ ही, वे फ़्रीफ़ॉर्म रिस्पॉन्स भी पा सकते हैं.

इस बातचीत के फ़्लो में, उपयोगकर्ता का पहला इंटरैक्शन ऑटोमेटेड रिस्पॉन्सर से होता है जो BOT प्रतिनिधि के तौर पर मैसेज भेजता है. हालांकि, लाइव एजेंट बातचीत में शामिल होता है और HUMAN प्रतिनिधि के तौर पर मैसेज भेजता है. लाइव एजेंट के मैसेज को REPRESENTATIVE_JOINED और REPRESENTATIVE_LEFT इवेंट ने फ़्रेम किया है.

  1. उपयोगकर्ता, एजेंट से बातचीत शुरू कर देता है.
  2. जब उपयोगकर्ता जवाब टाइप करना शुरू करता है, तो वह एजेंट को टाइपिंग इवेंट भेजता है.

    {
      "agent": "brands/1111/agents/2222",
      "conversationId": "3333",
      "customAgentId": "live-agent-handoff",
      "requestId": "1234567890",
      "userStatus": {
        "isTyping": "true",
        "createTime": "2020-10-02T15:01:23.045123456Z",
      },
      "sendTime": "2020-10-02T15:01:24.045123456Z",
    }
    
  3. उपयोगकर्ता मैसेज भेजता है और कोट करता है. नमस्ते, मुझे समस्या आ रही है &कोटेशन.

    {
      "agent": "brands/1111/agents/2222",
      "conversationId": "3333",
      "customAgentId": "live-agent-handoff",
      "requestId": "123123123",
      "message": {
        "messageId": "4444",
        "name": "conversations/12345/messages/67890",
        "text": "Hi, I have a problem",
        "createTime": "2020-10-02T15:05:23.045123456Z",
      },
      "context": {
        "entryPoint": "PLACESHEET",
        "userInfo": {
          "displayName": "Michael",
          "userDeviceLocale": "en",
        },
        "resolvedLocale": "en",
      }
      "sendTime": "2020-10-02T15:05:24.045123456Z",
    }
    
  4. एजेंट हमसे संपर्क करने के लिए धन्यवाद (कोटेशन) देता है. BOT.

    curl -X POST "https://businessmessages.googleapis.com/v1/conversations/3333/messages" \
    -H "Content-Type: application/json" \
    -H "`oauth2l header --json path/to/service/account/key.json businessmessages`" \
    -d "{
      'messageId': '5555',
      'text': 'Thanks for contacting us. I'll pass this along when a live agent is available to chat with you.',
      'representative': {
        'avatarImage': 'https://live.agent/bot-avatar.jpg',
        'displayName': 'Hello World Agent',
        'representativeType': 'BOT'
      }
    }"
    
  5. लाइव एजेंट उपलब्ध हो जाता है.

  6. एजेंट, लाइव एजेंट से पहला मैसेज भेजने से पहले REPRESENTATIVE_JOINED इवेंट भेजता है.

    curl -X POST "https://businessmessages.googleapis.com/v1/conversations/12345/events?eventId=6666" \
    -H "Content-Type: application/json" \
    -H "`oauth2l header --json /path/to/service/account/key.json businessmessages`" \
    -d "{
      'eventType': 'REPRESENTATIVE_JOINED',
      'representative': {
        'avatarImage': 'https://live.agent/human-avatar.jpg',
        'displayName': 'Jane Doe',
        'representativeType': 'HUMAN',
      },
    }"
    
  7. एजेंट भेजता है &कोट करें;मैं देख रहा/रही हूं कि आपको कोई समस्या है. मैं HUMANकोटेशन के बारे में मैसेज के ज़रिए मदद कैसे करूं?

    curl -X POST "https://businessmessages.googleapis.com/v1/conversations/3333/messages" \
    -H "Content-Type: application/json" \
    -H "`oauth2l header --json path/to/service/account/key.json businessmessages`" \
    -d "{
      'messageId': '7777',
      'text': 'I see you have a problem. How can I help?',
      'representative': {
        'avatarImage': 'https://live.agent/human-avatar.jpg',
        'displayName': 'Jane Doe',
        'representativeType': 'HUMAN'
      }
    }"
    
  8. लाइव एजेंट और उपयोगकर्ता तब तक मैसेज की अदला-बदली करते हैं, जब तक उपयोगकर्ता का अनुरोध पूरा नहीं हो जाता. लाइव एजेंट के बनाए गए सभी मैसेज, HUMAN के प्रतिनिधि से भेजे जाते हैं.

  9. जब एजेंट लाइव बातचीत को छोड़ता है, तो एजेंट REPRESENTATIVE_LEFT को इवेंट भेजता है.

    curl -X POST "https://businessmessages.googleapis.com/v1/conversations/12345/events?eventId=6666" \
    -H "Content-Type: application/json" \
    -H "`oauth2l header --json /path/to/service/account/key.json businessmessages`" \
    -d "{
      'eventType': 'REPRESENTATIVE_LEFT',
      'representative': {
        'avatarImage': 'https://live.agent/human-avatar.jpg',
        'displayName': 'Jane Doe',
        'representativeType': 'HUMAN',
      },
    }"
    
  10. एजेंट, BOT प्रतिनिधि के बाद वाले सभी मैसेज तब तक भेजता है, जब तक कोई दूसरा लाइव एजेंट बातचीत में शामिल नहीं हो जाता.