Business Messages 에이전트와의 대화에서 환영 메시지는 대화의 톤을 정하세요. 또한 사용자에게 에이전트가 무엇을 할 수 있는지 알 수 있습니다. 사용자의 질문과 기대치를 결정합니다.
에이전트는 사용자가 대화를 열 때마다 환영 메시지를 보냅니다. 이 에이전트는 대화 시작 조건도 표시할 수 사용자에게 알려지거나 자주 사용되는 경로를 안내합니다.
사용자가 상담사의 근무 시간 외 시간에 대화를 시작하려고 하면 에이전트가 오프라인 메시지를 표시하는 경우 다른 채널을 공유하거나 다음 단계를 제안하는 데 사용할 수 있습니다. 에이전트의 안정성과 사용성을 높일 수 있습니다.
에이전트 및 위치 수준 설정
에이전트 또는 위치 수준에서 대화 설정을 지정할 수 있습니다.
상담사 수준: 이러한 대화 설정은 모든 진입점에 있어야 합니다
상담사 수준의 환영 메시지는 '문의해 주셔서 감사합니다' Bridgepoint Runners..." 대화 주제 전사적인 행동이나 정보가 포함됩니다.
위치 수준: 이 설정은 에이전트 수준 설정보다 우선 적용됩니다.
PLACESHEET
동안 해당 위치와의 대화에만 적용됩니다. 진입점MAPS
개.위치 수준의 환영 메시지는 '문의해 주셔서 감사합니다' Bridgepoint Runners on Amphitheatre Pkwy..." 대화 주제 위치 기반 작업 또는 정보에 관해 알아봅니다. 오프라인 메시지에서 언급할 수 있는 항목 위치를 알려줍니다.
언어
상담원과 위치는 언어별로 별도의 설정을 지정할 수 있습니다. 도움이 될 수 있습니다 예를 들어 에이전트는 'en' 있어야 하며 스페인어로 'es'에 대한 환영 메시지가 언어 Business Messages는 사용자 기기의 보고된 언어와 에이전트 또는 위치에 대화 설정이 있는 언어입니다.
이 언어 일치는 각 메시지의 resolvedLocale
필드 나
가중치가 해결된 상담사 또는 위치의 defaultLocale
를 지정할 수 있습니다.
언어 일치 자세한 내용은 현지화 및
언어.
Business Messages는 확인된 언어를 사용하여 어떤 대화인지 설정을 적용할 수 있습니다.
환영 메시지
에이전트와 사용자 간의 대화에서 첫 번째 메시지는 에이전트의 환영 메시지를 보냅니다. 환영 메시지는 사용자가 새 대화 좋은 환영 메시지 에이전트와의 상호작용에 대한 사용자의 기대치를 설정합니다. 환영 메시지 수정하기 대화 설정 업데이트를 참고하세요.
대화 주제
좋은 환영 메시지는 에이전트의 기능을 개략적으로 다루고 개방형의 적절한 대화를 시작하는 데 도움이 됨 사용자를 자주 질문하거나 알려진 기능을 안내합니다.
대화 주제는 추천된 세로 방향으로 겹쳐서 표시됨 환영 메시지를 직접 팔로우할 수 있습니다. 사용자가 대화를 탭할 때 시작 조건의 경우 에이전트가 설정한 사전 정의된 콘텐츠 및 포스트백 데이터를 수신합니다. 시작 조건을 지정하면 됩니다.
에이전트가 특정 요청에 대해 자동화 기능을 지원하는 경우 대화 시작 조건이 이러한 요청에 매핑되어 사용자가 이미 알고 있는 자동화를 위한 입력을 제공하고 자유 형식의 사용자 질문을 있습니다.
상담사는 최대 5개의 대화 시작 조건을 사용할 수 있으며 각 시작 문구는 최대 35자(영문 기준)까지 허용됩니다.
대화 시작 조건을 추가하거나 수정하려면 대화 주제 업데이트 설정을 참조하세요.
오프라인 메시지
사용자가 상담사가 운영 중인 외부의 상담사와 대화를 시작할 때
시간(
MessagingAvailability
),
사용자가 에이전트의 오프라인 메시지를 수신합니다. 사람을 대표하는 유일한 사용자
가용성은 오프라인 메시지를 트리거할 때 고려됩니다.
봇 담당자가 항상 환영 메시지를 보내도록 하세요. 좋은 오프라인 메시지
- 상담사가 부재중인 이유를 공유합니다.
- 사용자에게 적절한 다음 단계나 다른 연락 채널을 안내합니다.
- 환영 메시지와 대화 시작 문구의 어조와 일치합니다.
잘못된 오프라인 메시지
'죄송합니다. 영업이 종료되었습니다.'
좋은 오프라인 메시지
"현재 업무가 종료되었지만 내일 오전 8시에 다시 이용하실 수 있습니다. 만약 긴급 지원이 필요한 경우 지원팀(+12223334444) 또는 support@gtb.com으로 문의하세요."
오프라인 메시지를 수정하려면 대화형 설정 업데이트를 참고하세요.
대화형 설정 업데이트
환영 메시지 또는 대화 시작 문구를 관리하려면 PATCH 요청을 만드세요.
비즈니스 커뮤니케이션
API
에이전트 또는 위치의 conversationalSettings
필드를 업데이트합니다.
conversationalSettings
필드를 업데이트할 때
이
ConversationalSetting
객체를 지정합니다. 업데이트 요청은 다음을 포함하여 수정 중인 모든 입력란의 내용을 덮어씁니다.
하위 필드만 반환합니다. 예를 들어 사용자가
대화 시작 문구는 포함하지 않는 경우 이전 요청은 모두
대화 주제
기본 요건
대화 설정을 업데이트하려면 다음 항목이 필요합니다.
- 개발 머신에 있는 GCP 프로젝트의 서비스 계정 키 경로입니다.
- 설정을 업데이트할 언어
에이전트 수준 설정의 경우
name
에이전트 (예: 'brands/12345/agents/67890')입니다.에이전트의
name
를 모르는 경우 해당 에이전트의 모든 에이전트 나열을 참조하세요. 브랜드를 선택합니다.위치 수준 설정의 경우 위치
name
(예: 'brands/12345/locations/67890')위치의
name
를 모르는 경우 브랜드를 선택합니다.업데이트할 언어(2자 ISO 639-1 언어)입니다. 코드
새 환영 메시지
개인정보처리방침 URL
(선택사항) 대화 주제 텍스트
(선택사항) 대화 시작 조건의 포스트백 데이터
(선택사항) 새 오프라인 메시지
현재 conversationalSettings
값을 모르는 경우 에이전트 받기를 참조하세요.
정보
및 위치 가져오기
정보를 참고하세요.
업데이트 요청 보내기
에이전트 또는 위치를 업데이트하려면 다음 명령어를 실행합니다. 변수 바꾸기 기본 요건에서 식별한 값으로 바꿉니다.
대화 시작 조건을 원하지 않는 경우 conversationStarters
및 모든 관련 주제를 생략합니다.
하위 필드입니다.
에이전트 수준 설정
cURL
# This code updates the conversational settings of a Business Messages agent. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch # Replace the __BRAND_ID__, __AGENT_ID__ and __LOCALE__ # 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__?updateMask=businessMessagesAgent.conversationalSettings.__LOCALE__" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "businessMessagesAgent": { "conversationalSettings": { "__LOCALE__": { "welcomeMessage": { "text": "My first welcome message" }, "offlineMessage": { "text": "My first offline message" }, "privacyPolicy": { "url": "https://www.your-company-website.com/privacy" }, "conversationStarters": [ { "suggestion": { "reply": { "text": "Suggestion 1", "postbackData": "post_back_suggestion_1" } } } ] } } } }'
Node.js
/** * This code snippet updates the conversationalSettings of a Business Messages agent. * Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch * * 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 LOCALE = 'en'; 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 agentName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: agentName, updateMask: 'businessMessagesAgent.conversationalSettings.' + LOCALE, resource: { businessMessagesAgent: { conversationalSettings: { [LOCALE]: { privacyPolicy: { url: 'https://www.your-company-website.com/privacy' }, welcomeMessage: { text: 'My updated welcome message' }, offlineMessage: { text: 'My updated offline message' }, conversationStarters: [ { suggestion: { reply: { 'text': 'Suggestion 2', 'postbackData': 'post_back_suggestion_2', }, }, } ], }, } } } }; bcApi.brands.agents.patch(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();
자바
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.businesscommunications.v1.BusinessCommunications; import com.google.api.services.businesscommunications.v1.model.*; import com.google.common.collect.ImmutableMap; import java.io.FileInputStream; import java.util.Arrays; class Main { /** * Initializes credentials used by the Business Communications API. */ private static BusinessCommunications.Builder getBusinessCommunicationsBuilder() { BusinessCommunications.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businesscommunications")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Communications API builder = new BusinessCommunications .Builder(httpTransport, jsonFactory, null) .setApplicationName(credential.getServiceAccountProjectId()); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { // Create client library reference BusinessCommunications.Builder builder = getBusinessCommunicationsBuilder(); String agentName = "brands/BRAND_ID/agents/AGENT_ID"; Agent agent = new Agent().setBusinessMessagesAgent( new BusinessMessagesAgent().setConversationalSettings(ImmutableMap.of("LOCALE", new ConversationalSetting() .setPrivacyPolicy(new PrivacyPolicy().setUrl("PRIVACY_POLICY_URL")) .setWelcomeMessage(new WelcomeMessage().setText("WELCOME_MESSAGE")) .setOfflineMessage(new OfflineMessage().setText("OFFLINE_MESSAGE")) .setConversationStarters(Arrays.asList( new ConversationStarters().setSuggestion(new Suggestion() .setReply(new SuggestedReply() .setText("REPLY_TEXT") .setPostbackData("POSTBACK_DATA"))), ))))); BusinessCommunications.Brands.Agents.Patch request = builder .build().brands().agents().patch(agentName, agent); request.setUpdateMask("businessMessagesAgent.conversationalSettings.LOCALE"); Agent updatedAgent = request.execute(); System.out.println(updatedAgent.toPrettyString()); } catch (Exception e) { e.printStackTrace(); } } }이 코드는 자바 비즈니스 커뮤니케이션 클라이언트 라이브러리.
Python
"""This code updates the conversational settings of a Business Messages agent. Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch 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, BusinessMessagesAgent, ConversationStarters, ConversationalSetting, OfflineMessage, PrivacyPolicy, WelcomeMessage, NegativeBotFeedbackMessage, BusinesscommunicationsBrandsAgentsPatchRequest, ) # 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) agents_service = BusinesscommunicationsV1.BrandsAgentsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID agent=Agent( businessMessagesAgent=BusinessMessagesAgent( conversationalSettings=BusinessMessagesAgent.ConversationalSettingsValue( additionalProperties=[BusinessMessagesAgent.ConversationalSettingsValue.AdditionalProperty( key='en', value=ConversationalSetting( privacyPolicy=PrivacyPolicy(url='https://www.your-company-website.com/privacy'), welcomeMessage=WelcomeMessage(text='Welcome to Business Messages'), offlineMessage=OfflineMessage(text='This is an offline message'), conversationStarters=[ ConversationStarters( suggestion=Suggestion( reply=SuggestedReply(text='Option 1', postbackData='option_1') ) )] ) ) ] ) ) ) updated_agent = agents_service.Patch( BusinesscommunicationsBrandsAgentsPatchRequest( agent=agent, name=agent_name, updateMask='businessMessagesAgent.conversationalSettings.en' ) ) print(updated_agent)
위치 수준 설정
# This code updates the agent interaction of a bot and human representatives. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/patch # Replace the __BRAND_ID__, __AGENT_ID__, __LOCATION_ID__, __LOCALE__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/locations/__LOCATION_ID__?updateMask=conversationalSettings.__LOCALE__" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "conversationalSettings": { "__LOCALE__": { "welcomeMessage": { "text": "My second welcome message" }, "offlineMessage": { "text": "My second offline message" }, "privacyPolicy": { "url": "https://www.your-company-website.com/privacy" }, "conversationStarters": [ { "suggestion": { "reply": { "text": "Suggestion 2", "postbackData": "post_back_suggestion_2" } } } ] } } }'
형식 및 값 정보는 다음을 참고하세요.
brands.agents.patch
님,
brands.locations.patch
,
및
ConversationalSetting
:
예
에이전트 수준 설정
curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/BRAND_ID/agents/AGENT_ID?updateMask=businessMessagesAgent.conversationalSettings.en" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY businesscommunications)" \ -d "{ 'businessMessagesAgent': { 'conversationalSettings': { 'en': { 'welcomeMessage': { 'text': 'Thanks for contacting Growing Tree Bank. What can I help with today?', }, 'offlineMessage': { 'text': 'We\'re closed for the night. Please reach out to us again tomorrow.', }, 'privacyPolicy': { 'url': 'https://www.growingtreebank.com/privacy', }, 'conversationStarters': [ { 'suggestion': { 'reply': { 'text': 'Set up an account', 'postbackData': 'new-account', }, }, }, { 'suggestion': { 'reply': { 'text': 'Look up account information', 'postbackData': 'account-lookup', }, }, }, ], }, }, }, }"
위치 수준 설정
curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/12345/locations/67890?updateMask=conversationalSettings.en" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json /path/to/service/account/key businesscommunications)" \ -d "{ 'conversationalSettings': { 'en': { 'welcomeMessage': { 'text': 'Thanks for contacting Growing Tree Bank on Amphitheatre Pkwy. What can I help with today?', }, 'offlineMessage': { 'text': 'We\'re closed for the night. Please reach out to us again tomorrow.', }, 'privacyPolicy': { 'url': 'https://www.growingtreebank.com/privacy', }, 'conversationStarters': [ { 'suggestion': { 'reply': { 'text': 'What are your hours?', 'postbackData': 'hours', }, }, }, { 'suggestion': { 'reply': { 'text': 'Set up an account', 'postbackData': 'new-account', }, }, }, { 'suggestion': { 'reply': { 'text': 'Look up account information', 'postbackData': 'account-lookup', }, }, }, { 'suggestion': { 'action': { 'text': 'Call us', 'postbackData': 'call', 'dialAction': { 'phoneNumber': '+12223334444', }, }, }, }, ], }, }, }"