Premier commit
This commit is contained in:
28
modules/site/views/assistant/index.php
Normal file
28
modules/site/views/assistant/index.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
assert($this instanceof \Piko\View);
|
||||
|
||||
$this->title = 'Assistant chat';
|
||||
|
||||
$modelsJs = json_encode($models);
|
||||
$responseUrl = $this->getUrl('site/assistant/response');
|
||||
|
||||
$script = <<<JS
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
new ChatApp({
|
||||
target: document.getElementById('chat-app'),
|
||||
props : {
|
||||
proxyBaseUrl: '$responseUrl',
|
||||
model_list: $modelsJs
|
||||
}
|
||||
});
|
||||
})
|
||||
JS;
|
||||
|
||||
$this->registerJs($script);
|
||||
|
||||
?>
|
||||
|
||||
<div id="chat-app"></div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user