Business Messages 에이전트는
- Dialogflow ES: 인텐트 일치 및 FAQ 봇
- Dialogflow CX: 인텐트 일치 및 실시간 에이전트 핸드오프
Business Messages 에이전트를 Dialogflow의 다른 기능과 통합하기 위해 ES 또는 Dialogflow CX 각 제품의 문서를 참조하세요
사용자가 Dialogflow 통합이 있는 에이전트에 메시지를 보내면
Business Messages는 사용자 메시지를 Dialogflow로 전달하고 Dialogflow의
에이전트에 대한 응답을
dialogflowResponse
객체 에이전트를 구성하여
사용자에게 아무런 조치를 취하지 않아도 Dialogflow의 응답을 사용자에게 자동으로
있습니다. 자동 응답을 참고하세요.
참조하세요.
Dialogflow 통합
Business Messages를 통해 Dialogflow 기반 자동화를 활용하려면 먼저 Dialogflow 통합을 사용 설정해야 합니다.
기본 요건
시작하려면
- 비즈니스 메시지 에이전트
- 루트 언어 영어인 Global 리전의 Dialogflow 에이전트 (ko)
Dialogflow 에이전트가 없으면 에이전트를 만듭니다.
Dialogflow ES
Dialogflow ES 통합을 사용 설정하려면 먼저 Dialogflow 에이전트의 프로젝트 ID입니다. 프로젝트 ID를 찾으려면 다음 안내를 따르세요.
- Dialogflow 콘솔로 이동합니다.
- Business Messages에 연결할 Dialogflow 에이전트를 선택합니다.
오른쪽 상단의 톱니바퀴 아이콘
있습니다.
- Google 프로젝트에서 프로젝트 ID 값을 확인합니다.
Dialogflow CX
Dialogflow CX 통합을 사용 설정하려면 다음이 필요합니다. Dialogflow 에이전트의 프로젝트 ID 및 에이전트 ID 이 ID를 찾으려면
- Dialogflow CX 콘솔로 이동합니다.
- Dialogflow 프로젝트를 선택합니다.
- 상담사 선택기에서 더보기 메뉴를 클릭합니다.
있습니다.
- 이름 복사를 클릭합니다. 이렇게 하면
다음 형식을 따릅니다.
projects/PROJECT_ID/locations/REGION_ID/agents/AGENT_ID
- 프로젝트 ID와 에이전트 ID 값을 기록합니다.
통합 만들기
다음에서 파트너의 Dialogflow 서비스 계정 이메일을 가져옵니다.
dialogflowServiceAccountEmail
바꾸기 PARTNER_ID를 파트너 ID로 바꿉니다.cURL
# This code gets the partner. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/partners/get # Replace the __PARTNER_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X GET \ "https://businesscommunications.googleapis.com/v1/partners/__PARTNER_ID__" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
Node.js
/** * This code snippet gets a partner. * Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/partners/get * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const PARTNER_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const partnerName = 'partners/' + PARTNER_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: partnerName, }; bcApi.partners.get(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent found console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
Python
"""This code gets a partner. Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/partners/get This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( Agent, BusinesscommunicationsPartnersGetRequest, ) # Edit the values below: PARTNER_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) partners_service = BusinesscommunicationsV1.PartnersService(client) partner_name = 'partners/' + PARTNER_ID partner = partners_service.Get(BusinesscommunicationsPartnersGetRequest( name=partner_name )) print(partner)
서비스 계정 이메일을 복사합니다. 이 계정은 Business Messages를 연결합니다. Dialogflow 에이전트가 포함됩니다
Google Cloud 콘솔 Dialogflow 프로젝트를 선택합니다.
IAM으로 이동 권한이 있는지 확인합니다.
추가를 클릭하고 새 구성원의 서비스 계정 이메일을 입력합니다.
역할 선택에서 Dialogflow 콘솔 에이전트 편집자를 선택합니다.
다른 역할 추가를 클릭하고 Dialogflow API 클라이언트를 선택합니다.
저장을 클릭합니다.
Dialogflow 프로젝트를 Business Messages 에이전트와 통합합니다.
다음에 따라 AUTO_RESPONSE_STATUS를 ENABLED 또는 DISABLED로 바꿉니다. Business Messages가 비즈니스 메시지에 자동으로 응답하도록 할지 할 수 있습니다.
Dialogflow ES
cURL
# This code creates a Dialogflow ES integration. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#dialogflow_es # Replace the __BRAND_ID__, __AGENT_ID__, __DIALOGFLOW_ES_PROJECT_ID__ and __AUTO_RESPONSE_STATUS__ # Make sure a service account key file exists at ./service_account_key.json curl -X POST \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -d '{ "dialogflowEsIntegration": { "dialogflowProjectId": "__DIALOGFLOW_ES_PROJECT_ID__", "autoResponseStatus": "__AUTO_RESPONSE_STATUS__" } }'
Node.js
/** * This code snippet creates a Dialogflow ES integration. * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#dialogflow_es * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const DIALOGFLOW_ES_PROJECT_ID = 'EDIT_HERE' const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); const uuidv4 = require('uuid').v4; // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const agentName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID; if (authClient) { const integrationObject = { dialogflowEsIntegration: { dialogflowProjectId: DIALOGFLOW_ES_PROJECT_ID, autoResponseStatus: 'ENABLED' } }; // Setup the parameters for the API call const apiParams = { auth: authClient, parent: agentName, resource: integrationObject }; bcApi.brands.agents.integrations.create(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent created console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
Python
"""This code snippet creates a Dialogflow ES integration. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#dialogflow_es This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsIntegrationsCreateRequest, DialogflowEsIntegration ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' DIALOGFLOW_ES_PROJECT_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) integrations_service = BusinesscommunicationsV1.BrandsAgentsIntegrationsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID integration = integrations_service.Create(BusinesscommunicationsBrandsAgentsIntegrationsCreateRequest( integration=DialogflowEsIntegration( autoResponseStatus=DialogflowEsIntegration.AutoResponseStatusValueValuesEnum.ENABLED, dialogflowProjectId=DIALOGFLOW_ES_PROJECT_ID ), parent=agent_name )) print(integration)
Dialogflow CX
cURL
# This code creates a Dialogflow CX integration. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#dialogflow_cx # Replace the __BRAND_ID__, __AGENT_ID__, __DIALOGFLOW_CX_PROJECT_ID__, __DIALOGFLOW_CX_AGENT_ID__ and __AUTO_RESPONSE_STATUS__ # Make sure a service account key file exists at ./service_account_key.json curl -X POST \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -d '{ "dialogflowCxIntegration": { "dialogflowProjectId": "__DIALOGFLOW_CX_PROJECT_ID__", "dialogflowAgentId": "__DIALOGFLOW_CX_AGENT_ID__", "autoResponseStatus": "__AUTO_RESPONSE_STATUS__" } }'
Node.js
/** * This code snippet creates a Dialogflow CX integration. * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#dialogflow_cx * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const DIALOGFLOW_CX_AGENT_ID = 'EDIT_HERE' const DIALOGFLOW_CX_PROJECT_ID = 'EDIT_HERE' const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); const uuidv4 = require('uuid').v4; // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const agentName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID; if (authClient) { const integrationObject = { dialogflowCxIntegration: { dialogflowProjectId: DIALOGFLOW_CX_PROJECT_ID, dialogflowAgentId: DIALOGFLOW_CX_AGENT_ID, autoResponseStatus: 'ENABLED' } }; // Setup the parameters for the API call const apiParams = { auth: authClient, parent: agentName, resource: integrationObject }; bcApi.brands.agents.integrations.create(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent created console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
Python
"""This code snippet creates a Dialogflow CX integration. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#dialogflow_cx This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsIntegrationsCreateRequest, DialogflowCxIntegration ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' DIALOGFLOW_CX_AGENT_ID = 'EDIT_HERE' DIALOGFLOW_CX_PROJECT_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) integrations_service = BusinesscommunicationsV1.BrandsAgentsIntegrationsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID integration = integrations_service.Create(BusinesscommunicationsBrandsAgentsIntegrationsCreateRequest( integration=DialogflowCxIntegration( autoResponseStatus=DialogflowCxIntegration.AutoResponseStatusValueValuesEnum.ENABLED, dialogflowAgentId=DIALOGFLOW_CX_AGENT_ID, dialogflowProjectId=DIALOGFLOW_CX_PROJECT_ID ), parent=agent_name )) print(integration)
형식 지정 및 값 옵션은 다음을 참고하세요.
Integration
Business Messages와 Dialogflow를 연결하는 데는 2분 정도 걸립니다. 받는사람
통합 상태를 확인하고 통합의
OperationInfo
통합 업데이트
에이전트의 자동 응답 설정을 업데이트하려면 다음 명령어를 실행합니다. AUTO_RESPONSE_STATUS을(를) ENABLED 또는 ENABLED로 바꿉니다. Business Messages를 자동으로 사용할지 여부에 따라 사용 중지됨 Dialogflow 응답으로 사용자에게 응답합니다
Dialogflow ES
cURL
# This code updates the Dialogflow association. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/updateDialogflowAssociation # Replace the __BRAND_ID__ and __AGENT_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/dialogflowAssociation?updateMask=enableAutoResponse" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "enableAutoResponse": true }'
Dialogflow CX
cURL
# This code updates the Dialogflow association. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/updateDialogflowAssociation # Replace the __BRAND_ID__ and __AGENT_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/dialogflowAssociation?updateMask=enableAutoResponse" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "enableAutoResponse": true }'
형식 지정 및 값 옵션은 다음을 참고하세요.
Integration
Dialogflow 버전 간 전환
Business Messages 에이전트는 한 번에 하나의 Dialogflow 통합만 지원할 수 있습니다. Dialogflow 버전에서 다른 버전으로 전환하려면 새 통합을 생성합니다.
통합 삭제
Business Messages 에이전트에서 Dialogflow를 삭제해야 하는 경우 통합할 수도 있습니다
cURL
# This code deletes an integration. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#delete_the_integration # Replace the __BRAND_ID__, __AGENT_ID__ and __INTEGRATION_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X DELETE \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations/__INTEGRATION_ID__" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
Node.js
/** * This code snippet deletes an integration. * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#delete_the_integration * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const INTEGRATION_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); const uuidv4 = require('uuid').v4; // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const integrationName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID + '/integrations/' + INTEGRATION_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: integrationName, }; bcApi.brands.agents.integrations.delete(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent created console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
Python
"""This code snippet deletes an integration. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#delete_the_integration This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsIntegrationsDeleteRequest ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' INTEGRATION_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) integrations_service = BusinesscommunicationsV1.BrandsAgentsIntegrationsService(client) integration_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID + '/integrations/' + INTEGRATION_ID integration = integrations_service.Delete(BusinesscommunicationsBrandsAgentsIntegrationsDeleteRequest( name=integration_name )) print(integration)
형식 지정 및 값 옵션은 다음을 참고하세요.
Integration
통합 정보 가져오기
통합에 대한 정보를 확인하려면 비즈니스 커뮤니케이션
API(통합의 name
값이 있는 경우)
단일 통합에 대한 정보 가져오기
통합 정보를 가져오려면 다음 명령어를 실행합니다.
cURL
# This code gets information about an integration. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#get_info_for_a_single_integration # Replace the __BRAND_ID__, __AGENT_ID__ and __INTEGRATION_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X GET \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations/__INTEGRATION_ID__" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
Node.js
/** * This code snippet gets information about an integration. * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#get_info_for_a_single_integration * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const INTEGRATION_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); const uuidv4 = require('uuid').v4; // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const integrationName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID + '/integrations/' + INTEGRATION_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: integrationName, }; bcApi.brands.agents.integrations.get(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent created console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
Python
"""This code snippet gets information about an integration. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#get_info_for_a_single_integration This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsIntegrationsDeleteRequest ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' INTEGRATION_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) integrations_service = BusinesscommunicationsV1.BrandsAgentsIntegrationsService(client) integration_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID + '/integrations/' + INTEGRATION_ID integration = integrations_service.Get(BusinesscommunicationsBrandsAgentsIntegrationsDeleteRequest( name=integration_name )) print(integration)
형식 지정 및 값 옵션은 다음을 참고하세요.
Integration
에이전트의 모든 통합 나열
통합 이름을 모르는 경우 모든 INTEGRATION_ID를 생략하여 에이전트와 연결된 통합을 구현합니다. 값을 가져올 수 있습니다.
cURL
# This code lists all integrations for an agent. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#list_all_integrations_for_an_agent # Replace the __BRAND_ID__ and __AGENT_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X GET \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
Node.js
/** * This code snippet lists all integrations for an agent. * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#list_all_integrations_for_an_agent * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); const uuidv4 = require('uuid').v4; // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, parent: 'brands/' + BRAND_ID + '/agents/' + AGENT_ID, }; bcApi.brands.agents.integrations.list(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent created console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
Python
"""This code snippet lists all integrations for an agent. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#list_all_integrations_for_an_agent This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsIntegrationsListRequest ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) integrations_service = BusinesscommunicationsV1.BrandsAgentsIntegrationsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID integration = integrations_service.List( BusinesscommunicationsBrandsAgentsIntegrationsListRequest(parent=agent_name) ) print(integration)
형식 지정 및 값 옵션은 다음을 참고하세요.
Integration
인텐트 매칭
Business Messages 에이전트에 Dialogflow 통합을 사용 설정하면 에이전트는 Dialogflow 프로젝트의 구성된 인텐트를 사용하여 사용자 질문에 응답할 수 있습니다. 자세히 알아보려면 Dialogflow ES 문서를 참조하세요. 및 Dialogflow CX를 참조하세요.
원하는 모든 대화 옵션에 맞게 Dialogflow 인텐트 구성 자동화를 통해 지원합니다 Business Messages 에이전트는 Dialogflow를 사용하여 사용자 메시지를 이해할 수 있습니다.
Dialogflow API를 호출할 때 Business Messages는
사용자 메시지 페이로드
처리 웹훅을 정의합니다 사용자 메시지가 일치될 때
인텐트를 사용하면 다음에서 Struct
형식으로 이 페이로드에 액세스할 수 있습니다.
QueryParameters
내의 business_messages_payload
필드
페이로드에는 DialogflowResponse
를 제외하고 사용자 메시지의 모든 필드가 포함됩니다.
Dialogflow CX의 경우 Business Messages는 값이 google_business_messages
인 channel
라는 세션 매개변수도 인텐트에 전달하며, 개발자는 이를 $session.params.channel
형식으로 에이전트에서 참조할 수 있습니다.
이 매개변수를 사용하면 동일한 Dialogflow 에이전트에서 여러 채널을 지원하기 위해 조건문을 Dialogflow fulfillment에 추가할 수 있습니다.
쿼리 매개변수에 대한 자세한 내용은 Dialogflow ES 및 Dialogflow CX 참조를 확인하세요.
기본 요건
Dialogflow 내에서 NLU 모델을 만들 때 다양한 응답 유형을 지정합니다 Business Messages는 기본 응답을 지원합니다. 여기에는 다음이 포함될 수 있습니다.
- 텍스트
- 커스텀 페이로드
- 실시간 에이전트 핸드오프 (Dialogflow CX만 해당)
커스텀 페이로드는 유효한 Business Messages JSON 메시지 응답과 일치해야 합니다. 객체를 사용하세요. 인텐트에 대한 커스텀 페이로드 응답을 구성할 때 Business Messages는 다음 필드는 무시합니다.
name
messageId
representative
다음 샘플 응답을 참조하세요.
추천 텍스트
{
"text": "Hello World!",
"fallback": "Hello World!\n\nReply with \"Hello\" or \"Hi!\"",
"suggestions": [
{
"reply": {
"text": "Hello",
"postbackData": "hello-formal"
}
},
{
"reply": {
"text": "Hi!",
"postbackData": "hello-informal"
}
}
]
}
리치 카드
{
"fallback": "Hello, world!\nSent with Business Messages\n\nReply with \"Suggestion #1\" or \"Suggestion #2\"",
"richCard": {
"standaloneCard": {
"cardContent": {
"title": "Hello, world!",
"description": "Sent with Business Messages.",
"media": {
"height": "TALL",
"contentInfo":{
"altText": "Google logo",
"fileUrl": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png",
"forceRefresh": "false"
}
},
"suggestions": [
{
"reply": {
"text": "Suggestion #1",
"postbackData": "suggestion_1"
}
},
{
"reply": {
"text": "Suggestion #2",
"postbackData": "suggestion_2"
}
}
]
}
}
}
}
리치 카드 캐러셀
{
"fallback": "Card #1\nThe description for card #1\n\nCard #2\nThe description for card #2\n\nReply with \"Card #1\" or \"Card #2\"",
"richCard": {
"carouselCard": {
"cardWidth": "MEDIUM",
"cardContents": [
{
"title": "Card #1",
"description": "The description for card #1",
"suggestions": [
{
"reply": {
"text": "Card #1",
"postbackData": "card_1"
}
}
],
"media": {
"height": "MEDIUM",
"contentInfo": {
"fileUrl": "https://my.files/cute-dog.jpg",
"forceRefresh": false
}
}
},
{
"title": "Card #2",
"description": "The description for card #2",
"suggestions": [
{
"reply": {
"text": "Card #2",
"postbackData": "card_2"
}
}
],
"media": {
"height": "MEDIUM",
"contentInfo": {
"fileUrl": "https://my.files/elephant.jpg",
"forceRefresh": false
}
}
}
]
}
}
}
실시간으로 상담사에게 전달
{
"metadata": {}
}
FAQ 봇
Business Messages 에이전트에 Dialogflow ES 통합을 사용 설정한 후에는 FAQ 봇을 만들 수 있습니다 질문과 답변을 지원되는 기술 문서를 만들면 Business Messages와 Dialogflow가 사용자의 질문을 이해하고 이에 대응하기 위해 필요한 코드 작성의 부담을 줄일 수 있습니다.
FAQ 봇의 작동 방식을 확인하려면 Business Messages FAQ와 채팅하세요. 봇
기본 요건
FAQ 봇을 만들려면 질문과 답변이 기술 문서 (최대 50MB): 공개적으로 사용 가능한 HTML 파일 또는 CSV 파일.
일반적으로 기술 문서는
- Rich 텍스트를 입력합니다.
- 최대 크기는 50MB입니다.
- 질문/답변 쌍은 2,000개를 초과할 수 없습니다.
- 답변이 다른 중복 질문은 지원하지 않습니다.
HTML 파일의 경우
- 공개 URL의 파일은 검색 색인에 존재할 수 있도록 Google 검색 색인 생성기가 크롤링한 것이어야 합니다. Google Search Console로 이동합니다. 색인 생성기는 콘텐츠를 최신 상태로 유지하지 않습니다. 명시적으로 소스 콘텐츠가 변경되면 문서를 업데이트합니다.
- Dialogflow는 응답을 생성할 때 콘텐츠에서 HTML 태그를 삭제합니다. 왜냐하면 가능하면 HTML 태그 사용을 지양하고 일반 텍스트를 사용하는 것이 좋습니다.
- 하나의 질문/답변 쌍을 포함하는 파일은 지원되지 않습니다.
CSV 파일의 경우
- 파일에는 첫 번째 열에 질문이 있어야 하고 두 번째 열에 답이 있어야 합니다. 있습니다.
- 파일은 구분 기호로 쉼표를 사용해야 합니다.
FAQ 봇 만들기
FAQ 봇을 만들려면 먼저 데이터를 수집하고 질문/답변 쌍이 포함된 문서를 하나 이상 기술 자료입니다.
기술 자료 만들기
기술 자료를 만들려면 다음 명령어를 실행합니다. 바꾸기
BRAND_ID님, AGENT_ID님, INTEGRATION_ID님
이 값을 문서의 name
에서 가져온 고유한 값으로 바꿉니다. 바꾸기
KNOWLEDGE_BASE_DISPLAY_NAME를
선택의 기로에 서게 됩니다.
기술 자료를 만든 후에는 문서를 작성할 수 있습니다. 있습니다.
cURL
# This code creates a knowledge base. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#create-knowledge-base # Replace the __BRAND_ID__, __AGENT_ID__, __INTEGRATION_ID__ and __KNOWLEDGE_BASE_DISPLAY_NAME__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations/__INTEGRATION_ID__?updateMask=dialogflowEsIntegration.dialogflowKnowledgeBases" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "dialogflowEsIntegration": { "dialogflowKnowledgeBases": [ { "displayName": "__KNOWLEDGE_BASE_DISPLAY_NAME__" } ] } }'
형식 지정 및 값 옵션은 다음을 참고하세요.
DialogflowKnowledgebase
기술 문서 만들기
기술 문서를 만들려면 다음 명령어를 실행합니다.
기존 문서 목록에 문서를 추가하거나, 없는 경우 새 목록을 만듭니다.
아직 존재하지 않습니다. 기존 문서 목록에는 문서의 name
가 포함되어야 합니다.
값으로 사용됩니다.
공개 HTML 파일
다음 변수를 바꿉니다.
- BRAND_ID님, AGENT_ID님, INTEGRATION_ID님
통합
name
의 고유한 값으로 바꿉니다. - KNOWLEDGE_BASE_DISPLAY_NAME 및 DOCUMENT_DISPLAY_NAME을(를) 다음으로 바꿉니다. 선택한 문자열 식별
지식 PUBLIC_URL 문서의 공개 URL
cURL
# This code creates a knowledge base document from an HTML document and adds it to the knowledge base. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#create-document # Replace the __BRAND_ID__, __AGENT_ID__, __INTEGRATION_ID__, __KNOWLEDGE_BASE_DISPLAY_NAME__, __DOCUMENT_DISPLAY_NAME__ and __PUBLIC_URL__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations/__INTEGRATION_ID__?updateMask=dialogflowEsIntegration.dialogflowKnowledgeBases" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "dialogflowEsIntegration": { "dialogflowKnowledgeBases": [ { "displayName": "__KNOWLEDGE_BASE_DISPLAY_NAME__", "documents": [ { "displayName": "__DOCUMENT_DISPLAY_NAME__", "faqUrl": "__PUBLIC_URL__" } ] } ] } }'
로컬 CSV 파일
다음 변수를 바꿉니다.
- BRAND_ID님, AGENT_ID님, INTEGRATION_ID님
통합
name
의 고유한 값으로 바꿉니다. - KNOWLEDGE_BASE_DISPLAY_NAME 및 DOCUMENT_DISPLAY_NAME을(를) 다음으로 바꿉니다. 선택한 문자열 식별
CSV로 CSV_RAW_BYTES base64 인코딩 문자열로 저장된 파일
cURL
# This code creates a knowledge base document from a CSV document and adds it to the knowledge base. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#create-document # Replace the __BRAND_ID__, __AGENT_ID__, __INTEGRATION_ID__, __KNOWLEDGE_BASE_DISPLAY_NAME__, __DOCUMENT_DISPLAY_NAME__ and __CSV_RAW_BYTES__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations/__INTEGRATION_ID__?updateMask=dialogflowEsIntegration.dialogflowKnowledgeBases" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "dialogflowEsIntegration": { "dialogflowKnowledgeBases": [ { "displayName": "__KNOWLEDGE_BASE_DISPLAY_NAME__", "documents": [ { "displayName": "__DOCUMENT_DISPLAY_NAME__", "rawContent": "__CSV_RAW_BYTES__" } ] } ] } }'
형식 지정 및 값 옵션은 다음을 참고하세요.
DialogflowKnowledgebase
기술 자료에 문서를 추가하는 데 2분 정도 걸립니다. 이
통합의
OperationInfo
기술 문서 삭제
Business Messages 에이전트에서 질문/답변 쌍을 삭제해야 하는 경우 다음 명령어를 사용하여 관련 기술 문서를 삭제합니다.
다음 명령어를 실행하여 기존 문서 하나를 삭제합니다. 바꾸기
BRAND_ID님, AGENT_ID님, INTEGRATION_ID님
이 값을 문서의 name
에서 가져온 고유한 값으로 바꿉니다. 바꾸기
KNOWLEDGE_BASE_DISPLAY_NAME를 적절한 문자열로 바꿉니다.
cURL
# This code deletes a knowledge base document. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/integrate/dialogflow?method=api#delete_a_knowledge_document # Replace the __BRAND_ID__, __AGENT_ID__, __INTEGRATION_ID__ and __KNOWLEDGE_BASE_DISPLAY_NAME__ # To delete all knowledge bases, set dialogflowKnowledgeBases to an empty list. Otherwise, the list should contain all existing knowledgebases except the one you would like to remove. # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/integrations/__INTEGRATION_ID__?updateMask=dialogflowEsIntegration.dialogflowKnowledgeBases" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "dialogflowEsIntegration": { "dialogflowKnowledgeBases": [ { "displayName": "__KNOWLEDGE_BASE_DISPLAY_NAME__" } ] } }'
형식 지정 및 값 옵션은 다음을 참고하세요.
DialogflowKnowledgebase
자동 응답
Dialogflow 통합 중 자동 응답을 사용 설정하면 Business 메시지가 Dialogflow를 통해 사용자에게 자동으로 응답합니다. 내 비즈니스 메시지 에이전트가 가장 높은 신뢰도 수준 일치로 응답합니다. 이 Dialogflow ES 통합(FAQ 답변 및 맞춤 인텐트를 사용하면 Business Messages가 신뢰 수준입니다.
Business Messages는 모든 자동 응답 메시지를 BOT
에서 보낸 것으로 표시합니다.
있습니다. 에이전트가 라이브 에이전트를 지원하는 경우
REPRESENTATIVE_JOINED
이후에는 Business Messages에서 자동 응답을 정지합니다.
이벤트
REPRESENTATIVE_LEFT
이벤트 후에 자동 응답을 재개합니다. Handoff를 참조하세요.
실제 상담사까지
FAQ 답변으로 자동 응답
Dialogflow ES 통합의 경우 FAQ 답변의 신뢰도가 가장 높은 경우 Business Messages는 답변을 문자 메시지에 매핑합니다. 만약 '다른 답변 보기'라는 메시지가 표시되면 답변" 추천되지 않습니다. 그렇지 않은 경우 메시지에 질문과 제안 문장이 포함됩니다. 메시지가 사용자의 요청을 충족했는지 묻는 답장을 보냅니다.
인텐트 응답으로 자동 응답
인텐트 응답에는 다음 응답 중 하나 이상이 포함될 수 있습니다.
- Dialogflow ES: 텍스트, 커스텀 페이로드
- Dialogflow CX: 텍스트, 커스텀 페이로드 실시간 상담사 핸드오프
인텐트 응답의 일치 신뢰도가 가장 높은 경우 적용됩니다.
- 응답에 하나 이상의 텍스트 값이 있으면 Business Messages는 이 값을 매핑합니다. 값을 문자 메시지로 변경합니다.
- 응답에 유효한 Business가 포함된 커스텀 페이로드가 하나 이상 있는 경우 메시지 JSON 객체 구조, Business Messages는 JSON 객체입니다.
- 응답에 하나 이상의 실시간 상담사 핸드오프 응답이 있는 경우 다음을 참조하세요. 실제 상담사 요청으로 자동 응답
Dialogflow는 하나의 인텐트 일치 내에 여러 응답을 포함할 수 있기 때문에 Business Messages는 각 텍스트, 커스텀 페이로드 또는 실시간 에이전트 핸드오프를 전송합니다. 별도의 메시지로 전송합니다. 인텐트에 메시지가 여러 개 있는 경우 일치하지만 일부 형식은 형식이 잘못되어 Business Messages는 유효한 메시지를 자동 응답으로 사용할 수 있습니다.
실제 상담사 요청으로 자동 응답
Dialogflow CX는 실시간 에이전트 핸드오프를 지원합니다. 있습니다. 대화를 사람에게 전달해야 함을 나타냅니다. 이를 통해 핸드오프를 위한 맞춤 메타데이터를 전달할 수 있습니다. 있습니다. 인텐트 응답의 일치 신뢰도가 가장 높은 경우 실시간 상담사 핸드오프가 포함되어 있으면 Business Messages는 실제 상담사 요청 이벤트 웹훅에 추가하면 됩니다 이 이벤트를 처리하려면 다음을 참조하세요. 봇에서 실제 상담사로 전달.
대체 메시지로 자동 응답
Dialogflow가 높은 신뢰도 수준 일치를 얻지 못하면 Business Messages는 사용할 수 있습니다 대체는 Dialogflow ES와 Dialogflow CX.
Dialogflow ES
FAQ 봇의 경우 FAQ 답변과 일치하는 항목이 없으면 Business Messages에서 답변을 찾을 수 없다는 대체 메시지를 반환합니다.
구성된 인텐트의 경우 인텐트 응답에 일치하는 항목이 없으면 비즈니스는 메시지는 대체 인텐트 응답을 전송합니다. Dialogflow에서 제공하는 대체 텍스트를 사용하거나 추가 텍스트 및 커스텀 페이로드로 대체합니다
다음은 웹훅이 반환한 대체 인텐트 응답의 예입니다. 수신:
{
"intentResponses": [
{
"intentName": "projects/df-integration/agent/intents/12345",
"intentDisplayName": "Default Fallback Intent",
"intentDetectionConfidence": "1.0",
"fulfillmentMessages": [
{
"text": "One more time?"
}
]
}
]
}
Dialogflow가 intent_name
및 intent_display_name
를 자동 입력합니다.
Dialogflow CX
Dialogflow CX는 대체 인텐트 응답을 다음과 같이 처리합니다. 기본 제공 이벤트가 있습니다. 인텐트 응답에 일치하는 항목이 없으면 Business Messages는 Dialogflow의 일치하지 않음 기본 이벤트에서 대체 메시지를 받습니다. 다음과 같은 작업을 할 수 있습니다. Dialogflow에서 제공하는 대체 텍스트를 사용하거나 대체 텍스트를 추가 텍스트, 커스텀 페이로드, 실시간 상담사 연결 옵션이 포함됩니다.
다음은 다음을 수신할 수 있습니다.
{
"intentResponses": [
{
"intentName": "sys.no-match-default",
"intentDisplayName": "Default Fallback Intent",
"intentDetectionConfidence": "0.3",
"fulfillmentMessages": [
{
"text": "I missed that, say that again?"
}
]
}
]
}
Business Messages가 intent_name
및 intent_display_name
를 하드 코딩합니다.
Dialogflow 관련 필드
Dialogflow 통합을 사용 설정하면 사용자가 에이전트에 메시지를 보냅니다.
수신
포함
dialogflowResponse
객체를 지정합니다. 웹훅은
Business Messages가
있습니다. 자동 응답을 확인하려면
autoResponded
드림
필드에 응답해야 하는지 여부를 결정합니다.
Dialogflow ES
... "dialogflowResponse": { "queryText": "TEXT", "intentResponse": { "intentName": "INTENT_ID", "intentDisplayName": "INTENT_NAME", "intentDetectionConfidence": "CONFIDENCE_NUMERIC", "fulfillmentMessages": [{ "text": "FULFILLMENT_TEXT", "jsonPayload": "JSON", "error": "ERROR_STATUS", }], "faqResponse": { "userQuestion": "USER_QUESTION", "answers": [{ "faqQuestion": "FAQ_QUESTION", "faqAnswer": "FAQ_ANSWER", "matchConfidenceLevel": "CONFIDENCE_LEVEL", "matchConfidence": "CONFIDENCE_NUMERIC", }], }, "autoResponded": "BOOLEAN", "autoRespondedMessages": [{ "message": "MESSAGE_JSON", "responseSource": "SOURCE", }], }, ...
필드 | 설명 |
---|---|
queryText
|
원래의 대화식 쿼리 텍스트입니다. 자동 맞춤법 검사가 필요한 경우
Dialogflow 모델 queryText 에 교정 기능이 사용 설정되었습니다.
수정된 사용자 입력이 포함됩니다. |
intentName |
일치된 인텐트의 고유 식별자입니다. |
intentDisplayName |
매칭된 인텐트의 이름입니다. |
intentDetectionConfidence
|
일치의 신뢰도 점수 숫자입니다.
queryText ~intentName 사이 |
text |
텍스트 응답입니다. |
jsonPayload
|
커스텀 페이로드 응답.
이 문자열은 맞춤
페이로드를 정의합니다.
페이로드에 유효한 Business Messages JSON이 없는 경우
객체 구조이면 error 에서 문제를 설명합니다. |
error |
인텐트 처리 메시지의 오류 설명입니다. |
userQuestion |
사용자가 물어본 질문으로, Dialogflow에서 파싱됩니다. |
faqQuestion |
Dialogflow의 질문이 사용자의 질문과 일치합니다. |
faqAnswer |
Dialogflow의 답변이 사용자의 질문과 일치합니다. |
matchConfidenceLevel
|
사이의 일치에 대한 신뢰도 수준
userQuestion 및 faqQuestion |
matchConfidence
|
다음 항목 간의 일치에 대한 신뢰도 점수 숫자입니다.
userQuestion 및 faqQuestion |
autoResponded
|
Business Messages가 자동으로 응답했는지 여부 Dialogflow의 답변을 사용자에게 제공합니다. |
message |
자동 응답의 페이로드입니다. |
responseSource
|
자동 응답의 소스입니다. 자세한 내용은
ResponseSource |
Dialogflow CX
... "dialogflowResponse": { "queryText": "TEXT", "intentResponse": { "intentName": "INTENT_ID", "intentDisplayName": "INTENT_NAME", "intentDetectionConfidence": "CONFIDENCE_NUMERIC", "fulfillmentMessages": [{ "text": "FULFILLMENT_TEXT", "jsonPayload": "JSON", "error": "ERROR_STATUS", "liveAgentHandoff": { "metadata": {} } }], "autoResponded": "BOOLEAN", "autoRespondedMessages": [{ "message": "MESSAGE_JSON", "responseSource": "SOURCE", }], }, ...
필드 | 설명 |
---|---|
queryText
|
원래의 대화식 쿼리 텍스트입니다. 자동 맞춤법 검사가 필요한 경우
Dialogflow 모델 queryText 에 교정 기능이 사용 설정되었습니다.
수정된 사용자 입력이 포함됩니다. |
intentName |
일치된 인텐트의 고유 식별자입니다. |
intentDisplayName |
매칭된 인텐트의 이름입니다. |
intentDetectionConfidence
|
일치의 신뢰도 점수 숫자입니다.
queryText ~intentName 사이 |
text |
텍스트 응답입니다. |
jsonPayload
|
커스텀 페이로드 응답.
이 문자열은 맞춤
페이로드를 정의합니다.
페이로드에 유효한 Business Messages JSON이 없는 경우
객체 구조이면 error 에서 문제를 설명합니다. |
error |
인텐트 처리 메시지의 오류 설명입니다. |
liveAgentHandoff |
실제 상담사 핸드오프 절차에 대한 커스텀 메타데이터입니다. |
autoResponded
|
Business Messages가 자동으로 응답했는지 여부 Dialogflow의 답변을 사용자에게 제공합니다. |
message |
자동 응답의 페이로드입니다. |
responseSource
|
자동 응답의 소스입니다. 자세한 내용은
ResponseSource |