本頁面提供 API 說明文件,說明如何實作 UI 模組的容器方法。以下是可做為容器內元件實作的 Agent Assist 功能。
- 知識輔助,按鍵:
'FAQ'
和'ARTICLE_SUGGESTION'
- 生成式知識輔助,快速鍵:
'KNOWLEDGE_ASSIST_V2'
- 智慧回覆,按鍵:
'SMART_REPLY'
- 對話摘要,索引鍵:
'CONVERSATION_SUMMARIZATION'
屬性
屬性名稱 | 類型 | 註解 |
---|---|---|
功能 | 字串 | 以半形逗號分隔的 Agent Assist 建議功能鍵清單,用於算繪。例如:「SMART_REPLY, CONVERSATION_SUMMARIZATION」 |
api-headers | 字串 | 要在 Dialogflow API 呼叫中加入的其他標頭。例如:「Content-Type:application/json, Accept:application/json」 |
conversation-profile | 字串 | 要使用的對話設定檔名稱。 |
agent-desktop | AgentDesktop | 要整合的服務專員桌面軟體。 |
auth-token | 字串 | 用於 API 呼叫的驗證權杖。 |
api-key | 字串 | 用於 API 呼叫的選用 API 金鑰。 |
頻道 | CommunicationChannel | 此應用程式使用的通訊管道 (即時通訊、語音或全通路)。 |
custom-api-endpoint | 字串 | 要使用的自訂 API 端點 (選用,如果 UI 模組已設定 Proxy 伺服器)。 |
主題 | 'dark' | 'light' | 要使用的色彩主題。 |
show-header | BooleanString | 是否顯示 Agent Assist 建議標題。 |
dark-mode-background | 字串 | 深色模式使用的背景顏色。如未指定,系統會為主要支援的服務專員桌面提供預設值。 |
notifier-server-endpoint | 字串 | 用於事件型對話的通知伺服器端點。 |
event-based-transport | EventBasedTransport | 用於事件型對話的傳輸通訊協定。 |
event-based-library | EventBasedLibrary | 用於事件型對話的程式庫。 |
oauth-client-id | 字串 | 用於隱含驗證的選用 OAuth 用戶端 ID,適用於部分客服中心設定 (Genesys Cloud)。 |
redirect-uri | 字串 | 驗證後要前往的選用重新導向 URI,用於部分客服人員桌面設定 (Genesys Cloud)。 |
genesys-cloud-region | 字串 | Genesys Cloud 的選用區域,預設為 mypurecloud.com。 |
用量
屬性是以字串為基礎的元件屬性,可透過下列方式設定:
HTML
js
<element-selector property-name="value">
JavaScript
js
var el = document.querySelector('element-selector');
el.setAttribute('property-name', 'value');
輸入內容
屬性名稱 | 類型 | 註解 |
---|---|---|
socketIoConnectOpts | SocketIoConnectOpts | 其他 Socket.io 連線選項。 |
config | UiModuleContainerConfig | 設定物件,用於定義模組專屬設定。 |
用量
輸入內容通常是 JavaScript 物件或其他複雜的屬性類型,必須直接在元素例項上指派:
const el = document.querySelector('element-selector');
el.propertyName = value;
類型
如要瞭解元件使用的自訂型別,請參閱下節。
AgentDesktop
"LivePerson" | "GenesysCloud" | "SalesForce" | "Custom"
CommunicationChannel
"chat" | "voice" | "omnichannel"
BooleanString
"true" | "false"
EventBasedTransport
"websocket" | "polling"
EventBasedLibrary
"SocketIo"
SocketIoConnectOpts
interface SocketIoConnectOpts extends SocketIOClient.ConnectOpts {
auth: {
token: string;
};
withCredentials?: boolean;
}
UiModuleContainerConfig
interface UiModuleContainerConfig {
knowledgeAssistConfig?: {
articleLinkConfig: {
/**
* Whether to open the article in a new tab or as a dialog. Defaults to new
* tab.
*/
target?: "blank" | "popup";
/**
* Options to configure the popup's size and location. See
* https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features.
*/
popupWindowOptions?: string;
/**
* The field name on the document metadata if a separate article link source
* is provided.
*/
linkMetadataKey?: string;
};
};
knowledgeAssistV2Config?: {
articleLinkConfig?: {
/**
* Whether to open the article in a new tab or as a dialog. Defaults to new
* tab.
*/
target?: "blank" | "popup";
/**
* Options to configure the popup's size and location. See
* https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features.
*/
popupWindowOptions?: string;
/**
* The field name on the document metadata if a separate article link source
* is provided.
*/
linkMetadataKey?: string;
};
showCopyAnswer: boolean;
showPasteAnswer: boolean;
};
summarizationConfig?: {
/**
* Optional callback that can be used to save the generated summary to an
* external source.
*/
onSaveSummary?: (
summary: {
summary: string;
conversationDetails: ConversationDetails;
},
saveCallbacks: {
setLoading: () => void;
setSuccess: (message: string) => void;
setError: (message: string) => void;
}
) => void;
/** Whether to show the 'Generate summary' button. */
showGenerateSummaryButton?: "true" | "false";
};
}