Panduan pengguna: Bantuan supervisor untuk agen manusia

Dengan bantuan supervisor untuk agen manusia, supervisor manusia dapat memantau percakapan antara pengguna akhir dan agen manusia. Anda menentukan aturan kapan percakapan harus diteruskan ke supervisor manusia. Kemudian, bantuan supervisor akan otomatis memberi tahu supervisor manusia saat percakapan cocok dengan salah satu aturan Anda.

Untuk setiap giliran pengguna akhir dalam percakapan, Anda akan melihat skor sentimen dan transkrip. Aturan Anda dapat menggunakan skor sentimen ini atau pelatih AI untuk menentukan kapan pengawas manusia menerima notifikasi.

Sebelum memulai

Untuk menggunakan bantuan supervisor, Anda memerlukan profil percakapan Agent Assist dan peran Identity and Access Management (IAM) berikut.

  • dialogflow.virtualAgentMonitoringSupervisor
  • dialogflow.processor

Langkah 1: Konfigurasi profil percakapan

Profil percakapan mengonfigurasi serangkaian parameter yang mengontrol saran yang diberikan kepada agen selama percakapan. Langkah-langkah berikut akan membuat ConversationProfile dengan objek HumanAgentAssistantConfig. Anda juga dapat melakukan tindakan ini menggunakan konsol Agent Assist jika Anda tidak ingin memanggil API secara langsung.

Membuat profil percakapan

Untuk membuat profil percakapan, panggil metode create pada resource ConversationProfile. Berikan ID project, ID dokumen, ID project, dan ID model Anda. Respons ini berisi ID profil percakapan baru Anda.

Berikut adalah contoh JSON:

{
  "displayName": "smart_compose_assist",
  "humanAgentAssistantConfig": {
    "humanAgentSuggestionConfig": {
      "featureConfigs": [
        {
          "suggestionFeature": {
            "type": "SMART_COMPOSE"
          },
          "queryConfig": {
            "documentQuerySource": {
              "documents": "projects/project-id/knowledgeBases/knowledge-base-id/documents/document-id"
            },
           "maxResults": "1"
          },
         "conversationModelConfig": {
           "model": "projects/project-id/conversationModels/model-id"
         }
        }
      ]
    }
  }
}

Langkah 2: Pilih sentimen atau pelatih AI

Pilih apakah akan menggunakan analisis sentimen, pelatih AI, atau keduanya untuk memantau percakapan. Aturan eskalasi Anda juga mencerminkan pilihan ini.

Sentimen

Untuk menganalisis sentimen pengguna akhir selama percakapan, tambahkan analisis sentimen ke profil percakapan Anda.

Pelatih AI

Untuk menganalisis percakapan dengan pelatih AI, ikuti petunjuk untuk membuat generator pelatih AI. Anda hanya dapat membuat satu generator pelatih AI dalam satu waktu untuk satu profil percakapan. Anda dapat menambahkan sejumlah petunjuk tanpa batas ke generator pelatih AI, dan setiap petunjuk harus menyertakan minimal Judul tampilan dan Kondisi.

Setelah membuat generator, salin ID generator baru Anda dan tambahkan ke profil percakapan Anda.

Langkah 3: Konfigurasi aturan untuk memantau percakapan

Perbarui profil percakapan Anda untuk mengaktifkan dan mengonfigurasi aturan pemantauan untuk percakapan dukungan pelanggan yang menggunakan sentimen atau pelatih AI. Pilih salah satu opsi berikut untuk memperbarui profil percakapan Anda dengan API:

  • Panggil metode update pada resource ConversationProfile.
  • Tetapkan konfigurasi pemantauan interaksi dengan metode UpdateConversationProfile. Permintaan Anda untuk menyetel konfigurasi pemantauan interaksi akan terlihat seperti contoh berikut.

    conversation_profile {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
        notification_config = { # If you want to enable notifications on your custom pub/sub topic, add it here.
        topic = 'ADD_YOUR_CUSTOM_PUBSUB_TOPIC'
            message_format = 'JSON'
          }
      # Optional: Leave both empty for *Default Mode*.
      # Other supported configurations:
      # 1. **Default Mode:** Always publish alert events when they are triggered and publish metric events only when an alert is triggered,
      #   - Metric event: `METRIC_EVENT_PUBLISH_IF_ALERT_TRIGGERED`
      #   - Alert event: `ALERT_EVENT_ALWAYS_PUBLISH`
      # 2. **Pure Monitoring Mode:** Publish all metric events, but never publish alert events.
      #   - Metric event: `METRIC_EVENT_ALWAYS_PUBLISH`
      #   - Alert event: `ALERT_EVENT_NEVER_PUBLISH`
      # 3. **Publish All Events:** Always publish both metric and alert     events.
      #   - Metric event: `METRIC_EVENT_ALWAYS_PUBLISH`
      #   - Alert event: `ALERT_EVENT_ALWAYS_PUBLISH`
      # Note: Avoid setting `metric_event_notification_mode` to `METRIC_EVENT_PUBLISH_IF_ALERT_TRIGGERED` while `alert_event_notification_mode` is `ALERT_EVENT_NEVER_PUBLISH`, as this combination will result in no events being published.
    metric_event_notification_mode = 'ADD'
    alert_event_notification_mode = 'ADD'
        }
        alerting_config {
          # Required.
          rules {
            alert_rule_id: "rule_1"
            description: "rule_1_description"
            trigger_condition {
            ...
            }
      rules {
            alert_rule_id: "rule_2"
            description: "rule_2_description"
            trigger_condition {
            ...
            }
          }
          # Optional Tool config to retrieve customer name. If not    required, skip setting the metadata_config
          metadata_config = {
            tool_configs = [
        {
          display_name = 'Customer Name'
          toolset_tool = {
            toolset = 'ADD_CUSTOM_TOOLSET'
            operation_id = 'load_profile'
          }
          response_key_path = 'sessionInfo.customerProfile.customerName'
        },
            ]
          }
    
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    }

Hubungi Google Cloud perwakilan Anda untuk mendapatkan bantuan tambahan.

Contoh konfigurasi

Contoh berikut menggambarkan konfigurasi profil percakapan untuk berbagai kombinasi aturan pemantauan.

Contoh 1: Aturan pelatih AI cocok

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          rules {
            alert_rule_id: "agent coaching alert trigger rule(s) matched"
            description: "agent coaching alert trigger rule(s) matched"
            trigger_condition {
              metric_condition {
                metric_type: AGENT_COACHING_INSTRUCTIONS
                agent_coaching_config {
                  generator_name:    "projects/agent-assist-console-demo/locations/global/generators/newly_created_generator_id"
                }
                display_name: "agent coaching alert trigger rule(s) matched"
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

Contoh 2: Skor sentimen < -0,01

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          rules {
            alert_rule_id: "customer sentiment negative"
            description: "negative sentiment"
            trigger_condition {
              metric_condition {
                metric_type: SENTIMENT
                value_range {
                  max_threshold: -0.01
                }
                display_name: "negative sentiment"
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

Contoh 3: Skor sentimen < -0,01 dan aturan pelatih AI cocok

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          # Required.
          rules {
            alert_rule_id: "sentiment is negative and agent coaching alert trigger rule(s) matched"
            description: "agent coaching alert trigger rule(s) matched and customer is unhappy"
            trigger_condition {
              and_condition {
                alert_conditions {
                  metric_condition {
                    metric_type: SENTIMENT_SCORE
                    value_range {
                      max_threshold: -0.01
                    }
                    display_name: "negative sentiment and agent coaching alert trigger rule(s) matched"
                  }
                }
                alert_conditions {
                  metric_condition {
                    metric_type: AGENT_COACHING_INSTRUCTIONS
                    agent_coaching_config {
                      generator_name: "projects/agent-assist-console-demo/locations/global/generators/newly_created_generator_id"
                    }
                    display_name: "negative sentiment and agent coaching alert trigger rule(s) matched"
                  }
                }
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

Contoh 4: Aturan pelatih AI cocok atau Skor sentimen < -0,01

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          rules {
            alert_rule_id: "agent coaching alert trigger rule(s) matched"
            description: "agent coaching alert trigger rule(s) matched"
            trigger_condition {
              metric_condition {
                metric_type: AGENT_COACHING_INSTRUCTIONS
                agent_coaching_config {
                  generator_name:    "projects/agent-assist-console-demo/locations/global/generators/newly_created_generator_id"
                }
                display_name: "agent coaching alert trigger rule(s) matched"
              }
            }
          }
          rules {
            alert_rule_id: "customer sentiment negative"
            description: "negative sentiment"
            trigger_condition {
              metric_condition {
                metric_type: SENTIMENT
                value_range {
                  max_threshold: -0.01
                }
                display_name: "negative sentiment"
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

Langkah 4: Konfigurasi bantuan supervisor

  1. Buat topik Pub/Sub untuk menerima pemberitahuan. Agent Assist menggunakan topik Pub/Sub ini untuk menerima pemberitahuan dan metrik. Catat ID topik Anda.
  2. Kirim project dan ID topik Pub/Sub Anda ke Google untuk dimasukkan ke daftar yang diizinkan.

Layanan pemantauan interaksi manusia-manusia memublikasikan jenis peristiwa berikut:

  • Metrik sentimen adalah perhitungan sentimen gabungan untuk semua giliran pengguna akhir dalam percakapan.
  • Peristiwa pemberitahuan adalah notifikasi yang berisi detail aturan yang dibuat Agent Assist saat sentimen melanggar nilai minimum yang dikonfigurasi.

Bantuan supervisor mendukung konfigurasi standar berikut untuk memenuhi persyaratan integrasi yang berbeda untuk kedua peristiwa ini. Anda dapat menyertakan setelan ini dalam konfigurasi pemantauan interaksi.

  • Mode default: Pemberitahuan dipublikasikan segera saat kondisi terpenuhi. Metrik sentimen dipublikasikan hanya setelah pemberitahuan dimulai.
  • Mode pemantauan murni: Metrik sentimen dipublikasikan secara berkelanjutan untuk setiap giliran. Peristiwa pemberitahuan diabaikan.
  • Perilaku mode publikasikan semua: Kedua jenis peristiwa selalu dipublikasikan tanpa syarat.

Langkah 5a: Uji chat

Ikuti langkah-langkah berikut untuk menguji bantuan supervisor dengan simulator chat.

  1. Buka simulator pemantauan:

    https://agentassist.cloud.google.com/projects/project-id/locations/location-id/human-supervisor
    
  2. Klik settingsSetelan, lalu pilih Agen Manusia.

  3. Buka tab lain di browser Anda dan buka Simulator percakapan Chat menggunakan profil percakapan Anda.

  4. Mulai percakapan di simulator percakapan, dan perhatikan bahwa simulator pemantauan menampilkan transkrip dan skor sentimen.

Langkah 5b: Uji suara

Ikuti langkah-langkah berikut untuk menguji bantuan supervisor dengan simulator suara.

  1. Buka simulator pemantauan:

    https://agentassist.cloud.google.com/projects/project-id/locations/location-id/human-supervisor
    
  2. Klik setelanSetelan, lalu pilih Agen manusia dan Hanya pantau panggilan telepon.

  3. Buka tab lain di browser Anda dan buka Simulator percakapan suara menggunakan profil percakapan Anda.

  4. Klik panggilanBeralih ke suara.

  5. Masukkan nomor telepon agen.

  6. Gunakan ponsel lain dengan nomor yang berbeda untuk memanggil nomor baru yang ditampilkan di layar.

Peta skor

Bantuan supervisor memberikan dua skor:

  • Skor sentimen per giliran adalah nilai floating point diskret dari -1 hingga 1.
  • Skor sentimen terbaru adalah nilai floating point berkelanjutan dari -1 hingga 1.

Anda dapat memetakan skor sentimen berkelanjutan hingga ke titik tertentu ke skor kustom yang sesuai untuk berbagai unit bisnis. Contoh berikut menggambarkan satu pendekatan pemetaan.

Contoh Kode JavaScript untuk pemetaan:

/**
 * Maps a score to a bucket index (1-10) based on 11 boundary points.
 * * @param {number} score - The input score (between -1 and 1)
 * @param {number[]} boundaries - An array of exactly 11 numbers sorted in ascending order.
 * @return{number} The bucket index (1 to 10).
 */
function getBucketIndex(score, boundaries) {
  // 1. Validation: Ensure we have exactly 11 boundary points
  if (!Array.isArray(boundaries) || boundaries.length !== 11) {
    throw new Error("Boundaries must be an array of exactly 11 points.");
  }

  // 2. Validate Input Score Range 
  if (typeof score !== 'number' || score < -1 || score > 1) {
    throw new Error(`Input score ${score} is out of bounds. Must be between -1 and 1.`)
  }

  // 3. Iterate through boundaries to find the slot
  // We start checking from index 1 (the first upper bound)
  for (let i = 1; i < boundaries.length; i++) {
    // If the score is strictly less than the current boundary,
    // it belongs to the bucket corresponding to this index.
    if (score <= boundaries[i]) {
      return i;
    }
  }

  // Fallback (should be covered by step 2 validation, but ensures integer return)
  return -1;
}


// --- Example Usage ---

// Create 11 boundary points from -1 to 1
// [-1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
const boundaries = [];
for (let i = 0; i <= 10; i++) {
  // Creating points: -1 + (i * 0.2)
  boundaries.push(parseFloat((-1 + (i * 0.2)).toFixed(1))); 
}

console.log("Boundaries:", boundaries);

// Test Cases
console.log(`Score -0.9 maps to Bucket: ${getBucketIndex(-0.9, boundaries)}`); // Expected: 1
console.log(`Score -0.8 maps to Bucket: ${getBucketIndex(-0.8, boundaries)}`); // Expected: 2 (Inclusive lower)
console.log(`Score 0.0 maps to Bucket: ${getBucketIndex(0.0, boundaries)}`);   // Expected: 6
console.log(`Score 0.95 maps to Bucket: ${getBucketIndex(0.95, boundaries)}`); // Expected: 10
console.log(`Score 1.0 maps to Bucket: ${getBucketIndex(1.0, boundaries)}`);   // Expected: 10 (Inclusive upper)

Anda dapat mengoptimalkan pemetaan menggunakan kode berikut untuk menentukan secara otomatis nilai minimum yang memaksimalkan korelasi antara prediksi yang dipetakan dan skor CX. Setelah melakukan pengoptimalan satu kali ini pada data, Anda dapat menggunakan batas berbasis data yang dihasilkan, bukan mengonfigurasinya secara manual.

Notifikasi peristiwa Pub/Sub

Metrik dan pemberitahuan sentimen dipublikasikan ke satu topik Pub/Sub yang dikonfigurasi. Payload berbeda berdasarkan jenis acara.

Payload pesan Pub/Sub metrik sentimen:

{
  "data": "{\"metric\":{\"metricType\":\"SENTIMENT_SCORE\",\"value\":{\"createTime\":\"2024-01-01T00:00:00.000Z\",\"sentiment\":{\"score\":0.5,\"magnitude\":0.5},\"advancedValues\":{\"exponentialMovingAverageValue\":0.5}},\"conversation\":\"projects/your-project-id/locations/global/conversations/conversation_id\",\"message\":{\"name\":\"projects/your-project-id/locations/global/conversations/conversation_id/messages/message_id\",\"content\":\"ok\",\"languageCode\":\"en-US\",\"participant\":\"projects/your-project-id/locations/global/conversations/conversation_id/participants/participant_id\",\"participantRole\":\"END_USER\",\"sendTime\":\"2024-01-01T00:00:00.000Z\"}}}",
  "attributes": {
    "conversation_id": "conversation_id"
  }
}

Contoh mengubah payload pesan pubsub:

{"data": "{\"alert\":{\"name\":\"projects/project_id/locations/location_id/interactionMonitoringAlerts/alert_id\",\"conversation\":\"projects/project_id/locations/location_id/conversations/conversation_id\",\"alertState\":\"CREATED\",\"alertMetadata\":{\"alertTriggerRules\":[{\"alertRuleId\":\"negative-sentiment\",\"description\":\"dummy_description\",\"Strong negative sentiment detected in last 30 seconds\":[{\"metricType\":\"SENTIMENT_SCORE\",\"values\":[{\"createTime\":\"2024-01-01T00:00:00.000Z\",\"sentiment\":{\"score\":0.0,\"magnitude\":0.0}}]}]}],\"channelType\":\"CHAT\"},\"createTime\":\"2024-01-01T00:00:00.000Z\"}}",
  "attributes": {
    "conversation_id": "conversation_id"
  }
}

Referensi API

AnalyzeContent:

  • Kasus penggunaan: Memantau percakapan chat antara pengguna akhir dan agen manusia.
  • Metode pengujian:
    • Simulator konsol: Gunakan simulator chat konsol Agent Assist.
    • Integrasi API: Kirim permintaan HTTP atau RPC langsung (lihat [Contoh Kode]).

StreamingAnalyzeContent

  • Kasus penggunaan: Memantau percakapan suara antara pengguna akhir dan agen manusia.
  • Metode pengujian:
    • Simulator konsol: Gunakan simulator suara konsol Agent Assist.
    • Integrasi API: Kirim permintaan HTTP atau RPC langsung (lihat [Contoh Kode]).

ListMessages:

  • Mengambil daftar lengkap transkrip (giliran agen dan pelanggan) untuk percakapan.
  • Praktik terbaik: API ini sangat berguna untuk percakapan suara guna memverifikasi transkrip akhir yang telah dikoreksi untuk setiap giliran setelah streaming selesai.

ListInteractionMonitoringMetrics: Mengambil semua metrik sentimen yang dihitung dan digabungkan untuk percakapan tertentu.

Contoh payload permintaan:

{
  "parent": "projects/{project-id}/locations/{location-id}",
  "conversation":
"projects/{project-id}/locations/{location-id}/conversations/{conversation-id}"
}

Contoh payload respons:

{
  "interactionMonitoringMetrics": [{
    "metricType": "SENTIMENT_SCORE",
    "values": {
      "createTime": "2025-12-01T22:20:49.925Z",
      "sentiment": {
        "score": -1.0,
        "magnitude": 1.0
      },
      "advancedValues": {
        "movingAverageValue": -0.4994999999762513
      }
    }, {
      "createTime": "2025-12-01T22:20:21.027Z",
      "sentiment": {
        "score": 0.001,
        "magnitude": 0.001
      },
      "advancedValues": {
        "movingAverageValue": -0.4994999999762513
      }
    },
      "advancedValues": {
      }
    }]
}

ListInteractionMonitoringAlert: Mengambil pemberitahuan yang dihasilkan. Hal ini dapat dicakup ke seluruh project atau difilter ke percakapan tertentu.

Untuk membuat kueri semua pemberitahuan dalam project:

{
  "parent": "projects/{project-id}/locations/{location-id}"
}

**Untuk membuat kueri pemberitahuan untuk id percakapan tertentu **

{
  "parent": "projects/{project-id}/locations/{location-id}",
  "filter": "context_id=projects/{project-id}/locations/{location-id}/conversations/{conversation-id}"
}

Opsi pemfilteran. Pengguna dapat menerapkan kriteria filter tambahan, seperti status notifikasi:

alert_state=CREATED,alert_state=ACKNOWLEDGED