mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-24 04:31:31 +03:00
feat: allow HTML output
This commit is contained in:
parent
82ebbee568
commit
ec3f02dfaf
@ -92,7 +92,7 @@ export default class Chatbot {
|
||||
|
||||
container.className = `bubble-container ${who}`
|
||||
bubble.className = 'bubble'
|
||||
bubble.textContent = string
|
||||
bubble.innerHTML = string
|
||||
|
||||
this.feed.appendChild(container).appendChild(bubble)
|
||||
|
||||
|
@ -6,12 +6,12 @@ from os import path, environ
|
||||
from pathlib import Path
|
||||
from random import choice
|
||||
from sys import argv, stdout
|
||||
from re import findall
|
||||
from vars import useragent
|
||||
from tinydb import TinyDB, Query, operations
|
||||
from time import sleep
|
||||
import sqlite3
|
||||
import requests
|
||||
import re
|
||||
|
||||
dirname = path.dirname(path.realpath(__file__))
|
||||
|
||||
|
@ -48,16 +48,19 @@ class Brain {
|
||||
/**
|
||||
* Make Leon talk
|
||||
*/
|
||||
talk (speech) {
|
||||
talk (rawSpeech) {
|
||||
log.title('Leon')
|
||||
log.info('Talking...')
|
||||
|
||||
if (speech !== '') {
|
||||
if (rawSpeech !== '') {
|
||||
if (process.env.LEON_TTS === 'true') {
|
||||
// Stripe HTML
|
||||
const speech = rawSpeech.replace(/<(?:.|\n)*?>/gm, '')
|
||||
|
||||
this.tts.add(speech)
|
||||
}
|
||||
|
||||
this.socket.emit('answer', speech)
|
||||
this.socket.emit('answer', rawSpeech)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user