|
2 | 2 |
|
3 | 3 | {%- block scripts %} |
4 | 4 | {{ super() }} |
5 | | - |
| 5 | + |
6 | 6 | <!-- OSA Chat Widget (HED Assistant) |
7 | 7 | Privacy Note: This widget sends page content to an external AI service when |
8 | 8 | allowPageContext is enabled. The widget provides contextual help for HEDTools documentation. |
9 | 9 | Data sent: Page text content, user questions |
10 | 10 | Service: OSA Chat Widget (osa-demo.pages.dev) |
11 | 11 | --> |
12 | | - <script src="https://osa-demo.pages.dev/osa-chat-widget.js" |
13 | | - crossorigin="anonymous" |
14 | | - defer></script> |
15 | | - <script defer> |
16 | | - // Initialize widget after script loads (defer ensures non-blocking) |
17 | | - if (window.OSAChatWidget) { |
18 | | - OSAChatWidget.setConfig({ |
19 | | - communityId: 'hed', |
20 | | - title: 'HED Assistant', |
21 | | - initialMessage: 'Hi! I can help with using the Python HEDTools. What would you like to know?', |
22 | | - placeholder: 'Ask about HED...', |
23 | | - suggestedQuestions: [ |
24 | | - 'How do I install the Python HEDTools?', |
25 | | - 'How do I validate a HED string using the Python HEDTools?', |
26 | | - 'How do I run the HEDTools hedpy command line tool?', |
27 | | - 'What tools are available?' |
28 | | - ], |
29 | | - widgetInstructions: 'User is on the Python HEDTools documentation most likely looking for how to use these tools', |
30 | | - showExperimentalBadge: true, |
31 | | - allowPageContext: true, |
32 | | - pageContextDefaultEnabled: true |
33 | | - }); |
34 | | - } |
| 12 | + <script> |
| 13 | + // Define config before the widget script loads |
| 14 | + window.osaChatConfig = { |
| 15 | + communityId: 'hed', |
| 16 | + title: 'HED Assistant', |
| 17 | + initialMessage: 'Questions about HED or Python HEDTools? Ask me!', |
| 18 | + placeholder: 'Questions about Python HEDTools?', |
| 19 | + suggestedQuestions: [ |
| 20 | + 'How do I install the Python HEDTools?', |
| 21 | + 'How do I validate a HED string using the Python HEDTools?', |
| 22 | + 'How do I run the HEDTools hedpy command line tool?', |
| 23 | + 'What tools are available?' |
| 24 | + ], |
| 25 | + widgetInstructions: 'User is on the Python HEDTools documentation most likely looking for how to use these tools', |
| 26 | + showExperimentalBadge: true, |
| 27 | + allowPageContext: true, |
| 28 | + pageContextDefaultEnabled: true |
| 29 | + }; |
35 | 30 | </script> |
| 31 | + <script src="https://osa-demo.pages.dev/osa-chat-widget.js" |
| 32 | + crossorigin="anonymous" |
| 33 | + defer |
| 34 | + onload="window.OSAChatWidget && window.OSAChatWidget.setConfig(window.osaChatConfig)"></script> |
36 | 35 | {%- endblock scripts %} |
| 36 | + |
0 commit comments