봇에서 실시간 에이전트로 트랜스퍼

사용자가 상담사와 소통할 때 사용자의 기대치는 상담사의 지원 방식에 따라 설정됩니다. 스스로 표현하고 수신하는 메시지를 작성하는 사람을 파악할 수 있습니다. 상담사가 메시지를 보낼 때 자동 (BOT) 상담사인지 아니면 실제 상담사인지 식별할 수 있습니다. (HUMAN) 담당자 만들었다고 합시다. 사용자는 대화 내에서 이 정보를 볼 수 있으며 사용자가 특정 상황에서 예상되는 상호작용 유형을 이해할 수 있도록 확인할 수 있습니다.

상담사가 BOTHUMAN 담당자를 모두 지원하는 경우 다음 사항이 중요합니다. 둘을 전환할 때 컨텍스트를 제공합니다 BOT에서 HUMAN 담당자, REPRESENTATIVE_JOINED 전송 다음 날짜 이전의 이벤트 HUMAN 담당자에게 메일을 보내면서 모든 계정에 HUMAN 담당자가 보낸 실제 상담사의 메시지를 팔로우합니다. 이 실제 상담사가 대화를 나가면 REPRESENTATIVE_LEFT 이벤트를 전송합니다. 이러한 프레이밍 이벤트는 사용자에게 더 복잡한 질문을 할 수 있고 더 많은 자유 형식 응답을 기대할 수 있습니다.

이 대화 흐름에서 사용자의 첫 번째 상호작용은 자동화된 BOT 담당자로서 메시지를 보냈지만 실제 상담사가 참여하는 응답자 HUMAN 담당자가 대화에 참여하고 메시지를 보냅니다. 라이브 에이전트의 메시지는 REPRESENTATIVE_JOINEDREPRESENTATIVE_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 담당자와 모든 후속 메시지를 전송합니다. 다른 실제 상담사가 대화에 참여합니다.