-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link | ||
rel="icon" | ||
href="https://img.alicdn.com/tfs/TB1_ZXuNcfpK1RjSZFOXXa6nFXa-32-32.ico" | ||
type="image/x-icon" | ||
/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>示例网站</title> | ||
<link | ||
href="//g.alicdn.com/??aliyun/dbl-official-ui/2.0.1/css/index.css,dawn/ace-element/0.0.60/index.css,hmod/ace-grid-layout-2023/0.0.5/index.css" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
href="//g.alicdn.com??code/npm/@ali/hmod-ace-2023-box/0.1.0/index.css,code/npm/@ali/hmod-ace-2023-service-contact-us/0.0.24/index.css,code/npm/@ali/hmod-aliyun-com-floating-toolbar/0.1.6/index.css,code/npm/@ali/hmod-aliyun-com-global-nav-search/0.5.10/index.css,code/npm/@ali/hmod-aliyun-com-global-nav/0.1.20/index.css,hmod/ace-2023-homepage-banner/0.1.11/index.css,hmod/ace-2023-homepage-news/0.1.5/index.css,hmod/ace-common-aliyun-index-title/0.0.4/index.css,hmod/ace-common-row-aliyun-free-trial/0.0.4/index.css,hmod/ace-common-row-aliyun-standard/0.0.8/index.css,hmod/ace-common-row-basic-product-datas/0.0.6/index.css,hmod/ace-common-row-entry-alicloud-service/0.0.6/index.css,hmod/ace-customer-case-home/0.1.1/index.css,hmod/ace-dpl-home-map/0.1.0/index.css,hmod/ace-dpl-home-product-category/0.1.0/index.css,hmod/ace-dpl-home-row-best-practices/0.0.10/index.css,hmod/ace-dpl-new-to-link/0.0.8/index.css,hmod/ace-homepage-2020-hmod-footer/0.1.5/index.css,hmod/ace-index-card-product-trial-service/0.0.5/index.css" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body> | ||
<script src="assets/demo_layout.js"></script> | ||
|
||
<link rel="stylesheet" crossorigin href="https://g.alicdn.com/aliyun-documentation/web-chatbot-ui/0.0.24/index.css" /> | ||
<script type="module" crossorigin src="https://g.alicdn.com/aliyun-documentation/web-chatbot-ui/0.0.24/index.js"></script> | ||
<script> | ||
window.CHATBOT_CONFIG = { | ||
endpoint: "/chat", // 可以替换为 https://{your-fc-http-trigger-domain}/chat | ||
displayByDefault: false, // 默认不显示 AI 助手对话框 | ||
title: 'AI 助手', // 自定义 AI 助手标题 | ||
draggable: true, // 是否开启拖拽 | ||
aiChatOptions: { // 自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat#conversation-options | ||
conversationOptions: { // 自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat#conversation-options | ||
conversationStarters: [ | ||
{prompt: '哪款手机续航最长?'}, | ||
{prompt: '你们有哪些手机型号?'}, | ||
{prompt: '有折叠屏手机吗?'}, | ||
] | ||
}, | ||
displayOptions: { // 自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat#display-options | ||
height: 600, | ||
// width: 400, | ||
}, | ||
personaOptions: { // 自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat#chat-personas | ||
assistant: { | ||
name: '你好,我是你的 AI 助手', | ||
// AI 助手的图标 | ||
avatar: 'https://img.alicdn.com/imgextra/i2/O1CN01Pda9nq1YDV0mnZ31H_!!6000000003025-54-tps-120-120.apng', | ||
tagline: '您可以尝试点击下方的快捷入口开启体验!', | ||
} | ||
}, | ||
messageOptions: { // 自定义取值参考:https://docs.nlkit.com/nlux/reference/ui/ai-chat#message-options | ||
waitTimeBeforeStreamCompletion: 'never' | ||
} | ||
}, | ||
dataProcessor: { | ||
/** | ||
* 在向后端大模型应用发起请求前改写 Prompt。 | ||
* 比如可以用于总结网页场景,在发送前将网页内容包含在内,同时避免在前端显示这些内容。 | ||
* @param {string} prompt - 用户输入的 Prompt | ||
* @param {string} - 改写后的 Prompt | ||
*/ | ||
rewritePrompt(prompt) { | ||
return prompt; | ||
} | ||
} | ||
}; | ||
</script> | ||
<style> | ||
:root { | ||
/* webchat 工具栏的颜色 */ | ||
--webchat-toolbar-background-color: #1464E4; | ||
/* webchat 工具栏文字和按钮的颜色 */ | ||
--webchat-toolbar-text-color: #FFF; | ||
} | ||
/* webchat 对话框如果被遮挡,可以尝试通过 z-index、bottom、right 等设置 来调整*/ | ||
.webchat-container { | ||
z-index: 100; | ||
bottom: 10px; | ||
left: 10px; | ||
} | ||
/* webchat 的唤起按钮如果被遮挡,可以尝试通过 z-index、bottom、right 等设置 来调整。也可以通过 CSS 进一步定制唤起按钮的形状、大小等。 */ | ||
.webchat-bubble-tip { | ||
z-index: 99; | ||
bottom: 20px; | ||
left: 20px; | ||
} | ||
</style> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters