1const uiCss = document.createElement('link'); 2uiCss.setAttribute('rel', 'stylesheet'); 3uiCss.setAttribute('href', 'https://uploadfile.ltdcdn.com/css/chat_index.css'); 4uiCss.setAttribute('crossorigin', true); 5document.head.appendChild(uiCss); 6 7const uiScript = document.createElement('script'); 8uiScript.setAttribute('src', 'https://g.alicdn.com/aliyun-documentation/web-chatbot-ui/0.0.24/index.js'); 9uiScript.setAttribute('crossorigin', true); 10uiScript.setAttribute('type', "module"); 11document.head.appendChild(uiScript); 12 13 14const uiStyle = document.createElement('style'); 15uiStyle.innerHTML = `:root{--webchat-toolbar-background-color:#1464E4;--webchat-toolbar-text-color:#FFF;}.webchat-container{z-index:99999999999;bottom:10px;right:10px;}.webchat-bubble-tip{z-index:99999999999;bottom:70px;right:20px;}.webchat-container,#webChat-dialog{z-index:99999999999;}`; 16document.head.appendChild(uiStyle); 17 18 19window.CHATBOT_CONFIG = { 20 endpoint: "https://ai.saaas.com/chat", // å¯ä»¥æ¿æ¢ä¸º https://{your-fc-http-trigger-domain}/chat 21 displayByDefault: false, // é»è®¤ä¸æ¾ç¤º AI å©æå¯¹è¯æ¡ 22 title: 'ç±åç½AIæºè½ä½', // èªå®ä¹ AI 婿æ é¢ 23 draggable: true, // æ¯å¦å¼å¯ææ½ 24 aiChatOptions: { // èªå®ä¹åå¼åèï¼https://docs.nlkit.com/nlux/reference/ui/ai-chat#conversation-options 25 conversationOptions: { // èªå®ä¹åå¼åèï¼https://docs.nlkit.com/nlux/reference/ui/ai-chat#conversation-options 26 conversationStarters: [ 27 { prompt: 'å¦ä½æ³¨ååå' }, 28 { prompt: 'æ¨èå 个åå' }, 29 { prompt: 'ç±åç½ä»ç»' }, 30 ] 31 }, 32 displayOptions: { // èªå®ä¹åå¼åèï¼https://docs.nlkit.com/nlux/reference/ui/ai-chat#display-options 33 height: 600, 34 // width: 400, 35 }, 36 personaOptions: { // èªå®ä¹åå¼åèï¼https://docs.nlkit.com/nlux/reference/ui/ai-chat#chat-personas 37 assistant: { 38 name: 'ä½ å¥½ï¼ææ¯ ç±åç½AI 婿', 39 // AI 婿ç徿 40 avatar: 'https://img.alicdn.com/imgextra/i2/O1CN01Pda9nq1YDV0mnZ31H_!!6000000003025-54-tps-120-120.apng', 41 tagline: 'æ¨å¯ä»¥å°è¯ç¹å»ä¸æ¹çå¿«æ·å ¥å£å¼å¯ä½éªï¼', 42 } 43 }, 44 messageOptions: { // èªå®ä¹åå¼åèï¼https://docs.nlkit.com/nlux/reference/ui/ai-chat#message-options 45 waitTimeBeforeStreamCompletion: 'never' 46 } 47 }, 48 dataProcessor: { 49 /** 50 * å¨åå端大模ååºç¨å起请æ±åæ¹å Promptã 51 * æ¯å¦å¯ä»¥ç¨äºæ»ç»ç½é¡µåºæ¯ï¼å¨åéåå°ç½é¡µå 容å å«å¨å ï¼åæ¶é¿å å¨å端æ¾ç¤ºè¿äºå 容ã 52 * @param {string} prompt - ç¨æ·è¾å ¥ç Prompt 53 * @param {string} - æ¹ååç Prompt 54 */ 55 rewritePrompt(prompt) { 56 prompt = "website_id:4598 " + prompt; 57 return prompt; 58 } 59 } 60};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.