타사 Messaging 채널에 사용자 정의 Messaging 구성 요소 추가
AI 에이전트가 기본 응답 형식과 함께 기존 채팅 및 타사 Messaging 채널에서 양식과 같은 사용자 정의 Messaging 구성 요소를 렌더링할 수 있도록 기본 Messaging 화면을 사용자 정의합니다.
필수 Edition
| 지원되는 Edition을 확인하세요. | |
이 문서는 다음에 적용됩니다.
|
고급 WhatsApp, 표준 및 고급 Facebook Messenger, 표준 및 고급 SMS, 고급 Apple Messages for Business, 고급 LINE, 자체 채널 가져오기 |
이 문서는 다음에 적용되지 않습니다.
|
고급 앱 내 채팅 또는 고급 웹 채팅 채널 |
AI 에이전트가 기본 응답 형식과 함께 양식과 같은 사용자 정의 Messaging 구성 요소를 렌더링할 수 있도록 Agentforce 기본 Messaging 화면을 사용자 정의합니다. 파일 기반 Messaging 표면을 대체하는 사용자 정의 AiSurface를 정의하고 기존의 기본 응답 형식을 유지하고 에이전트가 사용할 각 Messaging 구성 요소에 대해 새 AiResponseFormat 항목을 추가합니다.
사용자 정의 Messaging 구성 요소를 사용하는 경우
기존 Salesforce 채팅 배포 또는 타사 Messaging 채널(예: WhatsApp, Apple Messages for Business, Facebook Messenger 또는 LINE)을 통해 고객에게 서비스를 제공하고 에이전트가 서식 있는 대화형 구성 요소를 반환하도록 하려면 사용자 정의 Messaging 구성 요소를 사용합니다.
사용자 정의 가능한 Messaging 표면은 기본으로 제공되는 Messaging 응답 형식(MessagingChoices, MessagingChoicesWithImages, MessagingRichLink 및 MessagingTimePicker)을 유지하고 새 구성 요소를 추가할 수 있습니다.
전제 조건
- Service Cloud 메시징 채널: 사용자 정의 가능한 Messaging 연결을 설정하기 전에 레거시 채팅 또는 타사 채널에 적절한 Service Cloud Messaging 채널을 구성합니다.
- 메타데이터 API 버전: 검색 및 배포에 버전 66.0 이상을 사용합니다.
- 기존 에이전트: 파일 기반 Messaging 연결(
SurfaceAction__Messaging)을 사용하는 Agentforce 에이전트입니다. - Messaging 구성 요소: ID 또는 개발자 이름을 응답 형식으로 참조할 수 있는 배포된 Messaging 구성 요소(예: 양식)입니다.
작동 방법
기본 Messaging 표면은 4개의 기본 응답 형식으로 전송되는 파일 기반 표면(SurfaceAction__Messaging)으로 제공됩니다. 메시징 구성 요소를 추가하려면 파일 기반 화면을 동일한 네 가지 응답 형식과 새 사용자 정의 형식을 참조하는 사용자 정의 가능한 AiSurface로 교체합니다.
배포 후 에이전트는 선택 항목, 서식 있는 링크, 시간 선택기에 기본 응답 형식을 사용하고 설명 및 지침이 고객의 요청과 일치하면 사용자 정의 형식을 선택합니다.
사용자 정의 Messaging 구성 요소 설정
이 구조를 사용하여 메타데이터 파일을 구성한 다음, 다음 단계를 완료합니다.
metadataToDeploy/
├── package.xml
├── aiResponseFormats/
│ └── Messaging_Form_Messaging_Component.aiResponseFormat
├── aiSurfaces/
│ └── {CustomMessagingSurface}.aiSurface
└── genAiPlannerBundles/
└── {YourAgentDevName}.genAiPlannerBundle1단계: 에이전트의 GenAiPlannerBundle 검색
메타데이터 API를 통해 에이전트의 GenAiPlannerBundle를 검색합니다. 이 package.xml를 사용하여 검색합니다.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>GenAiPlannerBundle</name>
</types>
<version>66.0</version>
</Package>검색은 에이전트의 GenAiPlannerBundle를 반환합니다.
metadataToDeploy/
└── genAiPlannerBundles/
└── {YourAgentDevName}.genAiPlannerBundle2단계: 파일 기반 Messaging 화면 교체
GenAiPlannerBundle에서 surface 값이 SurfaceAction__Messaging인 plannerSurfaces 항목을 찾습니다. 사용자 정의 가능한 메시징 화면(예: CustomMessagingSurface)의 고유한 개발자 이름으로 surface을 변경합니다. surfaceType를 Messaging로 설정합니다.
<?xml version="1.0" encoding="UTF-8"?>
<GenAiPlannerBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<!-- Other agent configuration -->
<plannerSurfaces>
<adaptiveResponseAllowed>true</adaptiveResponseAllowed>
<callRecordingAllowed>false</callRecordingAllowed>
<surface>CustomMessagingSurface</surface>
<surfaceType>Messaging</surfaceType>
</plannerSurfaces>
</GenAiPlannerBundle>이 변경 사항은 파일 기반 Messaging 화면을 분리하고 사용자 정의 가능한 Messaging 화면을 해당 위치에 첨부합니다.
3단계: 사용자 정의 가능한 Messaging 화면 만들기
배포 번들에 aiSurfaces 폴더를 만듭니다. 그 안에 {the_unique_dev_name_from_step_2}.aiSurface라는 파일을 만듭니다. 파일의 개발자 이름은 2단계에서 설정한 surface 값과 일치해야 합니다.
표준 Messaging 동작이 계속 작동하도록 사용자 정의 가능한 표면에 4개의 기본 Messaging 응답 형식을 모두 포함해야 합니다.
<?xml version="1.0" encoding="UTF-8"?>
<AiSurface xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Customizable Messaging connection</description>
<instructions>
<instruction>Do not use any of the SURFACE_ACTION__* response formats when none of the instructions below are met.</instruction>
<sortOrder>1</sortOrder>
</instructions>
<instructions>
<instruction>Do not use the below instructions when the response contains more than 10 choices.</instruction>
<sortOrder>2</sortOrder>
</instructions>
<instructions>
<instruction>Do not use any of the SURFACE_ACTION__Messaging* type formatting when the response contains only a single, text-only choice and does not include images or URLs.</instruction>
<sortOrder>3</sortOrder>
</instructions>
<masterLabel>Messaging</masterLabel>
<responseFormats>
<enabled>true</enabled>
<responseFormat>SurfaceAction__MessagingChoices</responseFormat>
</responseFormats>
<responseFormats>
<enabled>true</enabled>
<responseFormat>SurfaceAction__MessagingChoicesWithImages</responseFormat>
</responseFormats>
<responseFormats>
<enabled>true</enabled>
<responseFormat>SurfaceAction__MessagingRichLink</responseFormat>
</responseFormats>
<responseFormats>
<enabled>true</enabled>
<responseFormat>SurfaceAction__MessagingTimePicker</responseFormat>
</responseFormats>
<source>SurfaceAction__Messaging</source>
<surfaceType>Messaging</surfaceType>
</AiSurface>에이전트가 사용할 각 사용자 정의 메시징 구성 요소에 대해 사용자 정의 AiResponseFormat의 개발자 이름을 참조하는 responseFormats 항목을 추가합니다.
<responseFormats>
<enabled>true</enabled>
<responseFormat>Messaging_Form_Messaging_Component</responseFormat>
</responseFormats>4단계: 사용자 정의 AiResponseFormat 만들기
aiResponseFormats 폴더를 만듭니다. 내부에 각 사용자 정의 Messaging 구성 요소에 대해 {FormatDevName}.aiResponseFormat로 명명된 파일을 만듭니다.
이 예에서는 양식 Messaging 구성 요소를 정의합니다. input 필드는 MessageDefinition 템플릿 스키마를 사용하여 개발자 이름(또는 ID)으로 배포된 Messaging 구성 요소를 참조합니다. 에이전트가 원시 JSON을 생성하는 대신 템플릿을 채우도록 input_strategy을 use_template로 설정합니다.
<?xml version="1.0" encoding="UTF-8"?>
<AiResponseFormat xmlns="http://soap.sforce.com/2006/04/metadata">
<description>A response action. Use this when the user wants to create a case. The user is presented with rich UI.</description>
<input>{"template":{"messageType":"FormMessage","id":"{{ uuid4() }}","form":{"formatType":"MessageDefinition","messageDefinitionNameOrId":"Create_Case_Form"}},"input_strategy":"use_template"}</input>
<instructions>
<instruction>Always use this response format to create a case.</instruction>
<sortOrder>1</sortOrder>
</instructions>
<masterLabel>Messaging Form Messaging Component</masterLabel>
</AiResponseFormat>양식 템플릿 스키마
이 템플릿 스키마를 양식 Messaging 구성 요소에 사용합니다. AiResponseFormat의 input 필드는 JSON으로 인코딩된 단일 줄 문자열이어야 합니다. 여기에 있는 확장된 버전은 가독성을 위해서만 표시됩니다.
{
"template": {
"messageType": "FormMessage",
"id": "{{ uuid4() }}",
"form": {
"formatType": "MessageDefinition",
"messageDefinitionNameOrId": "Create_Case_Form"
}
},
"input_strategy": "use_template"
}| 필드 | 상세 설명 |
|---|---|
template.messageType |
Messaging 구성 요소 유형입니다. 양식 구성 요소에 FormMessage을 사용합니다. |
template.id |
메시지의 고유 식별자입니다. {{ uuid4() }}를 사용하여 런타임 시 생성합니다. |
template.form.formatType |
구성 요소의 참조 유형입니다. MessageDefinition를 사용하여 배포된 Messaging 구성 요소를 참조합니다. |
template.form.messageDefinitionNameOrId |
에이전트가 렌더링하는 배포된 Messaging 구성 요소의 ID 또는 개발자 이름입니다. 구성 요소의 값으로 교체합니다. |
input_strategy |
에이전트가 원시 JSON을 생성하는 대신 템플릿을 채우도록 use_template로 설정합니다. |
5단계: package.xml 파일 만들기
배포 번들의 루트에서 세 가지 메타데이터 유형을 모두 선언하는 package.xml 파일을 만듭니다.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>AiResponseFormat</name>
</types>
<types>
<members>*</members>
<name>AiSurface</name>
</types>
<types>
<members>*</members>
<name>GenAiPlannerBundle</name>
</types>
<version>66.0</version>
</Package>6단계: 배포
Salesforce CLI 사용하여 메타데이터를 배포합니다.
sf project deploy start --manifest metadataToDeploy/package.xml기본 메타데이터 API 도구를 사용하여 배포할 수도 있습니다. 증분적으로 배포하는 경우 표면에서 응답 형식을 참조하므로 AiSurface 엔티티보다 먼저 AiResponseFormat 엔티티를 배포합니다.



