Skip to content

Commit

Permalink
Feature/add rendering html tags for share chatbot (#3343)
Browse files Browse the repository at this point in the history
add rendering html tags for share chatbot
  • Loading branch information
HenryHengZJ authored Oct 21, 2024
1 parent 4a9ffe7 commit a0d93f9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/ui/src/views/chatflows/ShareChatbot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {

const [isPublicChatflow, setChatflowIsPublic] = useState(chatflow.isPublic ?? false)
const [generateNewSession, setGenerateNewSession] = useState(chatbotConfig?.generateNewSession ?? false)
const [renderHTML, setRenderHTML] = useState(chatbotConfig?.renderHTML ?? false)

const [title, setTitle] = useState(chatbotConfig?.title ?? '')
const [titleAvatarSrc, setTitleAvatarSrc] = useState(chatbotConfig?.titleAvatarSrc ?? '')
Expand Down Expand Up @@ -138,6 +139,12 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {

if (isSessionMemory) obj.overrideConfig.generateNewSession = generateNewSession

if (renderHTML) {
obj.overrideConfig.renderHTML = true
} else {
obj.overrideConfig.renderHTML = false
}

if (chatbotConfig?.starterPrompts) obj.starterPrompts = chatbotConfig.starterPrompts

if (isAgentCanvas) {
Expand Down Expand Up @@ -312,6 +319,9 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
case 'showAgentMessages':
setShowAgentMessages(value)
break
case 'renderHTML':
setRenderHTML(value)
break
}
}

Expand Down Expand Up @@ -480,6 +490,13 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
{textField(textInputPlaceholder, 'textInputPlaceholder', 'TextInput Placeholder', 'string', `Type question..`)}
{colorField(textInputSendButtonColor, 'textInputSendButtonColor', 'TextIntput Send Button Color')}

<>
<Typography variant='h4' sx={{ mb: 1, mt: 2 }}>
Render HTML
</Typography>
{booleanField(renderHTML, 'renderHTML', 'Render HTML on the chat')}
</>

{/*Session Memory Input*/}
{isSessionMemory && (
<>
Expand Down

0 comments on commit a0d93f9

Please sign in to comment.