mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Merge branch 'feature/ChatHistory2' of https://github.com/FlowiseAI/Flowise into feature/ChatHistory2
This commit is contained in:
@@ -1077,7 +1077,7 @@ export class App {
|
|||||||
await this.addChatMessage(apiMessage)
|
await this.addChatMessage(apiMessage)
|
||||||
|
|
||||||
logger.debug(`[server]: Finished running ${nodeToExecuteData.label} (${nodeToExecuteData.id})`)
|
logger.debug(`[server]: Finished running ${nodeToExecuteData.label} (${nodeToExecuteData.id})`)
|
||||||
result.chatId = chatId
|
if (incomingInput.chatId) result.chatId = chatId
|
||||||
return res.json(result)
|
return res.json(result)
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
logger.error('[server]: Error:', e)
|
logger.error('[server]: Error:', e)
|
||||||
|
|||||||
@@ -931,6 +931,7 @@ export const redactCredentialWithPasswordType = (
|
|||||||
export const checkMemorySessionId = (instance: any, chatId: string): string => {
|
export const checkMemorySessionId = (instance: any, chatId: string): string => {
|
||||||
if (instance.memory && instance.memory.isSessionIdUsingChatMessageId && chatId) {
|
if (instance.memory && instance.memory.isSessionIdUsingChatMessageId && chatId) {
|
||||||
instance.memory.sessionId = chatId
|
instance.memory.sessionId = chatId
|
||||||
|
instance.memory.chatHistory.sessionId = chatId
|
||||||
}
|
}
|
||||||
return instance.memory.sessionId
|
return instance.memory.sessionId
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ const ShareChatbot = ({ isSessionMemory }) => {
|
|||||||
const [isPublicChatflow, setChatflowIsPublic] = useState(chatflow.isPublic ?? false)
|
const [isPublicChatflow, setChatflowIsPublic] = useState(chatflow.isPublic ?? false)
|
||||||
const [generateNewSession, setGenerateNewSession] = useState(chatbotConfig?.generateNewSession ?? false)
|
const [generateNewSession, setGenerateNewSession] = useState(chatbotConfig?.generateNewSession ?? false)
|
||||||
|
|
||||||
|
const [title, setTitle] = useState(chatbotConfig?.title ?? '')
|
||||||
|
const [titleAvatarSrc, setTitleAvatarSrc] = useState(chatbotConfig?.titleAvatarSrc ?? '')
|
||||||
|
|
||||||
const [welcomeMessage, setWelcomeMessage] = useState(chatbotConfig?.welcomeMessage ?? '')
|
const [welcomeMessage, setWelcomeMessage] = useState(chatbotConfig?.welcomeMessage ?? '')
|
||||||
const [backgroundColor, setBackgroundColor] = useState(chatbotConfig?.backgroundColor ?? defaultConfig.backgroundColor)
|
const [backgroundColor, setBackgroundColor] = useState(chatbotConfig?.backgroundColor ?? defaultConfig.backgroundColor)
|
||||||
const [fontSize, setFontSize] = useState(chatbotConfig?.fontSize ?? defaultConfig.fontSize)
|
const [fontSize, setFontSize] = useState(chatbotConfig?.fontSize ?? defaultConfig.fontSize)
|
||||||
@@ -108,6 +111,8 @@ const ShareChatbot = ({ isSessionMemory }) => {
|
|||||||
textInput: {},
|
textInput: {},
|
||||||
overrideConfig: {}
|
overrideConfig: {}
|
||||||
}
|
}
|
||||||
|
if (title) obj.title = title
|
||||||
|
if (titleAvatarSrc) obj.titleAvatarSrc = titleAvatarSrc
|
||||||
if (welcomeMessage) obj.welcomeMessage = welcomeMessage
|
if (welcomeMessage) obj.welcomeMessage = welcomeMessage
|
||||||
if (backgroundColor) obj.backgroundColor = backgroundColor
|
if (backgroundColor) obj.backgroundColor = backgroundColor
|
||||||
if (fontSize) obj.fontSize = fontSize
|
if (fontSize) obj.fontSize = fontSize
|
||||||
@@ -252,6 +257,12 @@ const ShareChatbot = ({ isSessionMemory }) => {
|
|||||||
|
|
||||||
const onTextChanged = (value, fieldName) => {
|
const onTextChanged = (value, fieldName) => {
|
||||||
switch (fieldName) {
|
switch (fieldName) {
|
||||||
|
case 'title':
|
||||||
|
setTitle(value)
|
||||||
|
break
|
||||||
|
case 'titleAvatarSrc':
|
||||||
|
setTitleAvatarSrc(value)
|
||||||
|
break
|
||||||
case 'welcomeMessage':
|
case 'welcomeMessage':
|
||||||
setWelcomeMessage(value)
|
setWelcomeMessage(value)
|
||||||
break
|
break
|
||||||
@@ -395,6 +406,14 @@ const ShareChatbot = ({ isSessionMemory }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
{textField(title, 'title', 'Title', 'string', 'Flowise Assistant')}
|
||||||
|
{textField(
|
||||||
|
titleAvatarSrc,
|
||||||
|
'titleAvatarSrc',
|
||||||
|
'Title Avatar Link',
|
||||||
|
'string',
|
||||||
|
`https://raw.githubusercontent.com/FlowiseAI/Flowise/main/assets/FloWiseAI_dark.png`
|
||||||
|
)}
|
||||||
{textField(welcomeMessage, 'welcomeMessage', 'Welcome Message', 'string', 'Hello! This is custom welcome message')}
|
{textField(welcomeMessage, 'welcomeMessage', 'Welcome Message', 'string', 'Hello! This is custom welcome message')}
|
||||||
{colorField(backgroundColor, 'backgroundColor', 'Background Color')}
|
{colorField(backgroundColor, 'backgroundColor', 'Background Color')}
|
||||||
{textField(fontSize, 'fontSize', 'Font Size', 'number')}
|
{textField(fontSize, 'fontSize', 'Font Size', 'number')}
|
||||||
|
|||||||
Reference in New Issue
Block a user